Paper Defect Detection Method, Device and Electronic Equipment
By acquiring paper height information and using gradient information for feature extraction, the problem of low detection accuracy caused by optical interference and data quality problems in the prior art is solved, and a higher detection accuracy is achieved.
Patent Information
- Application Number
- CN202111359783.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2041-11-17
AI Technical Summary
In actual production environment, existing paper defect detection methods have poor detection accuracy due to optical interference and data quality problems.
By obtaining the height information of the paper and using gradient information for feature extraction, the feature vector is constructed and the pre-trained classifier is input to perform defect detection.
This method can avoid optical interference, expand information richness and improve detection accuracy through further mining of height information.
Smart Images

Figure CN114331957B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect detection, and in particular, to a method, device and electronic device for detecting paper defects. Background Art
[0002] Currently, the methods for detecting paper surface defects mainly include: digital image feature extraction methods and deep learning methods. The digital image feature extraction methods mainly include: LBP (Local Binary Pattern) algorithm, SIFT (Scale-invariant feature transform) algorithm, etc. The deep learning methods mainly include deep learning algorithms based on convolutional neural networks or VGG16 networks, etc.
[0003] The digital image feature extraction methods rely heavily on data, and due to problems such as the texture of paper, the data sampled varies greatly, resulting in poor detection accuracy; the deep learning methods based on computer vision have high requirements for the quality of data, and it is difficult to obtain very ideal data in the actual production environment, also resulting in poor detection accuracy. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, device and electronic device for detecting paper defects to improve the detection accuracy.
[0005] In a first aspect, an embodiment of the present invention provides a method for detecting paper defects, including:
[0006] Obtaining first height information of a paper to be detected; the first height information is the distance information between the paper to be detected placed on a horizontal plane and a ranging sensor horizontally placed above it, and the first height information includes the height values of each pixel point in the paper to be detected;
[0007] Obtaining gradient information of each pixel point in the paper to be detected according to the height values of each pixel point in the paper to be detected;
[0008] Determining a defect detection result of the paper to be detected according to the height values and gradient information of each pixel point in the paper to be detected.
[0009] Further, the step of obtaining gradient information of each pixel point in the paper to be detected according to the height values of each pixel point in the paper to be detected includes:
[0010] For each pixel point in the paper to be detected, determine the gradient information of the pixel point according to the height value of the pixel point and the height values of multiple adjacent pixel points of the pixel point; wherein, the multiple adjacent pixel points of the pixel point include pixel points located above, below, to the left, to the right, in the upper left, in the lower left, in the upper right, and in the lower right of the pixel point.
[0011] Further, the step of determining the defect detection result of the paper to be detected according to the height values and gradient information of each pixel point in the paper to be detected includes:
[0012] Determine the point type of each pixel point in the paper to be detected according to the gradient information of each pixel point in the paper to be detected; the point type includes a core point, a boundary point, or a noise point;
[0013] Construct a feature vector of each pixel point in the paper to be detected according to the height value, gradient information, and point type of each pixel point in the paper to be detected;
[0014] Input the feature vectors of each pixel point in the paper to be detected into a pre-trained classifier to obtain a defect detection result of whether there is a defect output by the classifier.
[0015] Further, the step of determining the point type of each pixel point in the paper to be detected according to the gradient information of each pixel point in the paper to be detected includes:
[0016] Use a preset clustering algorithm to perform clustering processing on the gradient information of each pixel point in the paper to be detected to obtain the point type of each pixel point in the paper to be detected.
[0017] Further, the method further includes:
[0018] Obtain the second height information and the marking result of the sample paper; wherein, the second height information includes the height values of each pixel point in the sample paper; the marking result is used to indicate whether there is a defect in the sample paper;
[0019] Obtain the gradient information of each pixel point in the sample paper according to the height values of each pixel point in the sample paper;
[0020] Determine the point type of each pixel point in the sample paper according to the gradient information of each pixel point in the sample paper;
[0021] Construct a feature vector of each pixel point in the sample paper according to the height value, gradient information, and point type of each pixel point in the sample paper;
[0022] Train the initial classifier to be trained according to the eigenvectors of each pixel point in the sample paper and the marking result, so as to obtain a trained classifier.
[0023] Further, the classifier includes an SVM classifier; the clustering algorithm includes a DBSCAN algorithm.
[0024] In a second aspect, an embodiment of the present invention further provides a paper defect detection device, including:
[0025] A first acquisition module, configured to acquire first height information of a paper to be detected; the first height information is distance information between the paper to be detected placed on a horizontal plane and a ranging sensor horizontally placed above it, and the first height information includes height values of each pixel point in the paper to be detected;
[0026] A second acquisition module, configured to acquire gradient information of each pixel point in the paper to be detected according to the height values of each pixel point in the paper to be detected;
[0027] A result determination module, configured to determine a defect detection result of the paper to be detected according to the height values and gradient information of each pixel point in the paper to be detected.
[0028] Further, the device further includes a training module, configured to:
[0029] Acquire second height information and a marking result of a sample paper; wherein, the second height information includes height values of each pixel point in the sample paper; the marking result is used to indicate whether the sample paper has a defect;
[0030] Acquire gradient information of each pixel point in the sample paper according to the height values of each pixel point in the sample paper;
[0031] Determine the point type of each pixel point in the sample paper according to the gradient information of each pixel point in the sample paper;
[0032] Construct an eigenvector of each pixel point in the sample paper according to the height value, gradient information and point type of each pixel point in the sample paper;
[0033] Train the initial classifier to be trained according to the eigenvectors of each pixel point in the sample paper and the marking result, so as to obtain a trained classifier.
[0034] In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory and a processor. A computer program that can run on the processor is stored in the memory. When the processor executes the computer program, the paper defect detection method described in the first aspect above is implemented.
[0035] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the paper defect detection method described in the first aspect above is executed.
[0036] For the paper defect detection method, device and electronic device provided by the embodiments of the present invention, when performing paper defect detection, first obtain the first height information of the paper to be detected; the first height information is the distance information between the paper to be detected placed on a horizontal plane and the ranging sensor horizontally placed above it, and the first height information includes the height values of each pixel point in the paper to be detected; then, according to the height values of each pixel point in the paper to be detected, obtain the gradient information of each pixel point in the paper to be detected; furthermore, according to the height values and gradient information of each pixel point in the paper to be detected, determine the defect detection result of the paper to be detected. This defect detection method based on height information can avoid optical interference in the actual production environment, and by further mining the height information to obtain gradient information, it expands the information richness, thus improving the detection accuracy. Description of the Drawings
[0037] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0038] Figure 1 It is a schematic flowchart of a paper defect detection method provided by an embodiment of the present invention;
[0039] Figure 2 It is a schematic flowchart of another paper defect detection method provided by an embodiment of the present invention;
[0040] Figure 3 It is a schematic structural diagram of a paper defect detection device provided by an embodiment of the present invention;
[0041] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed Embodiments
[0042] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0043] Currently, computer vision methods are usually used for detecting paper surface defects. Due to the complexity of the actual production environment, there are many optical interferences. Such computer vision methods cannot completely shield optical interferences and are greatly affected by the actual production environment, resulting in poor detection accuracy. Based on this, a paper defect detection method, device and electronic device provided by the embodiments of the present invention utilize the height information of the paper to detect the surface defects of the paper and further mine features based on the height information, which can improve the detection accuracy.
[0044] To facilitate the understanding of this embodiment, a paper defect detection method disclosed by the embodiments of the present invention will be introduced in detail first.
[0045] The embodiments of the present invention provide a paper defect detection method based on machine learning. This method can be executed by an electronic device with data processing capabilities, and the electronic device can be a laptop computer, a desktop computer, a palm computer, a tablet computer or a mobile phone, etc. Refer to Figure 1 The flow schematic diagram of a paper defect detection method shown. This method mainly includes the following steps S102 to step S106:
[0046] Step S102, obtaining the first height information of the paper to be detected; the first height information includes the height values of each pixel point in the paper to be detected.
[0047] The above first height information is the distance information between the paper to be detected placed on a horizontal plane and the ranging sensor horizontally placed above it, that is, the relative height information of the paper to be detected.
[0048] Step S104, obtaining the gradient information of each pixel point in the paper to be detected according to the height values of each pixel point in the paper to be detected.
[0049] In some possible embodiments, the above step S104 can be implemented through the following process: for each pixel point in the paper to be detected, determine the gradient information of the pixel point according to the height value of the pixel point and the height values of multiple adjacent pixel points of the pixel point; wherein, the multiple adjacent pixel points of the pixel point include the pixel points located above, below, to the left, to the right, in the upper left, in the lower left, in the upper right and in the lower right of the pixel point.
[0050] Statistically analyze the gradient information of all pixel points in the paper to be detected. Specifically, the method can be as follows: Subtract the height value of a certain pixel point from the height values of the pixel points around it (i.e., adjacent pixel points). The surrounding pixel points can include a total of eight pixel points: above, below, left, right, upper left, lower left, upper right, and lower right. The gradient information of a pixel point includes gradient values in eight directions. For pixel points located at the edge, the gradient values corresponding to the missing parts in the surrounding pixel points are defaulted to 0. For example, for the pixel point in the upper right corner, five directions of pixel points, namely the upper left, above, upper right, right, and lower right, are missing in its surrounding pixel points, and the gradient values in these five directions are set to 0.
[0051] Step S106: Determine the defect detection result of the paper to be detected based on the height values and gradient information of each pixel point in the paper to be detected.
[0052] In some possible embodiments, the above step S106 can be implemented through the following process: Determine the point type of each pixel point in the paper to be detected according to the gradient information of each pixel point in the paper to be detected; the point type includes core points, boundary points, or noise points; Construct the feature vector of each pixel point in the paper to be detected according to the height value, gradient information, and point type of each pixel point in the paper to be detected; Input the feature vectors of each pixel point in the paper to be detected into a pre-trained classifier to obtain the defect detection result of whether there are defects output by the classifier.
[0053] In a possible implementation manner, a preset clustering algorithm can be used to perform clustering processing on the gradient information of each pixel point in the paper to be detected to obtain the point type of each pixel point in the paper to be detected, and then perform feature information fusion, that is, concatenate the height value, gradient information, and point type of each pixel point into a multi-dimensional vector, and use this multi-dimensional vector as the feature vector of the pixel point. Finally, process the feature vectors of each pixel point through a pre-trained classifier to obtain the classification result (i.e., the defect detection result).
[0054] In specific implementation, the gradient information of a pixel can include gradient values in eight directions, so an eight-dimensional gradient vector can be formed. Based on this, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm can be used, but not limited to, to cluster the eight-dimensional gradient vectors of all pixels according to the gradient data set composed of pixel positions. For example, the eight-dimensional gradient vectors of all pixels are formed into a gradient data set according to pixel positions, and this gradient data set is input into a pre-trained DBSCAN clusterer to obtain the clustering result output by the DBSCAN clusterer. The DBSCAN clusterer classifies all pixels into three categories: core points, boundary points, and noise points, and the labels in the clustering result can be 0, 1, and 2 respectively.
[0055] To facilitate the classifier to classify the paper, all the obtained feature information can be fused together, that is, the height value, gradient information, and point type of each pixel are concatenated into a ten-dimensional vector. Then, the ten-dimensional vectors of all pixels can be input into a trained SVM (support vector machines) classifier to obtain the corresponding classification result output by the SVM classifier. This classification result can be 0 or 1, where 0 indicates no defect and 1 indicates a defect.
[0056] An embodiment of the present invention provides a method for detecting paper defects. When detecting paper defects, first obtain the first height information of the paper to be detected; the first height information is the distance information between the paper to be detected placed on a horizontal plane and the ranging sensor horizontally placed above it, and the first height information includes the height values of each pixel in the paper to be detected; then, according to the height values of each pixel in the paper to be detected, obtain the gradient information of each pixel in the paper to be detected; further, according to the height values and gradient information of each pixel in the paper to be detected, determine the defect detection result of the paper to be detected. This defect detection method based on height information can avoid optical interference in the actual production environment, and by further mining the height information to obtain gradient information, it expands the information richness, thus improving the detection accuracy.
[0057] For the sake of easy understanding, an embodiment of the present invention also provides another method for detecting paper defects, which includes the training process of the classifier. Refer to Figure 2 the schematic flowchart of another method for detecting paper defects shown in
[0058] Step S202: Obtain the second height information and the marking result of the sample paper; wherein, the second height information includes the height values of each pixel point in the sample paper; the marking result is used to indicate whether there are defects in the sample paper.
[0059] Step S204: Obtain the gradient information of each pixel point in the sample paper according to the height values of each pixel point in the sample paper.
[0060] Step S206: Determine the point type of each pixel point in the sample paper according to the gradient information of each pixel point in the sample paper.
[0061] Step S208: Construct the feature vector of each pixel point in the sample paper according to the height value, gradient information and point type of each pixel point in the sample paper.
[0062] Step S210: Train the initial classifier to be trained according to the feature vectors and the marking result of each pixel point in the sample paper to obtain a trained classifier.
[0063] Step S212: Obtain the first height information of the paper to be detected; the first height information includes the height values of each pixel point in the paper to be detected.
[0064] Step S214: Obtain the gradient information of each pixel point in the paper to be detected according to the height values of each pixel point in the paper to be detected.
[0065] Step S216: Determine the point type of each pixel point in the paper to be detected according to the gradient information of each pixel point in the paper to be detected.
[0066] Step S218: Construct the feature vector of each pixel point in the paper to be detected according to the height value, gradient information and point type of each pixel point in the paper to be detected.
[0067] Step S220: Input the feature vectors of each pixel point in the paper to be detected into the trained classifier to obtain the defect detection result of whether there are defects output by the classifier.
[0068] The above Figure 2 For the parts not described in detail in the above steps, reference can be made to the corresponding content of the foregoing embodiments, which will not be elaborated here.
[0069] The paper defect detection method provided by the embodiments of the present invention performs surface defect detection of the paper based on the height information of the paper and the classifier obtained by machine learning, which can avoid optical interference in the actual production environment, further perform feature mining based on the height information, expand the information richness through the design of feature engineering, avoid the limitation of the single height information on the classification effect, and improve the recognition accuracy (detection accuracy).
[0070] Corresponding to the above paper defect detection method, an embodiment of the present invention further provides a paper defect detection device. Refer to Figure 3 the structural schematic diagram of a paper defect detection device shown in
[0071] The first acquisition module 32 is configured to acquire first height information of a paper to be detected; the first height information is distance information between the paper to be detected placed on a horizontal plane and a ranging sensor horizontally placed above it, and the first height information includes height values of each pixel point in the paper to be detected;
[0072] The second acquisition module 34 is configured to acquire gradient information of each pixel point in the paper to be detected according to the height values of each pixel point in the paper to be detected;
[0073] The result determination module 36 is configured to determine a defect detection result of the paper to be detected according to the height values and gradient information of each pixel point in the paper to be detected.
[0074] When the paper defect detection device provided by the embodiment of the present invention performs paper defect detection, it first acquires first height information of the paper to be detected; the first height information is distance information between the paper to be detected placed on a horizontal plane and a ranging sensor horizontally placed above it, and the first height information includes height values of each pixel point in the paper to be detected; then it acquires gradient information of each pixel point in the paper to be detected according to the height values of each pixel point in the paper to be detected; and further determines a defect detection result of the paper to be detected according to the height values and gradient information of each pixel point in the paper to be detected. This defect detection method based on height information can avoid optical interference in the actual production environment, and by further mining the height information to obtain gradient information, it expands the information richness, thus improving the detection accuracy.
[0075] Further, the above second acquisition module 34 is specifically configured to: for each pixel point in the paper to be detected, determine the gradient information of the pixel point according to the height value of the pixel point and the height values of multiple adjacent pixel points of the pixel point; wherein, the multiple adjacent pixel points of the pixel point include pixel points located above, below, to the left, to the right, in the upper left, in the lower left, in the upper right, and in the lower right of the pixel point.
[0076] Further, the above result determination module 36 is specifically configured to: determine the point type of each pixel point in the paper to be detected according to the gradient information of each pixel point in the paper to be detected; the point type includes a core point, a boundary point or a noise point; construct a feature vector of each pixel point in the paper to be detected according to the height value, gradient information and point type of each pixel point in the paper to be detected; input the feature vectors of each pixel point in the paper to be detected into a pre-trained classifier to obtain a defect detection result of whether there is a defect output by the classifier.
[0077] Further, the above result determination module 36 is further configured to: perform clustering processing on the gradient information of each pixel point in the paper to be detected by using a preset clustering algorithm to obtain the point type of each pixel point in the paper to be detected.
[0078] Further, the above device further includes a training module, configured to: obtain the second height information and the marking result of the sample paper; wherein, the second height information includes the height values of each pixel point in the sample paper; the marking result is used to indicate whether the sample paper has a defect; obtain the gradient information of each pixel point in the sample paper according to the height values of each pixel point in the sample paper; determine the point type of each pixel point in the sample paper according to the gradient information of each pixel point in the sample paper; construct a feature vector of each pixel point in the sample paper according to the height value, gradient information and point type of each pixel point in the sample paper; train the initial classifier to be trained according to the feature vectors of each pixel point in the sample paper and the marking result to obtain a trained classifier.
[0079] Further, the above classifier includes an SVM classifier; the clustering algorithm includes a DBSCAN algorithm.
[0080] For the device provided in this embodiment, its implementation principle and the technical effects produced are the same as those of the foregoing method embodiment. For a brief description, for the parts not mentioned in the device embodiment, reference may be made to the corresponding content in the foregoing method embodiment.
[0081] See Figure 4 , an electronic device 100 is further provided in an embodiment of the present invention, including: a processor 40, a memory 41, a bus 42 and a communication interface 43, and the processor 40, the communication interface 43 and the memory 41 are connected through the bus 42; the processor 40 is configured to execute an executable module stored in the memory 41, such as a computer program.
[0082] Among them, the memory 41 may include a Random Access Memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory. The communication connection between this system network element and at least one other network element is realized through at least one communication interface 43 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used.
[0083] The bus 42 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 4 only a two-way arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0084] Among them, the memory 41 is used to store programs. After receiving an execution instruction, the processor 40 executes the program. The method executed by the device defined by the process disclosed in any embodiment of the foregoing embodiments of the present invention can be applied to the processor 40 or implemented by the processor 40.
[0085] The processor 40 may be an integrated circuit chip with the ability to process signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 40 or the instructions in the form of software. The above-mentioned processor 40 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 41, and the processor 40 reads the information in the memory 41 and combines its hardware to complete the steps of the above method.
[0086] The embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the paper defect detection method described in the foregoing method embodiments. The computer-readable storage medium includes: various media that can store program codes such as a USB flash drive, a mobile hard disk, a read-only memory (ROM for short), a RAM, a magnetic disk or an optical disc.
[0087] In all the examples shown and described here, any specific value should be construed as merely exemplary and not as a limitation. Therefore, other examples of the exemplary embodiments may have different values.
[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
[0089] In several embodiments provided in this application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of the units is only a logical functional division, and there may be other division methods in actual implementation. For another example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed among each other may be through some communication interfaces. The indirect couplings or communication connections of the apparatus or units may be in electrical, mechanical, or other forms.
[0090] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0091] In addition, in various embodiments of the present invention, the functional units may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for detecting paper defects, characterized in that, it includes: Obtaining the first height information of the paper to be detected; The first height information is the distance information between the paper to be detected placed on a horizontal plane and a ranging sensor horizontally placed above it. The first height information includes the height values of each pixel point in the paper to be detected; According to the height values of each pixel point in the paper to be detected, obtaining the gradient information of each pixel point in the paper to be detected; According to the height values and gradient information of each pixel point in the paper to be detected, determining the defect detection result of the paper to be detected, including: determining the point type of each pixel point in the paper to be detected according to the gradient information of each pixel point in the paper to be detected; The point type includes a core point, a boundary point or a noise point; according to the height value, gradient information and point type of each pixel point in the paper to be detected, constructing a feature vector of each pixel point in the paper to be detected; inputting the feature vectors of each pixel point in the paper to be detected into a pre-trained classifier to obtain the defect detection result of whether there is a defect output by the classifier.
2. The method for detecting paper defects according to claim 1, characterized in that, The step of obtaining the gradient information of each pixel point in the paper to be detected according to the height values of each pixel point in the paper to be detected includes: For each pixel point in the paper to be detected, determining the gradient information of the pixel point according to the height value of the pixel point and the height values of a plurality of adjacent pixel points of the pixel point; wherein, the plurality of adjacent pixel points of the pixel point include the pixel points located above, below, to the left, to the right, in the upper left, in the lower left, in the upper right and in the lower right of the pixel point.
3. The method for detecting paper defects according to claim 1, characterized in that, The step of determining the point type of each pixel point in the paper to be detected according to the gradient information of each pixel point in the paper to be detected includes: Using a preset clustering algorithm to perform clustering processing on the gradient information of each pixel point in the paper to be detected to obtain the point type of each pixel point in the paper to be detected.
4. The method for detecting paper defects according to claim 1, characterized in that, The method further includes: Obtaining the second height information and the marking result of the sample paper; wherein, the second height information includes the height values of each pixel point in the sample paper; the marking result is used to indicate whether there is a defect in the sample paper; According to the height values of each pixel point in the sample paper, obtaining the gradient information of each pixel point in the sample paper; According to the gradient information of each pixel point in the sample paper, determining the point type of each pixel point in the sample paper; According to the height values, gradient information and point type of each pixel point in the sample paper, constructing a feature vector of each pixel point in the sample paper; Training the initial classifier to be trained according to the feature vectors of each pixel point in the sample paper and the marking result to obtain a trained classifier.
5. The paper defect detection method according to claim 3, characterized in that, the classifier includes an SVM classifier; the clustering algorithm includes a DBSCAN algorithm.
6. A paper defect detection device, characterized in that, comprising: a first acquisition module for acquiring first height information of a paper to be detected; the first height information is the distance information between the paper to be detected placed on a horizontal plane and a ranging sensor horizontally placed above it, and the first height information includes the height values of each pixel point in the paper to be detected; a second acquisition module for acquiring gradient information of each pixel point in the paper to be detected according to the height values of each pixel point in the paper to be detected; a result determination module for determining a defect detection result of the paper to be detected according to the height values and gradient information of each pixel point in the paper to be detected, including: determining a point type of each pixel point in the paper to be detected according to the gradient information of each pixel point in the paper to be detected; the point type includes a core point, a boundary point or a noise point; constructing a feature vector of each pixel point in the paper to be detected according to the height value, gradient information and point type of each pixel point in the paper to be detected; inputting the feature vectors of each pixel point in the paper to be detected into a pre-trained classifier to obtain a defect detection result of whether there is a defect output by the classifier.
7. The paper defect detection device according to claim 6, characterized in that, the device further includes a training module for: acquiring second height information and a marking result of a sample paper; wherein, the second height information includes the height values of each pixel point in the sample paper; the marking result is used to indicate whether the sample paper has a defect; acquiring gradient information of each pixel point in the sample paper according to the height values of each pixel point in the sample paper; determining a point type of each pixel point in the sample paper according to the gradient information of each pixel point in the sample paper; constructing a feature vector of each pixel point in the sample paper according to the height value, gradient information and point type of each pixel point in the sample paper; training an initial classifier to be trained according to the feature vectors of each pixel point in the sample paper and the marking result to obtain a trained classifier.
8. An electronic device, including a memory and a processor, and a computer program capable of running on the processor is stored in the memory, characterized in that, when the processor executes the computer program, the method described in any one of claims 1-5 is implemented.
9. A computer-readable storage medium, on which a computer program is stored, characterized in that, when the computer program is run by a processor, the method described in any one of claims 1-5 is executed.
Citation Information
Patent Citations
Packaging flatness detection method and system, electronic equipment and storage medium
CN111161263A
Cited By
Paper defect detection method and system
CN120765547A
A method and system for detecting paper defects
CN120765547B