A method and system for detecting paper defects
By acquiring the local depth value of each pixel on the paper and performing convolution operations, combined with curve fitting, the problem of distinguishing between ripples and wrinkles on the paper surface in existing technologies has been solved, achieving high-precision defect detection and enhancing the stability and adaptability of the system.
Patent Information
- Application Number
- CN202510831759.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-06-20
AI Technical Summary
Existing technologies struggle to effectively distinguish between periodic ripples and longitudinal wrinkles on paper surfaces, resulting in insufficient detection accuracy. This is especially problematic in actual production environments where optical interference and data quality issues are severe.
By acquiring the local depth value of each pixel on the paper, utilizing the changing trend of the local depth value and convolution operation, combined with curve fitting, wrinkles and ripple defects are identified and classified. Height information is obtained by using distance sensors such as the LK-G80 laser scanning sensor to construct an accurate pixel classification mechanism.
It improves the accuracy and robustness of paper defect detection, can accurately distinguish between wrinkles and ripples in complex environments, enhances the stability and adaptability of the system, and reduces errors caused by light.
Smart Images

Figure CN120765547B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of material surface structure detection technology, specifically relating to a method and system for detecting paper defects. Background Technology
[0002] During the production process, due to equipment wear, raw material or environmental pollution, and improper operation, paper surface defects such as wrinkles, tears, holes, and stains may occur. In actual production, real-time and accurate identification of the type of a paper defect and tracing its source are of great significance for monitoring paper production quality. Currently, methods for detecting paper surface defects mainly include digital image feature extraction methods and deep learning methods. Among them, digital image feature extraction methods are highly dependent on data, and the data obtained from sampling varies greatly due to paper texture and other issues, resulting in poor detection accuracy. Deep learning methods based on computer vision have high requirements for data quality, but it is difficult to obtain very ideal data in the actual production environment, which also leads to poor detection accuracy. To solve the above problems, a paper entitled "Paper" was filed on November 17, 2021, with publication number CN114331957B. A Chinese invention patent for a defect detection method, device, and electronic equipment proposes a paper defect detection method. This patent is based on a height information-based defect detection method, avoiding optical interference in the actual production environment. Furthermore, by further mining the height information to obtain gradient information, it expands the information richness and improves the detection accuracy. However, this patent is based on the height value of each pixel point of the paper, that is, it monitors the micro-contour abnormalities of the paper according to the height distribution of the paper surface. There are two types of paper defects: paper surface (periodic wavy structure) ripples and paper surface (longitudinal wrinkles in the surface structure) wrinkles. Both of them are manifested as uneven height distribution on the paper surface. However, paper surface ripple defects can be eliminated by calendering and hot pressing, while paper surface wrinkle defects are more difficult to improve and most need to be recycled and reused. The above method still cannot effectively distinguish between the two types of defects, affecting the micro-contour of the paper. Summary of the Invention
[0003] The purpose of this invention is to provide a method and system for detecting paper defects, so as to solve one or more technical problems existing in the prior art, and at least provide a beneficial option or create conditions.
[0004] To achieve the above objectives, according to one aspect of the present invention, a method for detecting paper defects is provided, the method comprising the following steps:
[0005] S100, Obtain the height information corresponding to each pixel in the paper image to be detected;
[0006] S200, based on the acquired height information, filters out abnormal pixels;
[0007] S300, calculate the local depth values of all abnormal pixels;
[0008] S400 classifies pixels based on local depth values;
[0009] S500 determines the defects of the paper to be inspected based on the classification results.
[0010] Furthermore, in S100, the specific method for obtaining the height information corresponding to each pixel in the image of the paper to be tested is as follows: the ranging sensor is placed horizontally directly above the paper to be tested, and the distance between the position point of each pixel on the paper to be tested and the ranging sensor is detected as the height information corresponding to each pixel on the paper to be tested.
[0011] Furthermore, the ranging sensor is any one of the following: LK-G80 laser scanning sensor, optoNCDT 1420 optical displacement sensor, VK-X1000 laser confocal microscope, ATOS Triple Scan structured light sensor, and capaNCDT 6100 capacitive sensor.
[0012] Currently, methods for detecting surface defects in paper mainly include digital image feature extraction methods and deep learning methods. Digital image feature extraction methods are highly dependent on data, and the data obtained from sampling paper varies greatly due to its texture and other factors, leading to poor detection accuracy. Deep learning methods based on computer vision have high requirements for data quality, but obtaining ideal data in actual production environments is difficult, also resulting in poor detection accuracy. To address these issues, a Chinese invention patent, filed on November 17, 2021, with publication number CN114331957B, entitled "Paper Defect Detection Method, Device, and Electronic Equipment," proposes a paper defect detection method. This patent uses a height-information-based defect detection method, avoiding optical interference in actual production environments, and further extracts ladder-like structures from the height information. While this patent expands the information richness and improves detection accuracy by using height information, it is based on the height value of each pixel on the paper, i.e., monitoring the micro-contour abnormalities of the paper according to the height distribution on the paper surface. There are two types of paper defects: paper surface (periodic wavy structure) ripples and paper surface (longitudinal wrinkles in the surface structure) wrinkles. Both of these are manifested as uneven height distribution on the paper surface. However, paper surface ripple defects can be eliminated by calendering and hot pressing, while paper surface wrinkle defects are more difficult to improve and most need to be recycled. The above methods still cannot effectively distinguish between the two types of defects, affecting the micro-contour of the paper. To solve the above problems, this invention provides the following method, which improves the accuracy of paper defect identification by obtaining the local depth value of each pixel of the paper to be tested and classifying them according to the local depth value.
[0013] Furthermore, in S200, the specific method for filtering out abnormal pixels based on the acquired height information is as follows: traverse the height information of all pixels and other pixels in the 8-neighborhood of the pixel, and construct a height matrix HM from all the height information (if the current pixel is an edge pixel, then fill in the height information corresponding to the blank pixels in its eight-neighborhood with zeros), with i as the index of the height matrix, where i∈[1,N], and N represents the number of pixels contained in the paper to be detected;
[0014] Traverse all height matrices contained in the paper to be tested, calculate the average value of each element in the height matrix to form a standard matrix, calculate the difference between each height matrix and the standard matrix in turn, use the difference result as the height difference matrix of each pixel, and perform convolution operation between the standard matrix and each height difference matrix in turn. Mark the pixels whose calculation result is greater than the average value as abnormal pixels, or the pixels whose calculation result is less than zero as abnormal pixels.
[0015] Furthermore, in S300, the specific method for calculating the local depth values of all abnormal pixels is as follows: traverse all abnormal pixels and their corresponding height matrices in the paper to be inspected, add the height matrices corresponding to pixels whose convolution operation results are greater than zero to list List1, and update list List1 according to the size of the operation results; add the height matrices corresponding to pixels whose convolution operation results are less than zero to list List2, and update list List2 according to the size of the operation results.
[0016] Iterate through List1, sum and average all matrices in List1, and use the average matrix as the current base matrix A of List1. Starting from the first height matrix, calculate the matrix difference between the current matrix and the next adjacent matrix, and use the difference result as the difference matrix between the current matrix and the next adjacent matrix. Perform convolution operation between the difference matrix and the base matrix, and record the result as the local depth value of the current pixel.
[0017] Iterate through List2, sum and average all matrices in List2, and use the average matrix as the current base matrix B of List2. Starting from the first height matrix, calculate the matrix difference between the current matrix and the next adjacent matrix, and use the difference result as the difference matrix between the current matrix and the next adjacent matrix. Perform convolution operation between the difference matrix and the base matrix, and record the result as the local depth value of the current pixel.
[0018] Furthermore, in S400, the specific method for classifying pixels based on local depth values is as follows: In List1, the local depth values of all pixels are traversed, and the local depth values are recorded as LDV. jWhere j represents the pixel number in List1, according to the formula Calculate the depth variation between adjacent pixels, PV j This represents the depth change between the j-th pixel and the (j+1)-th pixel, and M represents the number of pixels contained in List1;
[0019] Let j = 1, and iterate through all PVs within the range of j. j According to the formula If I is satisfied j+1 ≥I j And I j+1 ≥I mean , or I j+1 ≤I j And I j+1 ≤I mean If the current pixel is not found, then add the current pixel to list List2.
[0020] In List2, iterate through the local depth values of all pixels and record the local depth values as LDV. k Where k represents the pixel number in List2, according to the formula Calculate the depth variation between adjacent pixels, PV k This represents the depth change between the k-th pixel and the (k+1)-th pixel;
[0021] Let k = 1, and iterate through all PVs within the range of values for k. k According to the formula If I is satisfied k+1 <I k And I k+1 <I mean , or I k+1 >I k And I k+1 >I mean If the current pixel is not found, then add the current pixel to list List1.
[0022] Mark all pixels in List1 as wrinkled pixels and all pixels in List2 as wavy pixels. Fit wrinkled pixels into wrinkled curves using curve fitting and wavy pixels into wavy curves using curve fitting.
[0023] The beneficial effects of this step are as follows: The above steps extract surface curve features through convolution and trend modeling of the local height matrix. Based on the geometry, undulation pattern, and continuous change trend of the fitted curve, the surface contour structure is classified and analyzed, thus determining whether it is a wrinkled structure or a wavy structure. By introducing a formula for calculating the change trend based on local depth value (LDV), it is possible to effectively identify and classify abnormally distributed pixels in the surface wavy defect area caused by longitudinal wrinkles and periodic wavy structures in the paper surface structure. Using PV... j This method measures the depth variation between adjacent pixels, considering both the accumulation of local values and the absolute deviation of the slope of change. This effectively characterizes the tendency of pixels to move away from dense centers in space. Subsequently, it utilizes the PV... j The method accumulates and judges the direction and intensity of changes to determine whether the current pixel is in an edge region with a significant overall trend change. Through this method, discrete pixels far from the local aggregation center can be accurately screened out, that is, feature points with significant local depth value jumps but still possibly belonging to the abnormal category. It determines whether the pixel distribution is uneven overall, such as whether the trend strength of front and back points in the wrinkled area is continuous, and whether the changes in the wavy area are symmetrical. It enhances the edge recognition capability of defect features, and is especially suitable for detecting defects with blurred linear trends but obvious overall diffusion characteristics, such as slight wavy lines and slightly convex edges. It avoids misclassifying densely distributed normal areas as surface structure anomalies, improving detection accuracy and robustness. Through this classification mechanism, not only is automatic iterative optimization and classification of pixels in wrinkled and wavy areas realized, but a more accurate data foundation is also provided for subsequent curve fitting and defect area enclosing.
[0024] Furthermore, in S500, the specific method for judging the defect status of the paper to be inspected based on the classification result is as follows: extract the coordinates of the first pixel point of the wrinkle curve as A1(X1, Y1), extract the coordinates of the last pixel point of the wrinkle curve as A2(X2, Y2), connect A1 and A2 to form a line segment Line1, where the length of the line segment Line1 is |A1A2|, mark the midpoint of Line1 as M1, draw a circle C1 with M1 as the center and |A1A2| / 2 as the radius, check whether all pixels on the wrinkle curve are inside the circle C1. If all pixels on the wrinkle curve are not inside the circle C1, update the radius to |A1A2| / 2+|A1M1|-|A2M1|, update the circle C1 with M1 as the center and the updated radius, until all pixels on the wrinkle curve are inside the circle C1, extract the area inside the circle C1 as the defect area, and upload the image contained in the defect area to the classifier to obtain the defect result;
[0025] The coordinates of the first pixel of the wavy curve are extracted as B1(X1, Y1), and the coordinates of the last pixel of the fold curve are extracted as B2(X2, Y2). Connect B1 and B2 to form a line segment Line2, where the length of line segment Line2 is |B1B2|. Mark the midpoint of Line2 as M2. Draw a circle C2 with M2 as the center and |B1B2| / 2 as the radius. Check whether all pixels on the fold curve are inside circle C2. If not all pixels on the fold curve are inside circle C2, update the radius to |B1B2| / 2+|B1M2|-|B2M2|. Update circle C2 with M2 as the center and the updated radius until all pixels on the fold curve are inside circle C2. Extract the area inside circle C2 as the defect area. Upload the image containing the defect area to the classifier to obtain the defect result.
[0026] The beneficial effects of the above steps are as follows: by extracting the coordinates of the first and last pixels of the folded curve and constructing a circular region based on these points, the possible defect areas are initially defined. However, a circle with a single radius may not be able to completely cover all pixels on the folded curve. Therefore, it is necessary to continuously update the radius to ensure that all pixels are contained within the circular area. This can avoid missing any possible defects. The above steps of updating the radius make the detection process more flexible and accurate, and can effectively adapt to curves of different shapes and sizes, thereby avoiding misjudgments or missed detections caused by a fixed radius.
[0027] Furthermore, the classifier is an SVM classifier.
[0028] The beneficial effects of this invention are as follows: This invention not only detects the presence of structural anomalies on the paper surface, but also further identifies its structural type (such as periodic ripples and non-periodic wrinkles), thereby reflecting the physical surface morphology formed during the paper's production process. Specifically, by quantifying the local depth value of each pixel and combining it with the depth change trend and differences between it and adjacent pixels, a precise pixel classification mechanism is established. Compared to traditional visual recognition methods that rely on grayscale images or color changes for judgment, this method directly quantifies the microscopic deformation characteristics of the paper surface through height information, avoiding errors caused by the subjectivity of visual perception. Furthermore, the local depth values used are constructed based on real physical height, are unaffected by illumination, significantly enhance system stability, and can further distinguish between continuous features and spatial distribution differences, thus overcoming classification interference caused by height consistency. Even when paper deformation is small, longitudinal wrinkles in the surface structure are shallow, or the periodicity of periodic ripple structures is irregular, this method can still accurately identify abnormal areas through in-depth analysis of the local height distribution structure, improving the system's universality and practicality in actual industrial scenarios.
[0029] The present invention also provides a paper defect detection system, the system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the computer program in a unit of the following system:
[0030] The information acquisition unit is used to acquire the height information corresponding to each pixel in the image of the paper to be inspected through an optical sensor.
[0031] Anomaly marking unit is used to filter out abnormal pixels based on the acquired height information;
[0032] The feature calculation unit is used to calculate the local depth values of all abnormal pixels.
[0033] The feature classification unit is used to classify pixels based on local depth values;
[0034] The defect identification unit is used to determine the defect status of the paper to be inspected based on the classification results.
[0035] The beneficial effects of this invention are as follows: This invention not only detects whether there are structural anomalies on the paper surface, but also further identifies its structural type (such as periodic ripples and non-periodic wrinkles), thereby reflecting the physical surface morphology formed during the paper production process. Specifically, by quantifying the local depth value of each pixel and combining it with the depth change trend and differences between it and adjacent pixels, a precise pixel classification mechanism is established. Compared with traditional visual recognition methods that rely on grayscale images or color changes for judgment, this method directly quantifies the microscopic deformation characteristics of the paper surface through height information, avoiding errors caused by the subjectivity of visual perception. At the same time, the local depth value used is based on the real physical height and is not affected by illumination, significantly enhancing the system stability. It can further distinguish its continuous characteristics and spatial distribution differences, thereby overcoming the classification interference caused by height consistency. Even when the paper deformation is small, the longitudinal wrinkles in the surface structure are shallow, or the periodicity of the periodic ripple structure is irregular, this method can still accurately identify abnormal areas through in-depth analysis of the local height distribution structure, improving the universality and practicality of the system in actual industrial scenarios. Attached Figure Description
[0036] Figure 1 The diagram shows a flowchart of a paper defect detection method.
[0037] Figure 2 The diagram shows the structure of a paper defect detection system. Detailed Implementation
[0038] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0039] Example 1:
[0040] Figure 1 The diagram shows a flowchart of a method for detecting paper defects.
[0041] Reference Figure 1 This invention proposes a method for detecting paper defects, the method comprising the following steps:
[0042] S100, Obtain the height information corresponding to each pixel in the paper image to be detected;
[0043] S200, based on the acquired height information, filters out abnormal pixels;
[0044] S300, calculate the local depth values of all abnormal pixels;
[0045] S400 classifies pixels based on local depth values;
[0046] S500 determines the defects of the paper to be inspected based on the classification results.
[0047] Furthermore, in S100, the specific method for obtaining the height information corresponding to each pixel in the image of the paper to be tested is as follows: the ranging sensor is placed horizontally directly above the paper to be tested, and the distance between the position point of each pixel on the paper to be tested and the ranging sensor is detected as the height information corresponding to each pixel on the paper to be tested.
[0048] Furthermore, the ranging sensor is an LK-G80 laser scanning sensor.
[0049] Furthermore, in S200, the specific method for filtering out abnormal pixels based on the acquired height information is as follows: traverse the height information of all pixels and other pixels in the 8-neighborhood of the pixel, and construct a height matrix HM from all the height information (if the current pixel is an edge pixel, then fill in the height information corresponding to the blank pixels in its eight-neighborhood with zeros), with i as the index of the height matrix, where i∈[1,N], and N represents the number of pixels contained in the paper to be detected;
[0050] Traverse all height matrices contained in the paper to be tested, calculate the average value of each element in the height matrix to form a standard matrix, calculate the difference between each height matrix and the standard matrix in turn, use the difference result as the height difference matrix of each pixel, and perform convolution operation between the standard matrix and each height difference matrix in turn. Mark the pixels whose calculation result is greater than the average value as abnormal pixels, or the pixels whose calculation result is less than zero as abnormal pixels.
[0051] Furthermore, in S300, the specific method for calculating the local depth values of all abnormal pixels is as follows: traverse all abnormal pixels and their corresponding height matrices in the paper to be inspected, add the height matrices corresponding to pixels whose convolution operation results are greater than zero to list List1, and update list List1 according to the size of the operation results; add the height matrices corresponding to pixels whose convolution operation results are less than zero to list List2, and update list List2 according to the size of the operation results.
[0052] Iterate through List1, sum and average all matrices in List1, and use the average matrix as the current base matrix A of List1. Starting from the first height matrix, calculate the matrix difference between the current matrix and the next adjacent matrix, and use the difference result as the difference matrix between the current matrix and the next adjacent matrix. Perform convolution operation between the difference matrix and the base matrix, and record the result as the local depth value of the current pixel.
[0053] Iterate through List2, sum and average all matrices in List2, and use the average matrix as the current base matrix B of List2. Starting from the first height matrix, calculate the matrix difference between the current matrix and the next adjacent matrix, and use the difference result as the difference matrix between the current matrix and the next adjacent matrix. Perform convolution operation between the difference matrix and the base matrix, and record the result as the local depth value of the current pixel.
[0054] Furthermore, in S400, the specific method for classifying pixels based on local depth values is as follows: In List1, the local depth values of all pixels are traversed, and the local depth values are recorded as LDV. j Where j represents the pixel number in List1, according to the formula Calculate the depth variation between adjacent pixels, PV j This represents the depth change between the j-th pixel and the (j+1)-th pixel, and M represents the number of pixels contained in List1;
[0055] Let j = 1, and iterate through all PVs within the range of j. j According to the formula If I is satisfied j+1 ≥I j And I j+1 ≥I mean , or I j+1 ≤I j And I j+1 ≤I mean If the current pixel is not found, then add the current pixel to list List2.
[0056] In List2, iterate through the local depth values of all pixels and record the local depth values as LDV. k Where k represents the pixel number in List2, according to the formula Calculate the depth variation between adjacent pixels, PV k This represents the depth change between the k-th pixel and the (k+1)-th pixel;
[0057] Let k = 1, and iterate through all PVs within the range of values for k. k According to the formula If I is satisfied k+1 <I k And I k+1 <I mean , or I k+1 >I k And I k+1 >I mean If the current pixel is not found, then add the current pixel to list List1.
[0058] Mark all pixels in List1 as wrinkled pixels and all pixels in List2 as wavy pixels. Fit wrinkled pixels into wrinkled curves using curve fitting and wavy pixels into wavy curves using curve fitting.
[0059] Furthermore, in S500, the specific method for judging the defect status of the paper to be inspected based on the classification result is as follows: extract the coordinates of the first pixel point of the wrinkle curve as A1(X1, Y1), extract the coordinates of the last pixel point of the wrinkle curve as A2(X2, Y2), connect A1 and A2 to form a line segment Line1, where the length of the line segment Line1 is |A1A2|, mark the midpoint of Line1 as M1, draw a circle C1 with M1 as the center and |A1A2| / 2 as the radius, check whether all pixels on the wrinkle curve are inside the circle C1. If all pixels on the wrinkle curve are not inside the circle C1, update the radius to |A1A2| / 2+|A1M1|-|A2M1|, update the circle C1 with M1 as the center and the updated radius, until all pixels on the wrinkle curve are inside the circle C1, extract the area inside the circle C1 as the defect area, and upload the image contained in the defect area to the classifier to obtain the defect result;
[0060] The coordinates of the first pixel of the wavy curve are extracted as B1(X1, Y1), and the coordinates of the last pixel of the fold curve are extracted as B2(X2, Y2). Connect B1 and B2 to form a line segment Line2, where the length of line segment Line2 is |B1B2|. Mark the midpoint of Line2 as M2. Draw a circle C2 with M2 as the center and |B1B2| / 2 as the radius. Check whether all pixels on the fold curve are inside circle C2. If not all pixels on the fold curve are inside circle C2, update the radius to |B1B2| / 2+|B1M2|-|B2M2|. Update circle C2 with M2 as the center and the updated radius until all pixels on the fold curve are inside circle C2. Extract the area inside circle C2 as the defect area. Upload the image containing the defect area to the classifier to obtain the defect result.
[0061] Furthermore, the classifier is an SVM classifier.
[0062] The beneficial effects of this invention are as follows: This invention not only detects whether there are structural anomalies on the paper surface, but also further identifies its structural type (such as periodic ripples and non-periodic wrinkles), thereby reflecting the physical surface morphology formed during the paper production process. Specifically, by quantifying the local depth value of each pixel and combining it with the depth change trend and differences between it and adjacent pixels, a precise pixel classification mechanism is established. Compared with traditional visual recognition methods that rely on grayscale images or color changes for judgment, this method directly quantifies the microscopic deformation characteristics of the paper surface through height information, avoiding errors caused by the subjectivity of visual perception. At the same time, the local depth value used is based on the real physical height and is not affected by illumination, significantly enhancing the system stability. It can further distinguish its continuous characteristics and spatial distribution differences, thereby overcoming the classification interference caused by height consistency. Even when the paper deformation is small, the longitudinal wrinkles in the surface structure are shallow, or the periodicity of the periodic ripple structure is irregular, this method can still accurately identify abnormal areas through in-depth analysis of the local height distribution structure, improving the universality and practicality of the system in actual industrial scenarios.
[0063] Furthermore, the present invention also provides an embodiment of a paper defect detection system, such as... Figure 2 The diagram shows a structural diagram of a paper defect detection system according to the present invention. The paper defect detection system of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the paper defect detection system embodiment described above.
[0064] The system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program in units of the following system:
[0065] The information acquisition unit is used to acquire the height information corresponding to each pixel in the image of the paper to be inspected through an optical sensor.
[0066] Anomaly marking unit is used to filter out abnormal pixels based on the acquired height information;
[0067] The feature calculation unit is used to calculate the local depth values of all abnormal pixels.
[0068] The feature classification unit is used to classify pixels based on local depth values;
[0069] The defect identification unit is used to determine the defect status of the paper to be inspected based on the classification results.
[0070] The paper defect detection system described above can run on computing devices such as desktop minicomputers, laptops, handheld computers, and cloud servers. The system that can run on the paper defect detection system may include, but is not limited to, processors and memory. Those skilled in the art will understand that the examples described are merely illustrations of a paper defect detection system and do not constitute a limitation on such a system. It may include more or fewer components, combinations of certain components, or different components. For example, the paper defect detection system may also include input / output devices, network access devices, buses, etc.
[0071] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the paper defect detection system, connecting various parts of the system via various interfaces and lines.
[0072] The memory can be used to store the computer program and / or modules. The processor implements various functions of the paper defect detection system by running or executing the computer program and / or modules stored in the memory and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0073] Although the invention has been described in considerable detail and particularly with regard to several of the described embodiments, it is not intended to limit itself to any of these details or embodiments or any particular embodiment, thereby effectively covering the intended scope of the invention. Furthermore, the invention has been described above with respect to embodiments foreseeable by the inventors in order to provide a useful description, and non-substantial modifications to the invention that have not yet been foreseen may still represent equivalent modifications.
Claims
1. A method for detecting paper defects, characterized in that, The method includes the following steps: S100, Obtain the height information corresponding to each pixel in the paper image to be detected; S200, based on the acquired height information, filters out abnormal pixels; S300, calculate the local depth values of all abnormal pixels; S400 classifies pixels based on local depth values; S500 determines the defects of the paper to be inspected based on the classification results; In S300, the method for calculating the local depth values of all abnormal pixels specifically includes: traversing all abnormal pixels and their corresponding height matrices in the paper to be inspected, adding the height matrices corresponding to pixels whose convolution operation results are greater than zero to list List1, and updating list List1 according to the size of the operation results; adding the height matrices corresponding to pixels whose convolution operation results are less than zero to list List2, and updating list List2 according to the size of the operation results. Iterate through List1, sum and average all matrices in List1, and use the average matrix as the current base matrix A of List1. Starting from the first height matrix, calculate the matrix difference between the current matrix and the next adjacent matrix, and use the difference result as the difference matrix between the current matrix and the next adjacent matrix. Perform convolution operation between the difference matrix and the base matrix, and record the result as the local depth value of the current pixel. Iterate through List2, sum and average all matrices in List2, and use the average matrix as the current base matrix B of List2. Starting from the first height matrix, calculate the matrix difference between the current matrix and the next adjacent matrix, and use the difference result as the difference matrix between the current matrix and the next adjacent matrix. Perform convolution operation between the difference matrix and the base matrix, and record the result as the local depth value of the current pixel.
2. The method for detecting paper defects according to claim 1, characterized in that, In S100, the method for obtaining the height information corresponding to each pixel in the image of the paper to be inspected is as follows: the distance sensor is placed horizontally directly above the paper to be inspected, and the distance between the position point of each pixel on the paper to be inspected and the distance sensor is detected as the height information corresponding to each pixel on the paper to be inspected.
3. The method for detecting paper defects according to claim 2, characterized in that, In S200, the method for filtering out abnormal pixels based on the acquired height information is as follows: traverse the height information of all pixels and other pixels in the 8-neighborhood of the pixel, construct a height matrix HM from all the height information, and use i as the index of the height matrix, where i∈[1,N], and N represents the number of pixels contained in the paper to be detected. Traverse all height matrices contained in the paper to be tested, calculate the average value of each element in the height matrix to form a standard matrix, calculate the difference between each height matrix and the standard matrix in turn, use the difference result as the height difference matrix of each pixel, and perform convolution operation between the standard matrix and each height difference matrix in turn. Mark the pixels whose calculation result is greater than the average value as abnormal pixels, or the pixels whose calculation result is less than zero as abnormal pixels.
4. The method for detecting paper defects according to claim 3, characterized in that, In S400, the method for classifying pixels based on local depth values is as follows: In List1, the local depth values of all pixels are traversed, and each local depth value is denoted as LDV. j Where j represents the index of the pixel in List1, and the depth change between adjacent pixels is calculated using the formula PV. j PV j This represents the depth change between the j-th pixel and the (j+1)-th pixel; Let j=1, and iterate through all PVs within the range of j. j According to the formula , among which, I j For the cumulative result of the direction and intensity of the changes in PV at depth from the 1st to the jth in sequence List1, if I j+1 ≥I j And I j+1 ≥I mean , or I j+1 ≤I j And I j+1 ≤I mean , among which, I mean If the cumulative result of the direction and intensity of all depth changes (PVs) in sequence List1 is the average value, then the current pixel is added to list List2, where M represents the number of pixels contained in List1. In List2, iterate through the local depth values of all pixels and record the local depth values as LDV. k Where k represents the pixel number in List2, according to the formula Calculate the depth variation between adjacent pixels, PV k This represents the depth change between the k-th pixel and the (k+1)-th pixel; Let k=1, and iterate through all PVs within the range of values for k. k According to the formula , among which, I k For the cumulative result of the direction and intensity of the depth change PV from the 1st to the kth in sequence List2, if I k+1 <I k And I k+1 <I mean , or I k+1 >I k And I k+1 >I mean , among which, I mean If the cumulative average of the direction and intensity of all depth changes (PVs) in sequence List2 is given, then the current pixel is added to list List1. Mark all pixels in List1 as wrinkled pixels and all pixels in List2 as wavy pixels. Fit wrinkled pixels into wrinkled curves using curve fitting and wavy pixels into wavy curves using curve fitting.
5. The method for detecting paper defects according to claim 4, characterized in that, In S500, the method for determining the defect status of the paper to be inspected based on the classification results is as follows: the coordinates of the first pixel point of the wrinkle curve are extracted as A1 (X1, Y1), and the coordinates of the last pixel point of the wrinkle curve are extracted as A2 (X2, Y2). A1 and A2 are connected to form a line segment Line1, where the length of the line segment Line1 is |A1A2|. The midpoint of Line1 is marked as M1. A circle C1 is drawn with M1 as the center and |A1A2| / 2 as the radius. It is checked whether all pixels on the wrinkle curve are inside the circle C1. If all pixels on the wrinkle curve are not inside the circle C1, the radius is updated to |A1A2| / 2+|A1M1|-|A2M1|. The circle C1 is updated with M1 as the center and the updated radius until all pixels on the wrinkle curve are inside the circle C1. The area inside the circle C1 is extracted as the defect area. The image containing the defect area is uploaded to the classifier to obtain the defect result. The coordinates of the first pixel of the wavy curve are extracted as B1(X1, Y1), and the coordinates of the last pixel of the fold curve are extracted as B2(X2, Y2). Connect B1 and B2 to form a line segment Line2, where the length of line segment Line2 is |B1B2|. Mark the midpoint of Line2 as M2. Draw a circle C2 with M2 as the center and |B1B2| / 2 as the radius. Check whether all pixels on the fold curve are inside circle C2. If not all pixels on the fold curve are inside circle C2, update the radius to |B1B2| / 2+|B1M2|-|B2M2|. Update circle C2 with M2 as the center and the updated radius until all pixels on the fold curve are inside circle C2. Extract the area inside circle C2 as the defect area. Upload the image containing the defect area to the classifier to obtain the defect result.
6. A paper defect detection system, characterized in that, The paper defect detection system includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the paper defect detection method according to any one of claims 1-5.
Citation Information
Patent Citations
Paper Defect Detection Method, Device and Electronic Equipment
CN114331957B
Reinforcing steel bar welding quality detection method based on neighborhood pixel value difference proportion
CN112651967A
Real-time confidence-based image hole-filling for depth maps
US12094144B1
Cited By
Method and system for detecting surface defects of special wrapping paper based on machine vision
CN122222963A