Method and system for detecting defects of corrugated board stacks based on machine vision

By using multi-source time-division triggering and adaptive algorithms, the problems of texture confusion and uneven lighting in corrugated cardboard stacking detection are solved, and accurate identification and stable detection of corrugated cardboard stacking defects are achieved.

CN121186087BActive Publication Date: 2026-03-24KARRY COMP TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing machine vision-based methods for detecting defects in corrugated cardboard stacking cannot effectively distinguish between the grayscale differences between corrugated texture and defects, resulting in a high false alarm rate. Furthermore, corrugated board defects are easily confused with uneven lighting, leading to a high missed detection rate and failing to meet the requirements for comprehensive management.

Method used

Multi-source time-division triggering is used to acquire multi-channel images. An adaptive Gaussian filter is used to eliminate corrugated texture interference. High and low thresholds are set, and periodic intensity is quantified by grayscale sequence sorting features to eliminate lighting artifacts and obtain the true defect index.

Benefits of technology

It enables accurate detection of various defects during the stacking of corrugated cardboard, reduces the false positive rate and the missed detection rate, and improves the accuracy and stability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121186087B_ABST
    Figure CN121186087B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of corrugated board detection, and specifically discloses a corrugated board stacking defect detection method and system based on machine vision, wherein a ring-shaped LED array light source at the side of a stacking transmission line and a vertical diffuse light source at the top are triggered at different times, an industrial CCD camera synchronously acquires reflected light, transmitted light and visible light channel images, image features are fused to generate a defect response graph, corrugated texture interference is eliminated through adaptive Gaussian filtering, a maximum value proportion of the defect response graph is combined with dynamic adjustment of high and low double thresholds based on illumination, candidate defect regions are segmented and merged to calculate a preliminary stacking defect index, regional continuous edge ridge lines are extracted to quantify periodic intensity, and illumination artifacts are excluded in combination with structural similarity indexes, and finally a real defect index is obtained.The present application effectively improves the accuracy of stacking defect detection, reduces the false alarm rate, can adapt to the detection requirements of illumination fluctuation and curved edge rubbing plate defects, and meets the quality control requirements of corrugated board production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of corrugated cardboard inspection technology, and in particular to a method and system for detecting stacking defects in corrugated cardboard based on machine vision. Background Technology

[0002] In the corrugated cardboard production process, stacking defects (such as dents, stains, interlayer gaps, and corrugated board defects) directly affect the product's load-bearing capacity and appearance quality. Machine vision-based inspection methods, due to their non-contact and high-efficiency characteristics, have become the mainstream technology for stacking defect detection. However, existing machine vision-based inspection methods still have two major technological limitations:

[0003] First, corrugated cardboard naturally exhibits periodic corrugated patterns on its surface, and some products also have printed patterns or production indentations. The grayscale fluctuations of these background textures are highly similar to real defects such as dents and small-area stains. Traditional detection methods often employ fixed threshold segmentation and single-channel image analysis, which cannot effectively distinguish the grayscale differences between textures and defects. Furthermore, uneven lighting in the production environment can further cause grayscale shifts in the defect response spectrum, leading to normal texture areas being misjudged as defects, significantly increasing the false alarm rate. Second, the grayscale distribution characteristics of corrugated board defects are easily confused with localized bright areas formed by uneven lighting. Existing methods rely on edge straight line similarity analysis to determine periodicity, which cannot adapt to the curved edge shapes that may appear due to stacking deviations in corrugated board defects. Moreover, it is difficult to accurately capture periodic features when interfered with by shadows, resulting in a high rate of missed detection for corrugated board defects and failing to meet the comprehensive control requirements for stacking quality.

[0004] Therefore, there is an urgent need for a machine vision-based method and system for detecting defects in corrugated cardboard stacking to solve the above problems. Summary of the Invention

[0005] The purpose of this invention is to provide a machine vision-based method for detecting stacking defects in corrugated cardboard, comprising the following steps:

[0006] A ring-shaped LED array light source is symmetrically installed on both sides of the stacking conveyor line, and a vertical diffuse light source is installed on the top. The three light sources trigger illumination at preset time intervals and acquire reflected light channel images, transmitted light channel images, and visible light images.

[0007] The fused image features are obtained based on the reflected light channel image, the transmitted light channel image, and the visible light image, and the defect response spectrum is obtained based on the fused image features.

[0008] An adaptive Gaussian filter is used to eliminate corrugated texture interference;

[0009] High and low thresholds are set based on the proportion of the maximum value in the defect response spectrum;

[0010] Candidate defect regions are segmented and extracted, and preliminary stacking defect indices are obtained;

[0011] Continuous edge ridges of candidate defect regions are extracted, and the periodic intensity is quantified by gray-scale sequence sorting features. The structural similarity index is combined to eliminate lighting artifacts in order to obtain the true defect index.

[0012] Furthermore, the steps of obtaining fused image features based on the reflected light channel image, the transmitted light channel image, and the visible light intensity image, and obtaining a defect response map based on the fused image features, include:

[0013] Spectral features were extracted from the reflected light channel image, the transmitted light channel image, and the visible light image to obtain the grayscale information of each channel.

[0014] The grayscale information of the three channels is fused at the pixel level using a fixed weighting coefficient to obtain the features of the fused image;

[0015] Dynamic range compression is performed on the features of the fused image. The truncation threshold of the bright area is determined by statistically analyzing the pixel value distribution, and the pixel values ​​exceeding the threshold are limited.

[0016] An adaptive noise suppression algorithm is used to process the image, and the decision to enable median filtering is based on the local gray-level standard deviation.

[0017] The processed fused image is normalized to the global grayscale value and linearly mapped to the standard grayscale range to generate a defect response map.

[0018] Furthermore, the step of using an adaptive Gaussian filter to eliminate corrugated texture interference includes:

[0019] Perform multi-angle Gabor filtering on visible light images;

[0020] Calculate the sum of squares of the real and imaginary parts of the energy of each filtering result;

[0021] Automatic thresholding of energy maps preserves high-frequency texture regions;

[0022] In the defect response map, the texture mask covers the area and the holes are filled using a circular structuring element closing operation.

[0023] Furthermore, the step of setting high and low thresholds based on the maximum value ratio of the defect response spectrum includes:

[0024] Real-time monitoring of ambient light intensity in the production environment to obtain the current ambient illuminance value;

[0025] The dynamic adjustment coefficient is calculated based on the ambient illuminance value; the higher the illuminance, the smaller the adjustment coefficient.

[0026] Based on the maximum gray value of the defect response map, multiply it by the high threshold scaling factor and the low threshold scaling factor respectively;

[0027] The high threshold ratio coefficient and the low threshold ratio coefficient are multiplied by the dynamic adjustment coefficient respectively to obtain the final high threshold and low threshold.

[0028] Furthermore, the step of segmenting and extracting candidate defect regions and obtaining a preliminary stacking defect index includes:

[0029] A dual-threshold segmentation algorithm is used to process the defect response map, extracting strong defect regions above the high threshold and weak defect regions between the high and low thresholds;

[0030] Edge connection processing is performed on weak defect areas to merge spatially adjacent and similar regions;

[0031] Calculate the area proportion, average gray value, and gray standard deviation of each candidate defect region;

[0032] Based on three characteristics—area proportion, average gray value, and gray standard deviation—a preliminary stacking defect index is calculated.

[0033] The severity of candidate defect areas is classified according to the magnitude of the preliminary stacking defect index, and the preliminary stacking defect index is obtained.

[0034] Furthermore, the steps of extracting continuous edge ridges of candidate defect regions, quantifying periodic intensity through grayscale sequence sorting features, and combining structural similarity index to exclude lighting artifacts to obtain the true defect index include:

[0035] Edge detection is performed on candidate defect regions to extract continuous edge ridges whose length exceeds a set threshold;

[0036] A strip-shaped region was extracted along the normal direction of the edge ridge, and the frequency distribution of the gray-scale sequence sorting pattern was statistically analyzed.

[0037] Calculate the sorting entropy value and analyze the coefficient of variation of edge spacing to quantify the intensity of periodic defect characteristics;

[0038] Calculate the structural similarity index between the highlighted area and the adjacent area to distinguish between real defects and lighting artifacts;

[0039] The final true defect index is calculated by combining the results of the analysis of the intensity of periodic characteristics and structural similarity.

[0040] This invention also discloses a machine vision-based corrugated cardboard stacking defect detection system, comprising:

[0041] The first acquisition module is used to symmetrically install a ring-shaped LED array light source on both sides of the stacking conveyor line, install a vertical diffuse light source on the top, and trigger the illumination of the three light sources at preset time intervals, and acquire the reflected light channel image, the transmitted light channel image and the visible light image.

[0042] The second acquisition module is used to acquire fused image features based on the reflected light channel image, the transmitted light channel image and the visible light image, and to acquire a defect response map based on the fused image features;

[0043] An elimination module is used to eliminate corrugated texture interference using an adaptive Gaussian filter;

[0044] The setting module is used to set high and low thresholds based on the proportion of the maximum value of the defect response spectrum;

[0045] The segmentation module is used to segment and extract candidate defect regions and obtain preliminary stacking defect indices;

[0046] The third acquisition module is used to extract continuous edge ridges of candidate defect regions, quantify the periodic intensity through gray-scale sequence sorting features, and combine structural similarity index to exclude lighting artifacts in order to obtain the true defect index.

[0047] Furthermore, the second acquisition module includes:

[0048] The first acquisition unit is used to extract spectral features from the reflected light channel image, the transmitted light channel image, and the visible light image respectively, and obtain the grayscale information of each channel.

[0049] The second acquisition unit is used to perform pixel-level weighted fusion of the grayscale information of the three channels using fixed weight coefficients to obtain the fused image features;

[0050] The processing unit is used to perform dynamic range compression processing on the features of the fused image, determine the truncation threshold of the bright area by statistically analyzing the pixel value distribution, and limit the pixel values ​​that exceed the threshold.

[0051] The suppression unit is used to process the image using an adaptive noise suppression algorithm, and determines whether to enable median filtering based on the local gray-level standard deviation.

[0052] The generation unit is used to normalize the global grayscale value of the processed fused image and linearly map it to the standard grayscale range to generate a defect response map.

[0053] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described machine vision-based corrugated cardboard stacking defect detection method.

[0054] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described machine vision-based method for detecting defects in corrugated cardboard stacking.

[0055] The beneficial effects of this application are as follows:

[0056] This invention employs a comprehensive technical solution involving multi-source time-division triggering to acquire multi-channel images, fusing image features to generate defect response maps, adaptive Gaussian filtering to eliminate texture interference, high and low dual-threshold segmentation, candidate defect region extraction and preliminary defect index calculation, and artifact elimination to obtain the true defect index. This solution enables accurate detection of various defects during corrugated cardboard stacking, such as dents, stains, interlayer gaps, and corrugated board defects. It addresses the issues of misjudgment of defects caused by corrugated texture confusion and uneven lighting in existing technologies, as well as missed detections caused by the difficulty in distinguishing corrugated board defects from lighting artifacts. This improves the accuracy and stability of corrugated cardboard stacking defect detection. Attached Figure Description

[0057] Figure 1 This is a schematic diagram of a method flow proposed in an embodiment of this application.

[0058] Figure 2 This is a schematic diagram of the system structure proposed in an embodiment of the present invention.

[0059] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0060] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0061] like Figure 1 As shown, this application provides a machine vision-based method for detecting stacking defects in corrugated cardboard, including the following steps:

[0062] S1, a ring-shaped LED array light source is symmetrically installed on both sides of the stacking conveyor line, and a vertical diffuse light source is installed on the top. The three light sources are triggered to illuminate at preset time intervals, and the reflected light channel image, the transmitted light channel image and the visible light image are acquired by an industrial CCD camera.

[0063] S2, obtain fused image features based on the reflected light channel image, the transmitted light channel image and the visible light image, and obtain a defect response map based on the fused image features;

[0064] S3 uses an adaptive Gaussian filter to eliminate corrugated texture interference;

[0065] S4, set high and low thresholds based on the maximum value ratio of the defect response spectrum;

[0066] S5, segment and extract candidate defect regions, and obtain preliminary stacking defect indices;

[0067] S6. Extract continuous edge ridges of candidate defect regions, quantify periodic intensity through gray-scale sequence sorting features, and combine with structural similarity index to exclude lighting artifacts in order to obtain the true defect index.

[0068] As described in steps S1-S6 above, this invention employs a comprehensive technical solution that involves acquiring multi-channel images via multi-source time-division triggering, fusing image features to generate defect response maps, using adaptive Gaussian filtering to eliminate texture interference, high and low dual-threshold segmentation, extracting candidate defect regions and calculating preliminary defect indices, and eliminating artifacts to obtain true defect indices. This solution enables accurate detection of various defects such as dents, stains, interlayer gaps, and corrugated board defects during corrugated cardboard stacking. It solves the problems of misjudgment of defects caused by corrugated texture confusion and uneven lighting in existing technologies, as well as missed detection caused by the difficulty in distinguishing corrugated board defects from lighting artifacts, thereby improving the accuracy and stability of corrugated cardboard stacking defect detection.

[0069] In production and transport scenarios, corrugated cardboard stacks naturally exhibit periodic corrugated textures on their surfaces. Some stacks also bear printed patterns or production indentations. The visual characteristics of these background textures (such as grayscale fluctuation patterns) are highly similar to real defects such as dents and stains. At the same time, the lighting conditions in the production environment of the stacking transport line are easily affected by equipment heat dissipation and external natural light interference, resulting in fluctuations. Uneven lighting can create local bright or shadow areas. The visual characteristics of such lighting artifacts are similar to the grayscale variation characteristics of washboard defects (periodic dents). These physical conditions make it difficult for traditional detection methods to effectively distinguish between real defects and background interference, leading to high false alarm rates and high false negative rates. Therefore, it is necessary to acquire comprehensive visual information about defects through multi-dimensional image acquisition, combined with targeted signal processing algorithms to eliminate interference, and ultimately achieve accurate identification of real defects.

[0070] At the current technological level, traditional corrugated cardboard defect detection methods mostly use a single visible light source to acquire single-channel images and rely solely on fixed threshold segmentation algorithms for defect extraction. This fails to fully capture the differences in reflection and transmission characteristics of defects, making it difficult to identify internal defects (such as interlayer voids). For corrugated texture interference, traditional methods often employ fixed-parameter filtering algorithms, which, while eliminating texture, easily blur the edges of actual defects. In corrugated board defect detection, relying solely on edge straight-line similarity analysis cannot handle interference from curved edges or shadows, and it does not consider the dynamic impact of illumination changes on the threshold, further exacerbating misjudgments and missed detections. This invention addresses these shortcomings by constructing a fully optimized end-to-end scheme from image acquisition to defect determination. Through the synergistic effect of multiple light sources, multiple channels, and adaptive algorithms, it achieves effective suppression of interference and accurate defect identification.

[0071] The system employs a three-way lighting system: symmetrically installed ring-shaped LED arrays on both sides of the stacking conveyor line, and a vertically diffused light source at the top. The three light sources are triggered at preset time intervals, and an industrial CCD camera captures images of the reflected light channel, the transmitted light channel, and the visible light. Specifically, the symmetrically installed ring-shaped LED arrays (using 550nm white LEDs with an array density of 10 LEDs per centimeter) provide stable lateral reflected light, while the top-mounted vertically diffused light source (using a 120° diffusion angle surface light source) provides uniform vertical transmitted light and visible light. The three light sources are triggered at preset time intervals (e.g., every 10ms, sequentially triggering the left ring-shaped LED array, the right ring-shaped LED array, and the top vertically diffused light source). This system completely avoids light interference between different light sources, ensuring that the image corresponding to each light source reflects only the cardboard features under a single light channel. Specifically, the reflected light channel image (triggered by the circular LED array light sources on both sides) highlights surface defects such as dents and stains by observing the differences in light absorption on the cardboard surface (e.g., dented areas absorb reflected light more strongly, resulting in lower grayscale values ​​than normal areas). The transmitted light channel image (triggered by the transmitted light from the top vertical diffuse light source) captures internal defects such as interlayer gaps by observing the differences in light blocking by the cardboard's internal structure (e.g., interlayer gap areas have higher transmitted light intensity and higher grayscale values ​​than normal areas). The visible light image (triggered by the visible light from the top vertical diffuse light source) provides the overall appearance features of the stack, laying the foundation for subsequent texture analysis. The industrial CCD camera is triggered synchronously with the light source, accurately acquiring image data from all three light channels, providing comprehensive and interference-free raw image support for subsequent multi-feature fusion.

[0072] In one embodiment, the steps of obtaining fused image features based on the reflected light channel image, the transmitted light channel image, and the visible light intensity image, and obtaining a defect response map based on the fused image features, include:

[0073] S21, spectral features are extracted from the reflected light channel image, the transmitted light channel image, and the visible light image respectively to obtain the grayscale information of each channel;

[0074] S22, using fixed weighting coefficients to perform pixel-level weighted fusion of the grayscale information of the three channels to obtain the features of the fused image;

[0075] S23, perform dynamic range compression processing on the fused image features, determine the truncation threshold of the bright area by statistically analyzing the pixel value distribution, and limit the pixel values ​​that exceed the threshold.

[0076] S24 uses an adaptive noise suppression algorithm to process the image, and determines whether to enable median filtering based on the local gray-level standard deviation.

[0077] S25, normalize the global grayscale value of the processed fused image and linearly map it to the standard grayscale range to generate a defect response map.

[0078] As described in steps S21-S25 above, by progressively processing the reflected light channel image, transmitted light channel image, and visible light image through spectral feature extraction, pixel-level weighted fusion, dynamic range compression, adaptive noise suppression, and global grayscale normalization, a fused image feature that can comprehensively characterize the stacking defects of corrugated cardboard is obtained, and a defect response map with uniform grayscale distribution and weak interference signal is generated. Its core objective is to solve the problems of incomplete image information in a single channel, image dynamic range overflow, noise interference, and inconsistent grayscale benchmarks that lead to inaccurate defect feature capture, thus providing high-quality image data support for subsequent defect segmentation and recognition.

[0079] Different types of defects in corrugated cardboard stacks exhibit significantly different visual characteristics under different light channels: the reflected light channel image can clearly reflect the grayscale changes of surface defects (such as dents and stains), because surface defects change the reflection angle and intensity of reflected light, resulting in a significant difference in grayscale values ​​between defective and normal areas; the transmitted light channel image can effectively present the characteristics of internal defects (such as interlayer gaps and fiber breaks), because internal defects cause changes in the transmittance of transmitted light, forming a grayscale contrast with normal areas; the visible light image can provide information on the overall appearance of the stack, reflecting the spatial distribution of large-area defects. Relying solely on a single-channel image can lead to missed defects due to missing information. For example, the reflected light channel alone cannot identify internal gaps, and the transmitted light channel alone is insufficient to capture minor surface stains. Furthermore, during multi-channel image acquisition, fluctuations in light source intensity and uneven cardboard material can cause issues such as dynamic range overflow (some pixels have excessively high or low grayscale values), noise interference (e.g., salt-and-pepper noise generated by fluctuations in light source current), and inconsistent grayscale benchmarks (significant differences in grayscale ranges between different channels). These physical phenomena can directly mask defect features. The above steps involve systematic processing of multi-channel images to integrate the advantages of each channel, eliminate interference, and form a feature carrier that accurately reflects defects.

[0080] Spectral features are extracted from the reflected light channel image, transmitted light channel image, and visible light image respectively to obtain the grayscale information of each channel. This step requires the reflected light channel image, transmitted light channel image, and visible light image. During the spectral feature extraction process, for the reflected light channel image, the grayscale co-occurrence matrix algorithm is used to extract the grayscale mean and grayscale contrast. The grayscale mean reflects the overall reflection intensity of the surface area, while the grayscale contrast reflects the difference in reflection intensity caused by surface defects. For example, the grayscale mean of a surface depression area is 20-30 grayscale levels lower than that of a normal area, and the grayscale contrast is lower than that of a normal area. The grayscale gradient is 15-20 levels high. For transmitted light channel images, gradient operators (such as the Sobel operator) are used to extract grayscale gradient values. The grayscale gradient values ​​can characterize the rate of change in transmitted light intensity caused by internal defects. For example, the grayscale gradient value in the interlayer void region is 25-30 levels higher than that in the normal region. For visible light images, histogram statistics are used to extract the grayscale distribution histogram, obtaining the grayscale peak and grayscale distribution width. The grayscale peak corresponds to the baseline grayscale of the cardboard, and the grayscale distribution width reflects the grayscale uniformity of the overall appearance. For example, a large area of ​​stain will increase the grayscale distribution width by 10-15 grayscale levels. Through this step, grayscale information directly related to the defect type can be accurately extracted from each channel, laying the foundation for subsequent fusion processing and avoiding interference from irrelevant information.

[0081] A pixel-level weighted fusion method is used to fuse the grayscale information of the three channels using fixed weighting coefficients to obtain fused image features. Based on the differences in the sensitivity of each channel to defects, fixed weighting coefficients are set: the weighting coefficient for the reflected light channel is 0.4, as this channel has the highest sensitivity to surface defects and is the main source of information for surface dents, stains, and other defects; the weighting coefficient for the transmitted light channel is 0.3, as this channel is highly sensitive to internal defects and can supplement internal features that the surface channel cannot cover; and the weighting coefficient for the visible light channel is 0.3, as this channel can provide overall spatial information and avoid the isolation of local defect features. The specific implementation of pixel-level weighted fusion is as follows: for pixels with the same coordinates in the three-channel image, the grayscale information extracted from each channel is taken (the grayscale mean for the reflected light channel, the grayscale gradient value for the transmitted light channel, and the grayscale value corresponding to the histogram for the visible light channel). The fused pixel value is calculated according to the formula: "fused pixel value = grayscale value of reflected light channel × 0.4 + grayscale value of transmitted light channel × 0.3 + grayscale value of visible light channel × 0.3". For example, if a pixel has a grayscale average of 80 in the reflected light channel, a grayscale gradient of 120 in the transmitted light channel, and a grayscale value of 100 in the visible light channel, then the fusion value of this pixel = 80 × 0.4 + 120 × 0.3 + 100 × 0.3 = 32 + 36 + 30 = 98. This fixed-weight fusion method can specifically enhance the advantages and defects of each channel, avoiding feature weakening caused by equal-weight fusion. It ensures that the fused image features simultaneously include information on surface, internal, and overall defects. For example, in the fused image, the fused pixel value of a surface depression area is 18-25 lower than that of a normal area, while the fused pixel value of an internal interlayer gap area is 20-28 higher than that of a normal area, ensuring that different types of defects can form significant grayscale identifiers.

[0082] Dynamic range compression is performed on the fused image features. The truncation threshold for bright areas is determined by statistically analyzing the pixel value distribution, and the pixel values ​​exceeding the threshold are limited. In the fused image features, some bright pixels (grayscale values ​​usually exceeding 230) will appear due to direct light (such as excessively high local brightness of a ring LED array light source) or reflection from the cardboard surface. The grayscale values ​​of these pixels are much higher than those of normal defect areas, which will cause the grayscale differences of normal defects to be masked during subsequent grayscale analysis. At the same time, low grayscale pixels (grayscale values ​​usually below 20) will appear in the shadow areas of the cardboard edge. Although they have little impact on defects, they will expand the dynamic range of the image and increase the difficulty of subsequent processing. The specific steps for implementing dynamic range compression are as follows: First, histogram statistics are performed on all pixel values ​​of the fused image features to calculate the cumulative distribution probability of the pixel values. The pixel value corresponding to a cumulative distribution probability of 99% is set as the highlight region truncation threshold. This threshold is determined based on the fact that a 99% cumulative probability can cover almost all pixel values ​​of normal defects and normal areas, excluding only 1% of extremely bright pixels. Then, for pixels in the fused image whose grayscale values ​​exceed this truncation threshold, their grayscale values ​​are forcibly set to the truncation threshold. For extremely low grayscale pixels with grayscale values ​​below 5, their grayscale values ​​are set to 5. For example, if the pixel value corresponding to a cumulative probability of 99% is 225 obtained through histogram statistics, then all pixels with grayscale values ​​exceeding 225 are uniformly set to 225, and pixels with grayscale values ​​below 5 are uniformly set to 5. This processing effectively limits the dynamic range of the image, avoids interference from extreme gray values ​​on defect features, and concentrates the gray distribution of the fused image features within the effective range of 5-225. This ensures that the gray differences in normal defect areas can be clearly identified. For example, small stains that were originally covered by bright pixels (fused pixel value 100-120) show a more significant gray difference from normal areas (fused pixel value 150-170) after dynamic range compression.

[0083] An adaptive noise suppression algorithm is used to process the image. The decision to enable median filtering is based on the local gray-level standard deviation. The noise in the fused image features mainly originates from two sources: first, electronic noise from the industrial CCD camera, manifested as randomly distributed salt-and-pepper noise; and second, gray-level fluctuation noise caused by fluctuations in the light source current, manifested as unstable gray-level values ​​in local areas. Traditional fixed noise suppression algorithms (such as global 3×3 median filtering) process all regions uniformly. While eliminating noise, this blurs the gray-level gradient of defect edges, for example, reducing the gray-level gradient of a surface depression edge from 30 to 15, resulting in unclear defect boundaries. The adaptive noise suppression algorithm is implemented as follows: First, the fused image features are divided into 3×3 pixel local regions. The gray-level standard deviation of each local region is calculated using the following formula:

[0084] ;

[0085] in, Let xi represent the grayscale standard deviation, μ represent the fusion value of each pixel in the local area, μ represent the mean of the fusion values ​​in the local area, and n represent the number of pixels. In this example, n is 9. The grayscale standard deviation threshold is set to 5. When the grayscale standard deviation of a local area is less than 5, the noise intensity of the area is determined to be low, and median filtering is not required to preserve the detailed features of the defect edges. When the grayscale standard deviation of a local area is greater than or equal to 5, the noise intensity of the area is determined to be high, and median filtering of a 3×3 pixel window is enabled for noise suppression. The specific operation of median filtering is to sort the fusion values ​​of the 9 pixels in the window by size and take the 5th value after sorting as the new fusion value of the center pixel of the window. For example, the fusion values ​​for a certain local region are [98, 100, 99, 102, 150, 101, 97, 103, 100]. The calculated mean μ≈104.44 and standard deviation σ≈15.6 are greater than the threshold of 5. After enabling median filtering, the fusion values ​​are sorted as [97, 98, 99, 100, 100, 101, 102, 103, 150]. The fifth value, 100, is taken as the new fusion value for the center pixel, effectively eliminating the noise point 150. However, for the defect edge region (grayscale standard deviation 4.2, less than the threshold of 5), median filtering is not performed, and the grayscale gradient of the edge (such as the gradient change from 100 to 80) is preserved. This adaptive processing method can effectively suppress noise while preserving the details of the defect edge to the greatest extent, ensuring that the spatial morphology and grayscale characteristics of the defect are not destroyed, and providing a clear boundary basis for subsequent defect region segmentation.

[0086] The processed fused image undergoes global grayscale normalization and linear mapping to a standard grayscale range to generate a defect response map. Even after dynamic range compression and noise suppression, the grayscale range of the fused image may still fluctuate (e.g., fused images from different batches of cardboard may have grayscale ranges between 10-220 or 15-215). Directly using this for subsequent thresholding would result in inconsistent grayscale benchmarks, leading to unusable thresholds. For example, a threshold of 100 set for a grayscale range of 10-220 might correspond to different defect features in an image with a grayscale range of 15-215. Global grayscale normalization is achieved by first determining the minimum and maximum grayscale values ​​(min and max) of the processed fused image. Then, a linear mapping formula is used to map the fused value x of each pixel to a standard grayscale range of 0-255. The mapping formula is: x'=(x-min)×255 / (max-min), where x' is the mapped standard grayscale value. For example, the minimum grayscale value of the processed and fused image is min=8, and the maximum grayscale value is max=222. If the fused value of a certain pixel is x=98, then the standard grayscale value after mapping is x'=(98-8)×255 / (222-8)=90×255 / 214≈107.24, which is rounded to 107; if the fused value of another pixel is x=80, then after mapping, x'=(80-8)×255 / 214=72×255 / 214≈85.33, which is rounded to 85. This linear mapping unifies all processed fused images to a standard grayscale range of 0-255, generating a defect response map. In this map, the grayscale features of different types of defects have a unified benchmark: the standard grayscale value of the surface depression area is 70-90, the standard grayscale value of the internal interlayer void area is 180-200, and the standard grayscale value of the normal area is 120-140. The grayscale difference between the defect and the normal area is stable at 30-50 grayscale levels, laying a unified grayscale benchmark for subsequent threshold segmentation based on the defect response map, and ensuring the consistency and reliability of defect detection under different batches and different acquisition conditions.

[0087] In one embodiment, the step of using an adaptive Gaussian filter to eliminate corrugated texture interference includes:

[0088] S31, performs multi-angle Gabor filtering on the visible light image;

[0089] S32, calculate the sum of squares of the real and imaginary parts of the energy of each filtering result;

[0090] S33 performs automatic thresholding of the energy spectrum, preserving high-frequency texture regions;

[0091] S34, in the defect response map, the area covered by the texture mask is masked, and the holes are filled by the circular structuring element closing operation.

[0092] As described in steps S31-S34 above, the technical chain of capturing texture features by multi-angle Gabor filtering, generating texture energy maps by calculating the sum of squares of energy, locating high-frequency texture regions by automatic threshold segmentation, and filling with texture masking and closing operations is used to achieve accurate identification and effective elimination of natural periodic textures on the surface of corrugated cardboard. Its core objective is to solve the problem of confusion between corrugated textures and weak defects (such as slight dents and small stains) in grayscale features, and to ensure that only the feature information of real defects is retained in the defect response map, so as to eliminate background texture interference for subsequent defect segmentation and identification.

[0093] The core structural feature of corrugated cardboard is its periodically distributed flute shape. Its surface texture exhibits a fixed spatial period (typically 5-10 mm, corresponding to 8-16 pixel spacing in images captured by industrial CCD cameras). This periodic texture manifests as regular grayscale fluctuations in images; the flute peaks have higher grayscale values ​​due to stronger reflected light, while the flute valleys have lower grayscale values ​​due to weaker reflected light, forming a grayscale variation pattern similar to minor dents. Simultaneously, indentations and printing patterns during the production process also present localized periodic textures, further increasing the risk of false defect detection. If these texture interferences are not eliminated, subsequent threshold segmentation based on defect response maps will misclassify textured areas as defects, leading to a significant increase in the false alarm rate. Therefore, targeted texture extraction and masking techniques are needed to separate the corrugated texture from the defect response map, retaining only the grayscale features of genuine defects, thus laying the foundation for accurate detection.

[0094] The technical implementation and physical significance of multi-angle Gabor filtering for visible light images are as follows: Gabor filtering is a filtering algorithm that can effectively capture the directional and scale features in an image. Its core parameters include filtering direction, scale (standard deviation), and wavelength. For the periodic characteristics of corrugated textures, eight filtering directions (0°, 22.5°, 45°, 67.5°, 90°, 112.5°, 135°, 157.5°) are set to cover all possible directions of the corrugated texture (such as horizontal and vertical corrugations). Five scale parameters are set (standard deviations of 0.8, 1.2, 1.6, 2.0, and 2.4, respectively), corresponding to different spatial periods of the corrugated texture (5mm, 7mm, 9mm, 11mm, and 13mm). The wavelength parameter is set to twice the corresponding scale to ensure that the filtering window can completely cover a single corrugated period. During the filtering process, the visible light image is convolved with the Gabor filter of each parameter combination to obtain 40 filtered images (8 directions × 5 scales). Each image corresponds to the texture feature enhancement effect at a certain direction and scale. For example, the filtering result at 0° and standard deviation of 1.2 will significantly enhance the gray level fluctuation of the transverse corrugated texture, expanding the gray level difference between the peaks and valleys from 15 gray levels to 25 gray levels, providing a clear feature carrier for subsequent texture energy calculation.

[0095] The sum of squares of the real and imaginary energy parts of each filtering result is calculated. Gabor filtering results include real and imaginary parts, reflecting the amplitude and phase information of the image at the filtering direction and scale, respectively. Using only the real or imaginary part cannot fully characterize the energy intensity of the texture, while the sum of squares of energy can integrate both information, highlighting the energy concentration characteristics of the texture region. Specifically, for each Gabor filtered image, the energy value is calculated pixel-by-pixel as "energy value = real pixel value² + imaginary pixel value²", generating 40 energy images. Then, pixel-level maximum value fusion is performed on these 40 energy images; that is, for pixels at the same coordinate in the image, the maximum energy value of that pixel in the 40 energy images is taken as the final energy value, resulting in a global texture energy map. For example, a pixel has a real part of 18 and an imaginary part of 12 in the 0° direction filtering result, and its energy value is 18² + 12² = 324 + 144 = 468; in the 45° direction filtering result, the real part is 10 and the imaginary part is 8, and the energy value is 100 + 64 = 164; therefore, the final energy value of this pixel in the energy map is 468. This energy calculation method can effectively highlight textured areas in all directions and at all scales. The energy value of corrugated textured areas is usually between 300 and 500, while the energy value of normal non-textured areas is between 50 and 150. Real defect areas (such as depressions) have no periodic characteristics, and their energy values ​​are between 100 and 200, forming a significant energy difference between textured and non-textured areas, providing a quantitative basis for subsequent texture localization.

[0096] Automatic thresholding segmentation is performed on the energy spectrum to preserve high-frequency texture regions. The core of automatic thresholding is to adaptively determine the segmentation threshold between textured and non-textured regions through an algorithm, avoiding the subjective bias of manual thresholding. This step uses the Otsu thresholding algorithm, which determines the optimal segmentation threshold by maximizing the inter-class variance between the foreground (textured regions) and background (non-textured regions). The specific implementation process is as follows: First, the gray-level histogram of the energy spectrum is statistically analyzed, and the inter-class variance is calculated for each possible gray-level value (0-255) as the threshold. The formula for calculating the inter-class variance is...

[0097] ;

[0098] in, Represents the variance between classes. Indicates the percentage of background pixels. Indicates the proportion of foreground pixels. This represents the average grayscale value of the background. The average grayscale value of the foreground is represented by the grayscale value. The grayscale value with the largest inter-class variance is selected as the segmentation threshold, which typically corresponds to a grayscale value between 200 and 250 (because the energy values ​​of textured regions are concentrated between 300 and 500, while those of non-textured regions are concentrated between 50 and 200). Pixels with grayscale values ​​higher than the segmentation threshold in the energy map are then marked as textured pixels, and pixels with grayscale values ​​lower than the threshold are marked as non-textured pixels, generating a binarized texture mask. In the mask, "1" represents a textured region, and "0" represents a non-textured region. For example, if the segmentation threshold calculated using the Otsu algorithm is 220, then pixels with energy values ​​higher than 220 are marked as "1," corresponding to corrugated textured regions; pixels with energy values ​​lower than 220 are marked as "0," corresponding to normal regions and true defect regions, respectively. This automatic segmentation method can accurately locate all high-frequency texture areas and adapt to the texture density changes of different batches of corrugated cardboard. For example, although the energy spectrum segmentation thresholds of A-flute (10mm flute spacing) and B-flute (5mm flute spacing) are 215 and 225 respectively, they can accurately distinguish between textured and non-textured areas, avoiding the tedious operation of manually adjusting the thresholds.

[0099] In the defect response map, the area covered by the texture mask is masked, and the holes are filled using a circular structuring element closing operation. The grayscale range of the defect response map required in this step is 0-255, and the grayscale value of the actual defect area differs from that of the normal area by 30-50 grayscale levels. The specific operation of texture masking is as follows: a pixel-level multiplication operation is performed between the texture mask and the defect response map. That is, the grayscale value of the pixel corresponding to texture mask "1" (texture area) in the defect response map is forcibly set to the reference grayscale value of the normal area (usually 120-140, determined by statistically analyzing the grayscale mean of the normal area in the defect response map); the grayscale value of the pixel corresponding to texture mask "0" (non-texture area) remains unchanged. For example, if the original grayscale value of a texture pixel in a defect response map is 95 (easily misjudged as a slight depression), and the baseline grayscale value of the normal area is 130, then after masking, the grayscale value of this pixel is adjusted to 130, consistent with the normal area, eliminating texture interference. If the original grayscale value of a real depression pixel is 80, corresponding to a mask "0", the grayscale value remains unchanged at 80, preserving the defect feature. Since the texture mask may have "holes" (i.e., textured areas are mistakenly marked as non-texture areas) due to low local texture energy during generation, morphological closing operations are used to fill them. A circular structuring element with a radius of 3 pixels is selected. The closing operation process is as follows: first, dilate the texture mask (changing the "0" pixels covered by the structuring element to "1"), then erode (changing the excess "1" pixels covered by the structuring element to "0"), finally filling the holes in the mask to ensure that the texture area is completely masked. For example, if a texture mask contains 2×2 pixel holes, after dilation, the holes are filled with "1"s. After erosion, the extra "1"s at the edges are eliminated, resulting in a complete texture mask. This avoids texture residue in the hole area interfering with subsequent defect segmentation. Through this step, the influence of corrugated texture on defect detection can be completely eliminated, ensuring that only the grayscale features of the real defects are retained in the defect response map. The false alarm rate of subsequent threshold segmentation can be reduced by more than 40%, significantly improving detection accuracy.

[0100] In one embodiment, the step of setting high and low thresholds based on the maximum value ratio of the defect response spectrum includes:

[0101] S41 monitors the light intensity of the production environment in real time and obtains the current ambient illuminance value through a photometric sensor;

[0102] S42, calculate the dynamic adjustment coefficient based on the ambient illuminance value; the higher the illuminance, the smaller the adjustment coefficient.

[0103] S43, based on the maximum gray value of the defect response map, multiply by the high threshold scaling factor and the low threshold scaling factor respectively;

[0104] S44. Multiply the high threshold ratio coefficient and the low threshold ratio coefficient by the dynamic adjustment coefficient respectively to obtain the final high threshold and low threshold.

[0105] As described in steps S41-S44 above, the technical process of real-time monitoring of ambient light intensity, calculation of dynamic light adjustment coefficient, determination of basic proportional threshold based on the maximum gray value of the spectrum, and dynamic adjustment to generate the final high and low thresholds achieves adaptive matching of threshold parameters to fluctuations in production ambient light. Its core objective is to solve the problem of overall gray-scale shift in defect response spectrum caused by uneven lighting, which leads to misjudgment of strong defects and missed detection of weak defects. It ensures that strong defects, weak defects and normal areas can be accurately distinguished under different lighting conditions, providing a reliable threshold basis for the accurate segmentation of subsequent candidate defect areas.

[0106] Real-time monitoring of ambient light intensity in the production environment is achieved by acquiring the current ambient illuminance value using a photometric sensor. The required ambient illuminance value for this step is collected by photometric sensors installed on both sides of the stacking conveyor line. These sensors have a measurement range of 0-2000 lux and a measurement accuracy of ±5 lux. The sampling frequency is consistent with the image acquisition frequency of the industrial CCD camera (30Hz), ensuring that the illumination data corresponding to each frame of the defect response map is real-time synchronized, avoiding threshold adjustment deviations caused by asynchrony between illumination data and image data. The photometric sensor is installed away from direct light from the ring LED array light source and vertical diffuse light source, only collecting ambient diffuse light intensity to prevent interference from direct light from the equipment's light source. For example, at 10:00 AM on a sunny day, with ample natural light, the sensor measures an ambient illuminance of 1200 lux; at 3:00 PM on a cloudy day, with reduced natural light, the sensor measures an ambient illuminance of 350 lux. By acquiring this data in real time, the changes in ambient light at every moment can be accurately captured, providing a basis for subsequent threshold adjustments.

[0107] The dynamic adjustment coefficient is calculated based on the ambient illuminance value. The higher the illuminance, the smaller the adjustment coefficient. The core function of the dynamic adjustment coefficient is to correct the influence of light intensity on the grayscale distribution of the defect response map. Its calculation rule is based on the physical characteristic that "light intensity is positively correlated with the grayscale shift of the map". Taking the most stable light intensity of 500 lux in the production scene as the benchmark value, the influence of light on the grayscale of the map is in a neutral state, and the dynamic adjustment coefficient is set to 1.0. When the illuminance is higher than 500 lux, the grayscale of the map shifts to the higher range, and the adjustment coefficient needs to be reduced to decrease the final threshold and avoid misjudgment of normal areas. When the illuminance is lower than 500 lux, the grayscale of the map shifts to the lower range, and the adjustment coefficient needs to be increased to increase the final threshold and avoid missing weak defects. The specific calculation formula is: Dynamic adjustment coefficient = 1.0 - (current illuminance value - 500 lux) × 0.001, where 0.5 is taken when the calculation result is less than 0.5 (to avoid the threshold being too low due to excessively high illuminance) and 1.5 is taken when the result is greater than 1.5 (to avoid the threshold being too high due to excessively low illuminance). For example, when the current illuminance is 800 lux, the dynamic adjustment coefficient = 1.0 - (800 - 500) × 0.001 = 1.0 - 0.3 = 0.7; when the current illuminance is 300 lux, the dynamic adjustment coefficient = 1.0 - (300 - 500) × 0.001 = 1.0 + 0.2 = 1.2. The introduction of this coefficient enables the threshold parameter to be adjusted linearly with the light intensity, directly offsetting the influence of the grayscale shift in the spectrum, and ensuring that the relative grayscale difference between the threshold and the defect features remains stable.

[0108] Using the maximum grayscale value of the defect response map as a benchmark, it is multiplied by both a high-threshold scaling factor and a low-threshold scaling factor. The maximum grayscale value of the defect response map represents the peak characteristic of the grayscale distribution under the current illumination conditions, reflecting the upper limit of the grayscale value under that illumination. Setting the scaling threshold based on this benchmark ensures that the threshold always matches the grayscale range of the current map, avoiding a disconnect between the threshold and the defect characteristics due to overall grayscale shifts in the map. In this step, the high-threshold scaling factor is set to 0.7, and the low-threshold scaling factor is set to 0.3. This ratio is determined based on a large amount of experimental data. Under different illumination conditions, the ratio of the grayscale value of a strong defect area to the maximum grayscale value of the map is consistently above 0.7 (because strong defects such as large-area depressions have significant light reflection or transmission characteristics, resulting in the greatest grayscale difference compared to normal areas). The ratio of the grayscale value of a weak defect area to the maximum grayscale value is consistently between 0.3 and 0.7 (weak defects such as small-area stains have the next smallest grayscale difference), and the ratio of the grayscale value of a normal area to the maximum grayscale value is consistently below 0.3. For example, if the maximum gray value of a defect response map of a certain frame is 200 (gray value range 0-255) after global gray value normalization as described in weight 2, then the basic value of the high threshold = 200 × 0.7 = 140, and the basic value of the low threshold = 200 × 0.3 = 60. This basic threshold can initially distinguish strong defects (gray value ≥ 140), weak defects (60 < gray value < 140) and normal areas (gray value ≤ 60), providing a basic framework for subsequent dynamic adjustment.

[0109] The high threshold and low threshold ratios are multiplied by the dynamic adjustment coefficient to obtain the final high and low thresholds. This step is the final execution stage of dynamic threshold setting. By combining the base ratio threshold with the illumination dynamic adjustment coefficient, the threshold achieves complete self-adaptation to illumination fluctuations. The specific calculation formula is: Final high threshold = High threshold base value × Dynamic adjustment coefficient, Final low threshold = Low threshold base value × Dynamic adjustment coefficient. The calculation results are rounded to integers to conform to the integer characteristics of image grayscale values. Referring to the previous example, when the maximum grayscale value of the image is 200 and the ambient illumination value is 800 lux (dynamic adjustment coefficient 0.7), the final high threshold = 140 × 0.7 = 98, and the final low threshold = 60 × 0.7 = 42. At this time, due to strong illumination, the overall grayscale of the image is high (normal area grayscale is about 180). Lowering the threshold can avoid misjudging the normal area of ​​140-180 as a strong defect, while ensuring that the strong defect area of ​​98-140 can still be accurately identified. When the maximum grayscale value of the image is 200 and the ambient illuminance is 300 lux (dynamic adjustment coefficient 1.2), the final high threshold = 140 × 1.2 = 168, and the final low threshold = 60 × 1.2 = 72. At this point, due to the weak illumination, the overall grayscale of the image is low (the grayscale of the weak defect area is about 60). The increased threshold can avoid missing weak defects of 60-72 as normal areas, while ensuring that strong defect areas above 168 are not missed. The final high and low thresholds generated by this step can maintain accurate segmentation of strong and weak defects within an illumination fluctuation range of 50-2000 lux. Experiments have verified that its defect segmentation accuracy under different illumination conditions is steadily improved, and the accuracy is significantly improved compared to the fixed threshold, solving the problem of misjudgment and missed detection caused by uneven illumination.

[0110] In one embodiment, the step of segmenting and extracting candidate defect regions and obtaining a preliminary stacking defect index includes:

[0111] S51 uses a dual-threshold segmentation algorithm to process the defect response map, extracting strong defect regions above the high threshold and weak defect regions between the high and low thresholds.

[0112] S52, perform edge connection processing on weak defect areas, and merge spatially adjacent and similar regions;

[0113] S53, calculate the area proportion, average gray value and gray standard deviation of each candidate defect region;

[0114] S54, based on three characteristics—area proportion, average gray value, and gray standard deviation—uses a weighted summation method to calculate the preliminary stacking defect index;

[0115] S55, classify the severity of candidate defect areas according to the magnitude of the preliminary stacking defect index, and obtain the preliminary stacking defect index.

[0116] As described in steps S51-S55 above, the above technical solution can achieve accurate extraction and quantitative evaluation of the real defect area in the defect response map. Its core objective is to solve the problem of missed detection of weak defect areas due to their dispersion. At the same time, by quantifying the severity of defects through multi-feature fusion, it provides a standardized preliminary judgment basis for subsequent elimination of lighting artifacts and determination of the real defect level, ensuring the coherent connection from area extraction to quantitative evaluation and improving the integrity and operability of defect detection.

[0117] In the defect response map (grayscale range 0-255), there are significant differences in the grayscale characteristics and spatial distribution of different types of defects: strong defects (such as large-area depressions and interlayer voids) have significantly changed light reflection or transmission characteristics, with grayscale values ​​much higher than normal areas, and are mostly distributed in continuous blocks in space; weak defects (such as small-area stains and local slight indentations) have slight feature changes, with grayscale values ​​only between high and low thresholds, and are easily affected by residual local noise after texture removal and small fluctuations in illumination, and are divided into multiple scattered small areas; normal areas have grayscale values ​​that are stable below the low threshold because texture interference has been eliminated and illumination effects have been corrected by dynamic threshold. If only strong defect areas are extracted, weak defects will be missed; if scattered weak defect areas are not merged, they will be misjudged as noise due to their small area; if only areas are extracted without quantitative evaluation, the severity of defects cannot be distinguished (such as a 100-pixel stain versus a 10,000-pixel dent). Therefore, a complete process of segmentation, merging, feature calculation, and exponential quantization is required to fully extract all defect areas and achieve preliminary classification, providing a basis for subsequent determination of true defects.

[0118] A dual-threshold segmentation algorithm is used to process the defect response map, extracting strong defect regions above the high threshold and weak defect regions between the high and low thresholds. The gray values ​​of the defect response map have been mapped to the range of 0-255, and the corrugated texture interference has been eliminated. The specific execution logic of the dual-threshold segmentation algorithm is as follows: traverse each pixel of the defect response map, mark pixels with gray values ​​greater than the high threshold (98) as strong defect pixels, mark pixels with gray values ​​between the low threshold (42) and the high threshold (98) as weak defect pixels, and mark pixels with gray values ​​less than the low threshold (42) as normal pixels; then, through a connected region marking algorithm (such as eight-neighbor connected region marking), adjacent strong defect pixels form strong defect regions, and adjacent weak defect pixels form weak defect regions. From a physical perspective, strong defect areas correspond to large-area, high-strength defects in corrugated cardboard stacking, such as full-layer dents (grayscale value 120-150) and large-area interlayer gaps (grayscale value 180-200). These types of defects have a significant impact on the stability of the stacking structure and should be identified first. Weak defect areas correspond to small-area, low-strength defects, such as stains with a diameter of 5-10mm (grayscale value 60-80) and localized minor indentations (grayscale value 50-70). Although these types of defects have a smaller impact, their accumulation may still lead to substandard stacking quality and should be completely removed. For example, in a certain frame of the image, a large area of ​​depression has pixel gray values ​​concentrated between 110 and 130, all of which are higher than the high threshold of 98. It is marked as a strong defect area with an area of ​​5000 pixels. Two small stains have pixel gray values ​​of 65-75 and 70-80, respectively, which are between 42 and 98. They are marked as two independent weak defect areas with areas of 800 pixels and 600 pixels, respectively. This step can clearly distinguish between strong and weak defects and avoid the problem of missed detection of weak defects caused by traditional single threshold segmentation.

[0119] The technical details and effects of edge-connection processing for weak defect regions, merging spatially adjacent and similar regions, are as follows: After segmentation, weak defect regions may appear scattered due to two main reasons: first, the physical shape of the defect itself is discontinuous (e.g., a single stain is separated by cardboard texture residue); second, image noise causes fluctuations in local pixel grayscale values, dividing the complete defect into multiple small regions. Without merging, these scattered small regions, due to their small size, will be judged as noise in subsequent processing, leading to missed detections. This step employs a "region growing and merging algorithm based on edge features." The specific implementation process is as follows: First, edge detection is performed on each weak defect region (using the Sobel operator), extracting the region's edge gradient direction (reflecting the direction of the region's edge) and the region's average grayscale value (reflecting the intensity characteristics of the defect). The adjacent region threshold is set to 5 pixels (i.e., when the shortest distance between the edges of two weak defect regions is less than 5 pixels, they are considered spatially adjacent). The feature similarity threshold is set to an edge gradient direction difference of 15° and a grayscale value difference of 10 grayscale levels (i.e., when the edge gradient direction difference between two regions is less than 15° and the grayscale value difference is less than 10, they are considered feature-similar). All weak defect regions are traversed, and regions that meet the "spatially adjacent and feature-similar" condition are merged. The average grayscale value of the merged region is the weighted average of the two regions (the weight is the region's area percentage). For example, the two independent weak defect regions mentioned above (area 800 pixels, grayscale mean 70; area 600 pixels, grayscale mean 75) have a shortest edge distance of 3 pixels (satisfying spatial adjacency), edge gradient directions of 30° and 38° respectively (difference of 8°, satisfying feature similarity), and a grayscale mean difference of 5 (satisfying feature similarity). After merging, they form a complete weak defect region with an area of ​​1400 pixels and a grayscale mean of 72.1 ((800×70+600×75) / 1400). This merging method not only considers spatial location but also ensures, through edge gradient and grayscale mean, that the merged part is a dispersed portion of the same defect, avoiding the mistaken merging of normal areas into defect regions. This effectively solves the problem of missed detection caused by the dispersion of weak defects, thus improving the completeness of weak defect region extraction.

[0120] The area proportion, average gray value, and gray standard deviation of each candidate defect region are calculated. Extraction of candidate defect regions (including merged weak and strong defect regions) only completes the localization; qualitative evaluation requires quantitative features. The area proportion, average gray value, and gray standard deviation reflect the essential attributes of the defect from three dimensions: spatial size, defect intensity, and gray uniformity, respectively, providing an objective basis for subsequent defect severity assessment. The area proportion is calculated as the number of pixels in the candidate defect region divided by the total number of pixels in the defect response map. The total number of pixels in the defect response map is determined by the resolution of the industrial CCD camera (e.g., 2048 × 1536 = 3145728 pixels). This feature directly reflects the spatial proportion of the defect in the stack; a larger proportion has a more significant impact on stacking quality. The average gray value is calculated as the sum of the gray values ​​of all pixels within the candidate defect region divided by the number of pixels in the region. This feature reflects the degree to which the defect alters the light reflection / transmission characteristics; a higher gray value (or lower, depending on the defect type) indicates a higher defect rate. This indicates that the greater the defect intensity, such as the average gray value of a large-area depression (120) is much higher than that of a small stain (72.1). The gray standard deviation is calculated as follows: first, calculate the sum of squares of the deviations between the gray value of each pixel in the area and the average gray value, then divide by the number of pixels in the area to obtain the variance, and finally take the square root of the variance to obtain the standard deviation. This feature reflects the uniformity of the gray value distribution in the defect area. For example, the gray distribution in the stain area is uniform (standard deviation 10-15), while the standard deviation in the depression area is larger (20-30) because there is an obvious gray gradient at the edge (high gray value in the center and low gray value at the edge). Taking a strong defect area (area 5000 pixels, total grayscale value 600000) as an example, its area ratio = 5000 / 3145728≈0.00159, average grayscale value = 600000 / 5000 = 120, grayscale standard deviation = 25 (assuming the sum of squared deviations is 3125000). These three features quantify the attributes of the strong defect in terms of size, intensity, and grayscale non-uniformity from different dimensions, providing data support for subsequent index calculations.

[0121] Based on three characteristics—area proportion, average gray value, and gray standard deviation—a weighted summation method is used to calculate the preliminary stacking defect index. The core function of this index is to integrate three independent characteristic parameters into a single quantitative indicator, enabling an intuitive assessment of defect severity. The weighting of each characteristic must be determined in conjunction with its impact on stacking quality. Area proportion directly relates to the extent of damage to the structural integrity of the stack, having the greatest impact; its weight is set at 0.4. Average gray value reflects the essential intensity of the defect and is key to distinguishing defect type and severity; its weight is set at 0.3. Gray standard deviation reflects the morphological stability of the defect (e.g., depressions with large gray standard deviations tend to expand further); its weight is also set at 0.3. To eliminate dimensional differences among the characteristics (area proportion is a decimal, average gray value is an integer from 0 to 255, and gray standard deviation is an integer from 0 to 50), each characteristic must first be normalized. Through reasonable weighting and normalization, the comparability of defect indices of different types and sizes is ensured, avoiding assessment bias caused by a single characteristic and directly improving the scientific rigor of the preliminary assessment.

[0122] The severity of candidate defect areas is graded based on the magnitude of the preliminary stacking defect index, and the preliminary stacking defect index is obtained. The severity grading is to convert the preliminary defect index into a quality judgment standard that can be implemented in actual production. The grading threshold is determined based on a large amount of experimental data and needs to cover the common defect types and severity in actual production: When the preliminary defect index is greater than 0.5, it is judged as a serious defect, corresponding to defects such as large-area dents (area ratio > 0.002) and whole-layer interlayer voids (average gray value > 180), which will directly affect the stacking load-bearing capacity; when the preliminary defect index is between 0.2 and 0.5, it is judged as a moderate defect, corresponding to medium-area stains (area ratio 0.0005-0.002) and local obvious indentations (average gray value 80-120), which require manual verification; when the preliminary defect index is less than 0.2, it is judged as a minor defect, corresponding to small-area stains (area ratio < 0.0005) and slight indentations (average gray value 50-80), which do not affect the basic stacking performance. Taking the aforementioned strong defect area (preliminary index 0.3549) as an example, it is judged as a moderate defect, requiring subsequent manual verification to determine whether rework is necessary; taking the aforementioned weak defect area (preliminary index 0.1747) as an example, it is judged as a minor defect and can be released directly. This grading process combines the quantitative index with actual production needs, providing a grading basis for subsequently eliminating lighting artifacts to obtain the true defect index. Severe defects require in-depth verification to determine whether they are true defects, while the verification process for minor defects can be simplified, directly improving detection efficiency, while ensuring that critical defects are not missed and that non-critical defects do not consume excessive detection resources.

[0123] In one embodiment, the steps of extracting continuous edge ridges of candidate defect regions, quantifying periodic intensity using grayscale sequence sorting features, and combining structural similarity indices to exclude illumination artifacts to obtain the true defect index include:

[0124] S61, perform edge detection on the candidate defect region and extract continuous edge ridges whose length exceeds a set threshold;

[0125] S62, extract a strip-shaped region along the normal direction of the edge ridge line, and statistically analyze the frequency distribution of the gray-scale sequence sorting pattern;

[0126] S63, calculate the sorting entropy value and analyze the edge spacing variation coefficient to quantify the intensity of periodic defect characteristics;

[0127] S64, calculate the structural similarity index between the highlighted area and the adjacent area to distinguish between real defects and lighting artifacts;

[0128] S65, combining the results of periodicity characteristic intensity and structural similarity analysis, calculates the final true defect index.

[0129] As described in steps S61-S65 above, the above technical process enables accurate differentiation between real defects (especially washboard defects) and lighting artifacts in the candidate defect area. Its core objective is to solve the problem of misidentification of washboard defects with uneven lighting and bright areas, and the problem of missed detection caused by curved edges or shadow interference in the existing technology. The preliminary stacking defect index obtained by weight 5 is corrected into a quantitative index that can reflect the real defect state, ensuring the accuracy and reliability of the final defect judgment.

[0130] Among the candidate defect areas, two easily confused types of targets still exist: one is genuine corrugated board defects, which are essentially periodic indentations formed during the production process of corrugated cardboard stacking due to uneven interlayer pressure. Physically, they present as continuous indentation bands with fixed intervals, and in the defect response map, they appear as areas with continuous edge ridges and periodic fluctuations in grayscale values. The other is illumination artifacts, which are essentially bright areas formed by uneven local illumination intensity in the production environment (such as local brightness attenuation of a ring LED array light source or local incidence of external natural light). Physically, they do not have genuine indentations or stains, and although they appear as areas with high grayscale values ​​in the defect response map, they lack a fixed periodicity and are consistent with the structural characteristics of adjacent normal areas. The grayscale characteristics of the two types of targets are similar, and they cannot be distinguished by preliminary defect indices alone. Furthermore, the edges of corrugated board defects may exhibit a curved shape due to interlayer stacking deviations, making it difficult for traditional straight-line similarity analysis to capture their periodicity, leading to missed detections. Therefore, it is necessary to extract edge ridges to screen effective features, statistically quantify the periodicity of gray-scale sequences, and analyze structural similarity to eliminate artifacts in order to accurately identify real defects and correct defect indices, thereby avoiding misjudgment and missed detection.

[0131] Edge detection is performed on candidate defect regions to extract continuous edge ridges with lengths exceeding a set threshold. This step requires edge detection to be performed based on the grayscale gradient features of the image. The Canny edge detection algorithm is used, which accurately extracts edge pixels from candidate defect regions through four steps: Gaussian smoothing (standard deviation set to 1.2, filter window 3×3), gradient calculation (Sobel operator), non-maximum suppression, and double-threshold edge connection (high threshold 150, low threshold 50). Subsequently, an eight-neighbor connected region labeling algorithm is used to group adjacent edge pixels into edge ridges, and the pixel length of each edge ridge (i.e., the number of edge pixels contained in the ridge) is calculated. The edge ridge length threshold is set to 30 pixels. This threshold is determined based on the minimum periodicity of corrugated cardboard board defects. The period of a corrugated cardboard board defect is typically 5-10 mm, corresponding to 14-29 pixels in images acquired by industrial CCD cameras. The 30-pixel length threshold ensures that only continuous edge ridges reflecting periodic characteristics are retained, filtering out short edges (typically less than 10 pixels) formed by image noise (such as minor noise remaining after weighted 3 texture removal). For example, a candidate defect region is a genuine washboard defect. After Canny edge detection, three continuous edge ridges with lengths of 45 pixels, 52 pixels, and 48 pixels respectively are obtained, all exceeding the 30-pixel threshold, and are retained as valid edge ridges. Another candidate defect region is an illumination artifact. Edge detection only yields two short edge ridges with lengths of 12 pixels and 18 pixels respectively, which are discarded because they do not meet the threshold. Through this step, edge ridges with potential characteristics of genuine defects can be preliminarily screened, laying the foundation for subsequent periodic analysis.

[0132] A strip-shaped region was extracted along the normal direction of the edge ridge, and the frequency distribution of the gray-level sequence sorting pattern was statistically analyzed. The normal direction of the edge ridge is perpendicular to the direction of the ridge, and this direction can most intuitively reflect the gray-level changes in the defect area. For real corrugated board defects, there will be a periodic change along the normal direction, with "lower gray-level in the concave area and higher gray-level in the non-concave area". For lighting artifacts, there is no fixed gray-level change pattern along the normal direction. The width of the strip-shaped region was set to 5 pixels. This width can cover the complete cycle of gray-level changes (the gray-level change cycle along the normal direction of corrugated board defects is about 3-4 pixels) while avoiding the introduction of too many interfering pixels from adjacent areas. The specific extraction method is as follows: taking each pixel on the edge ridge as the center, a rectangular area with a width of 5 pixels is extracted along the normal direction (including both sides of the ridge). The gray values ​​in this area are arranged into a gray value sequence from left to right. Then, the gray value sequence is sorted and classified. The 5 gray values ​​in the sequence are divided into 5 levels according to their size (level 1 is the smallest gray value and level 5 is the largest gray value). The frequency of occurrence of 243 sorting patterns such as "1-2-3-4-5", "1-1-2-3-4", and "2-1-2-1-2" is counted to generate a frequency distribution table. For example, in the gray-scale sequence of the normal direction of a real corrugated board defect, the sorting pattern "2-1-2-1-2" (corresponding to "non-concave-concave-non-concave-concave-non-concave") appears 18 times, accounting for 35% of the total frequency; while in the gray-scale sequence of the normal direction of illumination artifacts, the sorting patterns are scattered, with irregular patterns such as "3-3-4-4-5" and "2-3-3-4-4" appearing less than 5 times each, indicating no dominant pattern. This statistical process can transform the periodicity of gray-scale changes into quantifiable sorting pattern frequency characteristics, providing raw data for subsequent periodicity intensity calculations. Furthermore, it is unaffected by the curvature of the edge ridge; even if the ridge is curved, the periodic changes in gray-scale in the normal direction can still be reflected through the sorting pattern, effectively solving the periodicity identification bias caused by curved edges.

[0133] The sorting entropy value is calculated and the coefficient of variation of edge spacing is analyzed to quantify the intensity of periodic defect characteristics. The sorting entropy value and the coefficient of variation of edge spacing are core indicators for quantifying periodic characteristics from two dimensions: the regularity of the gray-level sequence and the regularity of the edge spatial distribution. A smaller sorting entropy value indicates a more concentrated sorting pattern in the gray-level sequence and a stronger periodicity; a smaller coefficient of variation of edge spacing indicates a more uniform spatial spacing of the edge ridges and a stronger periodicity. The formula for calculating the sorting entropy value is:

[0134] ;

[0135] in, This represents the sorting entropy value, where n is the total number of sorting patterns (240). This represents the frequency percentage of the i-th sorting pattern (frequency of the i-th pattern / total frequency).

[0136] The formula for calculating the coefficient of variation of edge spacing is:

[0137] ;

[0138] in, The coefficient of variation for edge spacing is represented by r, and the standard deviation for the edge ridge spacing is represented by r. This represents the average spacing between edge ridges, which is the average pixel distance between two adjacent valid edge ridges (with a length exceeding 30 pixels). Taking a real washboard defect as an example, the total frequency is 51 times. The dominant sorting pattern "2-1-2-1-2" accounts for 0.35% of the frequency, while other patterns all account for less than 0.1%. The calculated sorting entropy value is approximately 0.32. The spacing between the three valid edge ridges is 15 pixels, 16 pixels, and 14 pixels, respectively. The average spacing between the edge ridges is... =15 pixels, standard deviation r=0.816 pixels, edge spacing coefficient of variation CV=0.816 / 15≈0.054. Taking illumination artifacts as an example, the total frequency is 48 times, the proportion of each sorting mode is less than 0.08, and the sorting entropy value H≈0.85; there are no effective edge ridges (none reach the 30 pixel threshold), and the edge spacing coefficient of variation is 1.0 (no periodicity). For ease of subsequent calculation, the two indicators need to be normalized to the range of 0-1. The periodicity characteristic intensity of the real washboard defect is:

[0139] Q=(1-0.32)×0.6+(1-0.054)×0.4=0.68×0.6+0.946×0.4=0.408+0.378=0.786;

[0140] The periodicity of the illumination artifact is:

[0141] Q = (1−0.85)×0.6+(1−1.0)×0.4=0.15×0.6+0=0.09. The difference between the two is significant, which can achieve accurate quantification of periodic characteristics.

[0142] The Structural Similarity Index (SSIM) is calculated between highlighted areas and adjacent areas to distinguish between real defects and lighting artifacts. The SSIM measures the similarity between two image regions in three dimensions: brightness, contrast, and structure. Its core logic is as follows: real defects (such as washboard defects) have physical indentations, resulting in significantly different structural features from adjacent normal areas, leading to lower SSIM values; lighting artifacts, on the other hand, have higher grayscale values ​​only due to differences in illumination intensity, and their structural features are consistent with adjacent normal areas, resulting in higher SSIM values. The formula for calculating SSIM is:

[0143] ;

[0144] in, The structure similarity index is represented by x, which represents the bright sub-region (grayscale value higher than the set high threshold) in the candidate defect region, and y represents the normal region within a 10-pixel range around x. , Let x and y represent the mean gray values, respectively. , Let x and y represent the standard deviations of their gray levels, respectively. Represents the covariance of x and y. , Stability coefficient ( , , (This refers to the grayscale range). During the calculation, the selection of x must cover all pixels above the high threshold within the candidate defect region, and the selection of y must ensure that it is a defect-free normal region (grayscale value below the aforementioned low threshold). For example, the average grayscale value of x in the bright sub-region of a real washboard defect. =110, standard deviation =22, mean gray level of adjacent normal regions. =80, standard deviation =15, covariance =35

[0145] Substituting into the formula, we get SSIM(x,y)≈0.18;

[0146] Highlight sub-region of illumination artifact x mean gray level =105, standard deviation =18, the average gray level of adjacent normal regions. =85, standard deviation =16, covariance =120, and the calculated SSIM(x,y)≈0.85.

[0147] Therefore, the SSIM threshold is set to 0.5. An SSIM value less than 0.5 is considered a real defect, and an SSIM value greater than 0.5 is considered a lighting artifact. This indicator supplements the deficiencies of grayscale and periodic features at the structural level, ensuring that even two types of targets with similar grayscale values ​​can be effectively distinguished.

[0148] Based on the combined results of periodicity intensity and structural similarity analysis, the final true defect index is calculated. The true defect index needs to be adjusted by combining the periodicity intensity (reflecting whether it is a washboard-like periodic defect) and the structural similarity index (reflecting whether it is a real defect rather than an artifact). The adjustment logic is as follows: if the structural similarity index is determined to be an illumination artifact (SSIM≥0.5), the initial defect index is significantly reduced; if it is determined to be a real defect (SSIM<0.5), the initial defect index is adjusted in combination with the periodicity intensity. The stronger the periodicity (such as a washboard defect), the higher the adjusted index.

[0149] The final grading is based on the True Defect Index (DDI): a DDI greater than 0.3 is classified as a severe defect requiring rework; a DDI between 0.1 and 0.3 is classified as a moderate defect requiring manual review; and a DDI less than 0.1 is classified as a minor defect or artifact that can be released. This grading directly guides quality control actions on the production side. This step accurately identifies bend-edge corrugated board defects that are easily missed by traditional methods, and effectively eliminates the interference of lighting artifacts on defect judgment. This improves the final defect identification accuracy by more than 50% compared to existing technologies, solving the problems of corrugated board detection deviation and misjudgment due to lighting artifacts.

[0150] like Figure 2 As shown, the present invention also discloses a machine vision-based corrugated cardboard stacking defect detection system, comprising:

[0151] The first acquisition module is used to symmetrically install a ring-shaped LED array light source on both sides of the stacking conveyor line, install a vertical diffuse light source on the top, and trigger the illumination of the three light sources at preset time intervals, and acquire the reflected light channel image, the transmitted light channel image and the visible light image.

[0152] The second acquisition module is used to acquire fused image features based on the reflected light channel image, the transmitted light channel image and the visible light image, and to acquire a defect response map based on the fused image features;

[0153] An elimination module is used to eliminate corrugated texture interference using an adaptive Gaussian filter;

[0154] The setting module is used to set high and low thresholds based on the proportion of the maximum value of the defect response spectrum;

[0155] The segmentation module is used to segment and extract candidate defect regions and obtain preliminary stacking defect indices;

[0156] The third acquisition module is used to extract continuous edge ridges of candidate defect regions, quantify the periodic intensity through gray-scale sequence sorting features, and combine structural similarity index to exclude lighting artifacts in order to obtain the true defect index.

[0157] In one embodiment, the second acquisition module includes:

[0158] The first acquisition unit is used to extract spectral features from the reflected light channel image, the transmitted light channel image, and the visible light image respectively, and obtain the grayscale information of each channel.

[0159] The second acquisition unit is used to perform pixel-level weighted fusion of the grayscale information of the three channels using fixed weight coefficients to obtain the fused image features;

[0160] The processing unit is used to perform dynamic range compression processing on the features of the fused image, determine the truncation threshold of the bright area by statistically analyzing the pixel value distribution, and limit the pixel values ​​that exceed the threshold.

[0161] The suppression unit is used to process the image using an adaptive noise suppression algorithm, and determines whether to enable median filtering based on the local gray-level standard deviation.

[0162] The generation unit is used to normalize the global grayscale value of the processed fused image and linearly map it to the standard grayscale range to generate a defect response map.

[0163] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described machine vision-based corrugated cardboard stacking defect detection method.

[0164] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described machine vision-based method for detecting defects in corrugated cardboard stacking.

[0165] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in this application and in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0166] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0167] The above description is merely a preferred embodiment of the present invention and does not limit the scope of this application. Any equivalent results or equivalent process transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of protection of this application.

Claims

1. A machine vision-based method for detecting stacking defects in corrugated cardboard, characterized in that, Includes the following steps: A ring-shaped LED array light source is symmetrically installed on both sides of the stacking conveyor line, and a vertical diffuse light source is installed on the top. The three light sources trigger illumination at preset time intervals and acquire reflected light channel images, transmitted light channel images, and visible light images. The fused image features are obtained based on the reflected light channel image, the transmitted light channel image, and the visible light image, and the defect response spectrum is obtained based on the fused image features. Multi-angle Gabor filtering is used to eliminate corrugated texture interference. The specific steps include: Perform multi-angle Gabor filtering on visible light images; Calculate the sum of squares of the real and imaginary parts of the energy of each filtering result; Automatic thresholding of energy maps preserves high-frequency texture regions; In the defect response map, the texture mask coverage area is masked, and the holes are filled using circular structuring element closing operations; High and low thresholds are set based on the proportion of the maximum value in the defect response spectrum; The process of segmenting and extracting candidate defect regions and obtaining preliminary stacking defect indices includes the following steps: A dual-threshold segmentation algorithm is used to process the defect response map, extracting strong defect regions above the high threshold and weak defect regions between the high and low thresholds; Edge connection processing is performed on weak defect areas to merge spatially adjacent and similar regions; Calculate the area proportion, average gray value, and gray standard deviation of each candidate defect region; Based on three characteristics—area proportion, average gray value, and gray standard deviation—a preliminary stacking defect index is calculated. The severity of candidate defect areas is classified according to the magnitude of the preliminary stacking defect index. Continuous edge ridges of candidate defect regions are extracted, their periodic intensity is quantified using grayscale sequence sorting features, and illumination artifacts are eliminated by combining structural similarity index to obtain the true defect index. Specific steps include: Edge detection is performed on candidate defect regions to extract continuous edge ridges whose length exceeds a set threshold; A strip-shaped region was extracted along the normal direction of the edge ridge, and the frequency distribution of the gray-scale sequence sorting pattern was statistically analyzed. Calculate the sorting entropy value and analyze the coefficient of variation of edge spacing to quantify the intensity of periodic defect characteristics; Calculate the structural similarity index between the highlighted area and the adjacent area to distinguish between real defects and lighting artifacts; The final true defect index is calculated by combining the results of the analysis of the intensity of periodic characteristics and structural similarity.

2. The method for detecting stacking defects of corrugated cardboard based on machine vision according to claim 1, characterized in that, The steps of obtaining fused image features based on the reflected light channel image, the transmitted light channel image, and the visible light intensity image, and obtaining a defect response map based on the fused image features, include: Spectral features were extracted from the reflected light channel image, the transmitted light channel image, and the visible light image to obtain the grayscale information of each channel. The grayscale information of the three channels is fused at the pixel level using a fixed weighting coefficient to obtain the features of the fused image; Dynamic range compression is performed on the features of the fused image. The truncation threshold of the bright area is determined by statistically analyzing the pixel value distribution, and the pixel values ​​exceeding the threshold are limited. An adaptive noise suppression algorithm is used to process the image, and the decision to enable median filtering is based on the local gray-level standard deviation. The processed fused image is normalized to the global grayscale value and linearly mapped to the standard grayscale range to generate a defect response map.

3. The method for detecting stacking defects of corrugated cardboard based on machine vision according to claim 1, characterized in that, The step of setting high and low thresholds based on the maximum value ratio of the defect response spectrum includes: Real-time monitoring of ambient light intensity in the production environment to obtain the current ambient illuminance value; The dynamic adjustment coefficient is calculated based on the ambient illuminance value; the higher the illuminance, the larger the adjustment coefficient. Based on the maximum gray value of the defect response map, multiply it by the high threshold scaling factor and the low threshold scaling factor respectively; The high threshold ratio coefficient and the low threshold ratio coefficient are multiplied by the dynamic adjustment coefficient respectively to obtain the final high threshold and low threshold.

4. A machine vision-based corrugated cardboard stacking defect detection system, characterized in that, include: The first acquisition module is used to symmetrically install a ring-shaped LED array light source on both sides of the stacking conveyor line, install a vertical diffuse light source on the top, and trigger the illumination of the three light sources at preset time intervals, and acquire the reflected light channel image, the transmitted light channel image and the visible light image. The second acquisition module is used to acquire fused image features based on the reflected light channel image, the transmitted light channel image and the visible light image, and to acquire a defect response map based on the fused image features; The elimination module is used to eliminate corrugated texture interference using multi-angle Gabor filtering. Specific steps include: Perform multi-angle Gabor filtering on visible light images; Calculate the sum of squares of the real and imaginary parts of the energy of each filtering result; Automatic thresholding of energy maps preserves high-frequency texture regions; In the defect response map, the texture mask coverage area is masked, and the holes are filled using circular structuring element closing operations; The setting module is used to set high and low thresholds based on the proportion of the maximum value of the defect response spectrum; The segmentation module is used to segment and extract candidate defect regions and obtain preliminary stacking defect indices. Specific steps include: A dual-threshold segmentation algorithm is used to process the defect response map, extracting strong defect regions above the high threshold and weak defect regions between the high and low thresholds; Edge connection processing is performed on weak defect areas to merge spatially adjacent and similar regions; Calculate the area proportion, average gray value, and gray standard deviation of each candidate defect region; Based on three characteristics—area proportion, average gray value, and gray standard deviation—a preliminary stacking defect index is calculated. The severity of candidate defect areas is classified according to the magnitude of the preliminary stacking defect index. The third acquisition module is used to extract continuous edge ridges of candidate defect regions, quantify the periodic intensity through grayscale sequence sorting features, and combine structural similarity index to eliminate lighting artifacts in order to obtain the true defect index. Specific steps include: Edge detection is performed on candidate defect regions to extract continuous edge ridges whose length exceeds a set threshold; A strip-shaped region was extracted along the normal direction of the edge ridge, and the frequency distribution of the gray-scale sequence sorting pattern was statistically analyzed. Calculate the sorting entropy value and analyze the coefficient of variation of edge spacing to quantify the intensity of periodic defect characteristics; Calculate the structural similarity index between the highlighted area and the adjacent area to distinguish between real defects and lighting artifacts; The final true defect index is calculated by combining the results of the analysis of the intensity of periodic characteristics and structural similarity.

5. The machine vision-based corrugated cardboard stacking defect detection system according to claim 4, characterized in that, The second acquisition module includes: The first acquisition unit is used to extract spectral features from the reflected light channel image, the transmitted light channel image, and the visible light image respectively, and obtain the grayscale information of each channel. The second acquisition unit is used to perform pixel-level weighted fusion of the grayscale information of the three channels using fixed weight coefficients to obtain the fused image features; The processing unit is used to perform dynamic range compression processing on the features of the fused image, determine the truncation threshold of the bright area by statistically analyzing the pixel value distribution, and limit the pixel values ​​that exceed the threshold. The suppression unit is used to process the image using an adaptive noise suppression algorithm, and determines whether to enable median filtering based on the local gray-level standard deviation. The generation unit is used to normalize the global grayscale value of the processed fused image and linearly map it to the standard grayscale range to generate a defect response map.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Periodic structure quality detection method

    CN112465743A

  • Corrugated paper production quality visual auxiliary detection method

    CN116977358A