Corrugated board defect detection method, medium and equipment
Through multi-light source position image fusion and image segmentation technology, combined with sub-pixel edge extraction and least squares circle fitting, the problems of small contrast and small defect areas in corrugated cardboard defect detection are solved, and the accurate positioning of corrugated cardboard defects is achieved and Identification improves the reliability of detection.
Patent Information
- Application Number
- CN202411765423.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-12-04
AI Technical Summary
Indentation or depression defects caused by equipment failure or operating errors during the manufacturing process of corrugated cardboard are difficult to detect effectively, especially when the contrast and defect area are small during image detection, which makes it difficult to detect.
Images are captured and image fusion is performed by multi-light source positions, defect areas are extracted through image segmentation and closed operations, combined with subpixel edge extraction and least squares circle fitting, distinguishing point-shaped and linear defects.
It improves the accuracy and reliability of defect detection, and can effectively locate and identify defects of corrugated cardboard under low contrast and small defect areas, enhancing the reliability and accuracy of detection.
Smart Images

Figure CN119273677A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of corrugated paper defects, and in particular to a method, medium and equipment for detecting defects of corrugated paperboard. Background Art
[0002] Corrugated paper is made of noodle paper and corrugated paper formed by corrugating rollers. It has the advantages of low cost, light weight, and strong pressure resistance. It is widely used in various fields such as transportation packaging. In the manufacturing process of corrugated paperboard, it is inevitable that the corrugated paperboard will be indented or dented due to various reasons such as equipment failure and operational errors, which seriously affects the normal use of corrugated paper.
[0003] When the above defects appear on corrugated cardboard, the contrast is low and the defective area is small during image detection, which makes detection difficult. Summary of the invention
[0004] The purpose of the present invention is to provide a method, medium and equipment for detecting defects of corrugated cardboard to solve the above technical problems.
[0005] To achieve the above object, the present invention provides the following technical solutions: A method for detecting defects in corrugated paperboard comprises the following steps: S100, collecting front and back images of the corrugated cardboard, the collected images are at least three images taken under at least three light source positions, and fusing the at least three images to obtain a sample image I 正 ,I 反 .
[0006] S200, sample image I 正 , I 反 Preprocessing is performed, and the preprocessed image is segmented. The defect area is initially extracted through image segmentation, and the defect area is closed and then secondary feature extraction is performed. The final defect area is obtained according to the grayscale feature histogram; S300, after the defect area is extracted, grayscale processing is performed on it, converting it from an RGB image to a grayscale image, then performing sub-pixel edge extraction on the grayscale image, fitting the extracted defect edge contour and locating the defect.
[0007] The present invention further arranges that, in step S100, the at least three light sources are a vertical light source vertical to the corrugated cardboard and at least two light sources distributed on both sides of the vertical light source.
[0008] The present invention further arranges that the image segmentation method adopts a region growing method for segmentation, comprising the following steps: S201, dividing the image into several regions, and obtaining grayscale histograms of all regions; S202, detecting the similarity of the grayscale histograms between adjacent regions; if the detection result is less than a set threshold, merging the two regions; wherein the detection formula is as follows: ; (1) At the same time, smooth difference detection is performed on it, and the detection formula is as follows: ; (2) In formula (1) and formula (2): h1(z), h2(z) are the cumulative grayscale histograms of two adjacent regions; T is the given threshold; S203, repeat the above steps until the adjacent regions do not meet the thresholds defined by equations (1) and (2), and the region growing ends.
[0009] The present invention further arranges that when setting the threshold T, the following method is adopted: setting the threshold T to divide all pixels of the image into two categories, C1 and C2, the grayscale means of C1 and C2 are m1 and m2 respectively, the global average grayscale value of the image is m, and the probability of pixels being divided into C1 and C2 is p1 and p2 respectively, then ;(3) ;(4) when When the value is the largest, the optimal threshold T is obtained as the T value in equation (1) and equation (2).
[0010] The present invention further arranges that, during the grayscale processing, the image is converted using a weighted method, and the conversion formula is as follows: Gray=0.299R+0.587G+0.114B; In the formula: Gray—single color channel after conversion; R—one color channel; G—one color channel; B—another color channel.
[0011] The present invention further arranges that, when performing edge extraction, the following method is adopted: S1. Calculate the partial derivative matrices P and Q of the image in the X and Y directions, where the first-order difference convolution template is as follows: , ; Calculate the gradient amplitude in the X and Y directions based on the first-order difference convolution template; S2, calculating the gradient amplitude and azimuth according to the gradient amplitude in the X and Y directions; S3, thinning the wide edge band, that is, only retaining the area with the largest edge peak value, and setting the remaining non-maximum points to zero.
[0012] S4, dual threshold algorithm detects edges and connecting edges.
[0013] The present invention is further arranged that, during fitting, least square circle fitting is adopted, and the defect type is determined according to the fitting result.
[0014] The present invention further arranges that when judging the defect type, the coordinates of the center of the least square circle after fitting are set to (M, K) and the radius is r. If the fitting radius r is too large, it is directly judged as a linear defect; otherwise, the difference di between each edge point on the contour and the fitting radius is calculated: ;(5) The average value of each edge point di on the contour is taken as the roundness error. If the straightness error of the corresponding edge point is smaller, it is judged as a linear defect; if the roundness error is smaller, it is judged as a point defect.
[0015] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the corrugated cardboard defect detection method.
[0016] The present invention also provides a readable storage medium on which a program is stored. When the program is executed by a processor, the method for detecting defects in corrugated paperboard is implemented.
[0017] Beneficial effects of the present invention: The present invention performs image fusion on the images of multiple light sources for corrugated cardboard, and acquires different images of the target object under multiple light sources, so that the defect image can be obtained more completely. Secondly, the present invention performs image segmentation on the pre-processed image, preliminarily extracts the defect area through image segmentation, performs a closed operation on the defect area, and performs secondary feature extraction, and obtains the final defect area according to the grayscale feature histogram, which can ensure the display of the defect; finally, the reliability of defect positioning is greatly improved through sub-pixel edge extraction, and then point defects such as depressions and linear defects such as indentations are distinguished according to the defect fitting circle. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 is a flow chart of an embodiment of the present invention.
[0019] Figure 2 Schematic diagram of the position of the light source according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following will describe the implementation methods of the present application in detail with the help of accompanying drawings and examples, so that the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.
[0021] like Figure 1 As shown, the present invention provides a method for detecting defects in corrugated paperboard, comprising the following steps: S100, collecting front and back images of the corrugated cardboard, the collected images are at least three images taken under at least three light source positions, and fusing the at least three images to obtain a sample image I 正 ,I 反 .
[0022] S200, sample image I 正 , I 反 Preprocessing is performed, and the preprocessed image is segmented. The defect area is initially extracted through image segmentation, and the defect area is closed and then secondary feature extraction is performed. The final defect area is obtained according to the grayscale feature histogram; S300, after the defect area is extracted, grayscale processing is performed on it, converting it from an RGB image to a grayscale image, then performing sub-pixel edge extraction on the grayscale image, fitting the extracted defect edge contour and locating the defect.
[0023] The preprocessing includes image enhancement and noise reduction: specifically, linear grayscale transformation is used to increase the contrast of the original image, make the defect area more obvious, and facilitate the region growing segmentation method. In grayscale transformation, linear scaling of grayscale values is one of the most important steps. In this embodiment, the following operator is used: f(g)=ag+b; In the formula: f(g) is the function for grayscale transformation; a is the slope of linear grayscale transformation; g is the grayscale value; b is the grayscale range to be transformed.
[0024] If g∈gb, the output grayscale value needs to be rounded to ensure that the output grayscale value is within the range of gb. The operator used here is: f(g) =min (max(ag+b+0.5), 0), 2 b -1); In the formula: f (g) - grayscale transformation function; a - slope of linear grayscale transformation; g - grayscale value; b - grayscale range to be transformed; min - minimum grayscale value; max - maximum grayscale value. From the above formula, we can know that: when |a|>1, the contrast increases; when |a|<1, the contrast decreases; when a<1, the grayscale value is reversed; when b>0, the brightness value increases; when b<0, the brightness value decreases.
[0025] This embodiment further arranges that, in step S100, the at least three light sources are a vertical light source perpendicular to the corrugated cardboard and at least two light sources distributed on both sides of the vertical light source.
[0026] In this embodiment, three light sources are used, one of which is located at position O2 and is vertical to the corrugated cardboard, and the other two light sources are located on both sides of the vertical light source and are arranged at 45° to the vertical light source, namely, O1 and O3. Figure 2 .
[0027] This embodiment is directed to a segmentation method: the following method is adopted: The image segmentation method uses the region growing method for segmentation, which includes the following steps: S201, dividing the image into several regions, and obtaining grayscale histograms of all regions; S202, detecting the similarity of the grayscale histograms between adjacent regions; if the detection result is less than a set threshold, merging the two regions; wherein the detection formula is as follows: ; (1) At the same time, smooth difference detection is performed on it, and the detection formula is as follows: ; (2) In formula (1) and formula (2): h1(z), h2(z) are the cumulative grayscale histograms of two adjacent regions; T is the given threshold; R is the image area; max is the maximum value of the image area; S203, repeat the above steps until the adjacent regions do not meet the thresholds defined by equations (1) and (2), and the region growing ends.
[0028] Specifically, when the threshold is determined by artificial experience, part of the image edge information is easily lost in the edge extraction process, and pseudo edges appear. Therefore, when setting the threshold T in this embodiment, the following method is adopted: the threshold T is set to divide all pixels of the image into two categories, C1 and C2. The grayscale means of C1 and C2 are m1 and m2 respectively, and the global average grayscale value of the image is m. The probability that the pixel is divided into C1 and C2 is p1 and p2 respectively, then ;(3) ;(4) when When the value is the largest, the optimal threshold T is obtained as the T value in equation (1) and equation (2).
[0029] In order to accurately extract the target position of the corrugated cardboard defect, ROI operation is performed on it so that the defect area can be processed separately. The extracted area is converted into a grayscale image by RGB image conversion. In order to effectively reduce the amount of image processing calculations and combine the physiological characteristics of the human eye, the image is converted using a weighted method during grayscale processing. The conversion formula is as follows: Gray=0.299R+0.587G+0.114B; In the formula: Gray—single color channel after conversion; R—one color channel; G—one color channel; B—another color channel.
[0030] When performing edge extraction, the following method is used: S1. Calculate the partial derivative matrices P and Q of the image in the X and Y directions, where the first-order difference convolution template is as follows: , ; Calculate the gradient amplitude in the X and Y directions based on the first-order difference convolution template; the formula is as follows: ; ; Where: S-image gray value; - Gradient amplitude in the y direction; - Gradient magnitude in the x direction; S2, calculating the gradient amplitude and azimuth according to the gradient amplitude in the X and Y directions; The calculation method is as follows: ; Where: M[i,j]—the amplitude of the point; - Gradient amplitude in the y direction; - Gradient magnitude in the x direction.
[0031] S3, thinning the wide edge band, that is, only retaining the area with the largest edge peak value, and setting the remaining non-maximum points to zero.
[0032] S4, dual threshold algorithm detects edges and connecting edges.
[0033] In the present invention, since the defect types are depressions and indentations, the least squares circle fitting is adopted during fitting, and the defect type is determined based on the fitting results.
[0034] The specific judgment method is: when judging the defect type, the coordinates of the center of the least square circle after fitting are set to (M, K) and the radius is r. If the fitting radius r is too large, it is directly judged as a linear defect; otherwise, the difference di between each edge point on the contour and the fitting radius is calculated: ;(5) Where (xi,yi) is the pixel coordinate value of the edge contour.
[0035] The average value of each edge point di on the contour is taken as the roundness error. If the straightness error of the corresponding edge point is smaller, it is judged as a linear defect; if the roundness error is smaller, it is judged as a point defect. Embodiment 2:
[0036] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the corrugated cardboard defect detection method. Embodiment 3:
[0037] The present invention also provides a readable storage medium on which a program is stored. When the program is executed by a processor, the method for detecting defects in corrugated paperboard is implemented.
[0038] The present invention takes pictures of corrugated cardboard at multiple light source positions and fuses the images of the multiple light sources. By collecting different images of the target object under multiple light sources, the defect image can be obtained more completely. In view of the problem that the corrugated cardboard image has low contrast and small defect area, the above sub-pixel edge extraction method is proposed to achieve a good defect positioning effect, achieve the expected detection purpose, and better improve the applicability of the region growing method in complex environments.
[0039] For example, certain words are used in the specification and claims to refer to specific components. Those skilled in the art should understand that hardware manufacturers may use different terms to refer to the same component. This specification and claims do not use differences in names as a way to distinguish components, but use differences in the functions of components as the criteria for distinction. For example, "including" mentioned throughout the specification and claims is an open term, so it should be interpreted as "including but not limited to". "Approximately" means that within an acceptable error range, those skilled in the art can solve technical problems within a certain error range and basically achieve technical effects.
[0040] It should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such product or system. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the product or system including the elements.
[0041] The above description shows and describes several preferred embodiments of the present invention, but as before, it should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the invention concept of this article through the above teachings or the technology or knowledge of the relevant field. And the changes and modifications made by those skilled in the art do not depart from the spirit and scope of the present invention, and should be within the scope of protection of the claims attached to the present invention.
Claims
1. A method for detecting defects in corrugated cardboard, characterized in that: The steps include: S100, collecting front and back images of the corrugated cardboard, the collected images are at least three images taken under at least three light source positions, and fusing the at least three images to obtain a sample image I 正 ,I 反 ; S200, sample image I 正 , I 反 Preprocessing is performed, and the preprocessed image is segmented. The defect area is initially extracted through image segmentation, and the defect area is closed and then secondary feature extraction is performed. The final defect area is obtained according to the grayscale feature histogram; S300, after the defect area is extracted, grayscale processing is performed on it, converting it from an RGB image to a grayscale image, then performing sub-pixel edge extraction on the grayscale image, fitting the extracted defect edge contour and locating the defect.
2. A method for detecting defects in corrugated paperboard according to claim 1, characterized in that: In step S100, the at least three light sources are a vertical light source perpendicular to the corrugated cardboard and at least two light sources distributed on both sides of the vertical light source.
3. A method for detecting defects in corrugated paperboard according to claim 1, characterized in that: The image segmentation method uses the region growing method for segmentation, which includes the following steps: S201, dividing the image into several regions, and obtaining grayscale histograms of all regions; S202, detecting the similarity of the grayscale histograms between adjacent regions; if the detection result is less than a set threshold, merging the two regions; wherein the detection formula is as follows: ;(1) At the same time, smooth difference detection is performed on it, and the detection formula is as follows: ;(2) In formula (1) and formula (2): h1(z), h2(z) are the cumulative grayscale histograms of two adjacent regions; T is the given threshold; S203, repeat the above steps until the adjacent regions do not meet the thresholds defined by equations (1) and (2), and the region growing ends.
4. A method for detecting defects in corrugated paperboard according to claim 3, characterized in that: When setting the threshold T, the following method is used: set the existence threshold T to divide all pixels of the image into two categories, C1 and C2. The grayscale means of C1 and C2 are m1 and m2 respectively. The global average grayscale value of the image is m. The probability that the pixel is divided into C1 and C2 is p1 and p2 respectively. Then ;(3) ;(4) when When the value is the largest, the optimal threshold T is obtained as the T value in equation (1) and equation (2).
5. A method for detecting defects in corrugated paperboard according to claim 1, characterized in that: When graying, the image is converted using a weighted method. The conversion formula is as follows: Gray=0.299R+0.587G+0.114B; In the formula: Gray—single color channel after conversion; R—one color channel; G—one color channel; B—another color channel.
6. A method for detecting defects in corrugated paperboard according to claim 1, characterized in that: When performing edge extraction, the following method is used: S1. Calculate the partial derivative matrices P and Q of the image in the X and Y directions, and calculate the gradient amplitude in the X and Y directions according to the first-order difference convolution template, where the first-order difference convolution template is as follows: , ; S2, calculating the gradient amplitude and azimuth according to the gradient amplitude in the X and Y directions; S3, thinning the wide edge band, that is, only retaining the area with the largest edge peak value, and setting the remaining non-maximum points to zero; S4, dual threshold algorithm detects edges and connecting edges.
7. A method for detecting defects in corrugated paperboard according to claim 1, characterized in that: When fitting, the least square circle fitting is used, and the defect type is determined based on the fitting results.
8. A method for detecting defects in corrugated paperboard according to claim 7, characterized in that: When judging the defect type, the coordinates of the center of the least squares circle after fitting are set to (M, K) and the radius is r. If the fitting radius r is too large, it is directly judged as a linear defect; otherwise, the difference di between each edge point on the contour and the fitting radius is calculated: ;(5) The average value of each edge point di on the contour is taken as the roundness error. If the straightness error of the corresponding edge point is smaller, it is judged as a linear defect; if the roundness error is smaller, it is judged as a point defect.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the method for detecting defects in corrugated cardboard according to any one of claims 1 to 8.
10. A readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, the defect detection method for corrugated cardboard described in any one of claims 1-8 is implemented.
Citation Information
Patent Citations
Corrugated carton pressing line defect detection optimization method based on artificial intelligence system
CN114782475A
Heat pipe orifice defect detection device and method based on machine vision
CN114894808A
Corrugated paper defect detection method based on image processing
CN115239737A
Corrugated board surface defect intelligent identification method based on analog image
CN117788469A
Point cloud segmentation method and system based on region growth
CN117994527A
Cited By
Optical glass edge defect detection method and system
CN119941690A
Paper direction detection method based on machine vision
CN120070441A
Paper Orientation Detection Method Based on Machine Vision
CN120070441B