Continuous industrial product quality detection method and equipment and storage medium

By combining two template matching and gradient calculation methods, a defect image data set is formed, which solves the applicability and speed problems of traditional detection algorithms in industrial product defect detection, and achieves more efficient and accurate defect detection.

CN118761963APending Publication Date: 2024-10-11NANCHANG INST OF SCI & TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410768702.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Traditional industrial product defect detection algorithms have problems such as poor applicability, low accuracy and slow detection speed. They are particularly ineffective when faced with the detection of multiple error types and small target objects, and lack flexibility and efficiency.

Method used

Using a combination of two template matching methods, corner point calculation and image reduction are used for positioning, gradient calculation and clustering algorithms are combined to form a defect image data set, and the detection results are fused through a classifier to improve detection accuracy.

Benefits of technology

It improves the accuracy and speed of detection, enhances adaptability to new scenarios, solves the problems of edge detection and noise filtering with traditional methods, and achieves more efficient defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118761963A_ABST
    Figure CN118761963A_ABST
Patent Text Reader

Abstract

The invention relates to the field of defect detection, and provides a continuous industrial product quality detection method and device and a storage medium, the method reasonably distributes and uses template matching and machine learning technologies, and improves the efficiency and accuracy of defect detection; in addition, edge detection based on gradient is adopted, the problems of noise point filtering and defect reserving of a traditional edge detection method are solved, and the accuracy of edge detection is improved. Finally, automation of the training process is achieved, the efficiency of the training process is improved, and in general, the defect detection applicability is improved, the accuracy rate is low, and the detection speed is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of defect detection, and in particular to a continuous industrial product quality detection method, equipment and storage medium. Background Art

[0002] At present, visual inspection in artificial intelligence is applied to the detection, positioning and identification of the industrial product generation process. Different categories of industrial products require manual loading, clamping, unloading, sorting and transportation during the production and processing process. Coupled with subjective and objective reasons such as machine and equipment failure and personnel negligence, the quality of industrial products is often damaged to a certain extent. The most intuitive manifestation is defects on the product surface. Taking trademarks as an example, there are common errors such as color, missing prints, scratches, stains, and damage. Some errors are even difficult to detect with the human eye; quality problems on the product surface not only affect the product's performance and commercial value, but may also cause huge losses to users and even cause safety accidents.

[0003] In order to solve the above problems, defect detection methods based on machine learning have emerged in recent years. Traditional detection algorithms are generally based on target detection algorithms, template matching algorithms, similarity matching algorithms of color pixel feature points, and neural networks. Different algorithms will cause different problems in the actual industrial product inspection process.

[0004] Most quality detection algorithms based on target detection have the following problems: Problem ①: Traditional detection algorithms have limited defect samples and a wide variety of error types, which results in poor network training results. In addition, the algorithm lacks flexibility. If new error types appear or the application scenario changes, such as redesigning new labels or parts, the weight files need to be retrained.

[0005] Problem ②: Traditional detection algorithms have poor detection effects on small and densely packed targets, and the differences in errors themselves are difficult to define. For example, scratches can be divided into sparse strip scratches and dense circular scratches or irregular shapes. This makes it difficult for quality detection based on target detection to achieve the desired results.

[0006] Most quality detection algorithms based on template matching algorithms have the following problems: Question 1: This type of algorithm can find all defects, but because the algorithm has no learning ability, it cannot classify defects. Even if it can classify, the effect is far inferior to the traditional detection algorithm based on machine learning; Question ②: For each part of the original image, it is necessary to perform a similarity comparison calculation with the image to be detected from left to right and from top to bottom, which makes the simple template matching algorithm more time-consuming.

[0007] Question ③: The traditional template matching algorithm has poor speed performance in large images with high resolution. If the resolution is reduced, the matching effect will not be good. There is a contradiction between high precision requirements and high speed. Summary of the invention

[0008] The purpose of the present invention is to propose a continuous industrial product quality inspection method, equipment and storage medium to solve the technical problems of poor applicability, low accuracy and slow inspection speed existing in traditional defect detection algorithms.

[0009] The present invention provides a continuous industrial product quality detection method, which specifically comprises the following steps: S1, calculate the corner points of the continuous industrial product template image A, and save the area image B with the most dense corner points in image A; S2, obtain the continuous industrial product template image A and reduce it by K times to obtain the reduced template image A`; S3, obtaining a continuous industrial product image C to be inspected, and reducing it by K times to obtain a reduced image C' to be inspected; S4, performing a first template matching on the reduced image to be detected C' and the reduced template image A' to obtain a first template matching result D; the first template matching result D is the matching area of ​​the image A' in the image C'; S5, enlarge the coordinates of the first template matching result D by K times, and cut out the same area from the image C according to the coordinates of the upper left corner and the length and width of the enlarged D to obtain the image E; S6, first expand the image E outward by v pixels to obtain the image E'; based on the image E', crop the position of the area image B, and expand the cropped area again by v pixels to obtain the image F; where v is less than K; S7, performing a second template matching on the image F and the regional image B to obtain a second template matching result G; the second template matching result G is the region of the regional image B in the image F; S8, performing coordinate reverse restoration calculation in the image E' according to the second template matching result G, and cropping the final image H from the image E'; S9, subtracting the final image H from the continuous industrial product template image A to obtain a subtraction result I; S10, calculating the gradient of the subtraction result I, filtering it, and then clustering it through a clustering algorithm to obtain a defect map J; inputting the defect map J into a classifier to obtain a classification result; S11, collecting defect images J and organizing them into a training data set; using the training data set to train the detector to obtain a detection result; S12. The classification results and the detection results are unified and integrated in data format, and after deduplication, the final detection results are obtained.

[0010] A storage medium stores instructions and data for implementing a continuous industrial product quality detection method.

[0011] A continuous industrial product quality inspection device comprises: a processor and the storage medium; the processor loads and executes instructions and data in the storage medium to implement a continuous industrial product quality inspection method.

[0012] The beneficial effects provided by the present invention are: 1. The two template matching methods are adopted and combined to a certain extent, which solves the contradiction between speed and precision of traditional template matching and improves the accuracy and speed of template matching; 2. By introducing color components to calculate the gradient, the problem of traditional edge detection methods in filtering noise and retaining defects is solved, the accuracy of edge detection is improved, and accurate defect edges and their images are obtained; 3. The defect images obtained by secondary template matching and gradient-based methods are used to form a data set, which solves the problems of AI algorithms in terms of scarcity of defect samples and ability to adapt to new scenarios, and improves the adaptability and accuracy of AI algorithms; 4. The secondary defect detection fusion deduplication is adopted to improve the accuracy of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a schematic flow chart of the method of the present invention; Figure 2 It is a schematic diagram of the working of the hardware device of an embodiment of the present invention. DETAILED DESCRIPTION

[0014] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0015] Please refer to Figure 1 , Figure 1 : is a flow chart of the method of the present invention; the present invention provides a continuous industrial product quality detection method, the method specifically comprises the following steps: S1, calculate the corner points of the continuous industrial product template image A, and save the area image B with the most dense corner points; As an embodiment, the above corner point calculation is performed by using an improved Harris corner point detection method in the present invention.

[0016] Specifically, step S1 is as follows: S101, dividing the continuous industrial product template image A into a number of blocks of equal area, and performing corner point detection on each block; S102, each image is judged by the grayscale difference between the center point and the periphery. If it is greater than a threshold, it is considered that there may be a corner point, and all areas where there may be corner points are calculated; As an example, when performing step S22, the absolute value of the difference between the grayscale values ​​of the center point and a peripheral point is assumed to be Δ, and the threshold is t. If Δ<t, it is considered that the center point is similar to the peripheral points and cannot be a corner point. Otherwise, it may be a corner point (a pseudo corner point exists), wherein the value of t is generally between 25 and 40. S102: For the area selected in step S22, use the Sobel operator to calculate the vertical and horizontal gradients of the image. I x , I y ; S104, constructing a storage energy function I x × I x , I x × I y , I y × I y ; S105, using Gaussian filtering to perform weighted summation on the M matrix; S106, calculating by a CPF response value calculation formula, wherein P times the maximum value of the CPF is used as a judgment threshold; wherein P is a preset value; in the embodiment of the present invention, the value of P is 0.005 to 0.015; It should be noted that the above gradient I x , I y The matrix M is reflected in the energy function of the Harris algorithm. Unlike the Moravec operator which only considers the horizontal and vertical directions, Harris considers the rotation invariance of the corner points and introduces multiple directions based on Moravec's formula. The specific formula is as follows: The function E ( u , v ) u , v Represents the vertical and horizontal offsets respectively. x , y To calculate the horizontal and vertical coordinates of the center of the corner window, w ( x , y ) Multiply each pixel difference by a weight;I The function represents the gray value at this coordinate. I Subscript x , y represent I right x , y The partial derivative of .

[0017] The present invention has improved this, and the calculation formula of the CPF response value in step S106 is as follows:

[0018] in,

[0019]

[0020] Where N is the area of ​​several blocks of the same area into which the continuous industrial product template image A is divided. For example, if a 3*3 sliding window is used, N is equal to 3*3=9. The above method can reduce the amount of calculation by pre-screening by 90%, and the calculation time is shortened to 29.1% of the original, which greatly improves the calculation efficiency.

[0021] S107, judging whether it is a true corner point by judging the threshold, and calculating which area has the most corner points and outputting the image of the area as the area image B with the most dense corner points.

[0022] S2, obtain the continuous industrial product template image A and reduce it by K times to obtain the reduced template image A`; As an embodiment, the present invention reduces the product label image taken by an industrial camera (25 million network port color array industrial camera) by 5 times before formal processing. Scaling the image can effectively reduce the computational complexity of feature extraction and make the corner point information of the image more obvious and easier to detect in the subsequent sequence.

[0023] It should be noted that the mathematical relationship between corner detection effect and image scaling is roughly as follows:

[0024] J ( x ) represents the detection effect of corner points, x It represents the scale size. This formula shows that when 0< x When the image is smaller than 1, the effect will first increase to the best state and then slowly decrease, reaching the best state at about 0.5. 1, that is, when the image is enlarged, the effect is slowly decreasing. Therefore, as an embodiment, the dimensionality reduction in the present application is generally based on the standard of reducing to 0.5. Of course, other standards can also be adopted according to other different situations, and there is no need to specifically limit it in the present application.

[0025] S3, obtaining a continuous industrial product image C to be inspected, and reducing it by K times to obtain a reduced image C' to be inspected; S4, performing a first template matching on the reduced image to be detected C' and the reduced template image A' to obtain a first template matching result D; the first template matching result D is the matching area of ​​the image A' in the image C'; S5, enlarge the coordinates of the first template matching result D by K times, and cut out the same area from the image C according to the coordinates of the upper left corner and the length and width of the enlarged D to obtain the image E; S6, first expand the image E outward by v pixels to obtain the image E'; based on the image E', crop the position of the area image B, and expand the cropped area again by v pixels to obtain the image F; where v is less than K; S7, performing a second template matching on the image F and the regional image B to obtain a second template matching result G; the second template matching result G is the region of the regional image B in the image F; S8, performing coordinate reverse restoration calculation in the image E' according to the second template matching result G, and cropping the final image H from the image E'; It should be noted that the first template matching and the second template matching both adopt the square difference matching method.

[0026] In the present invention, the input image is processed for image positioning. Since the obtained image information is complex and irrelevant background information is likely to affect the target information, the detection is difficult and prone to errors. Therefore, the method of positioning first and then cutting is adopted.

[0027] The template matching algorithm is used for image positioning. The advantages of template matching are that it is easy to implement, is not affected by the scale factor error, and has strong anti-interference and anti-noise capabilities: There are many matching methods for template matching algorithms. This time we use the square difference matching method, the formula is:

[0028] R ( x , y ) represents the matching result matrix, in which each element represents the matching degree between the template and the original image at that position. T ( x ′,y′ ) represents the template image, I (x , y ) represents the original image. x 'and y ′ is the coordinate in the template image, and ( x + x ')and( y + y ′) is the coordinate of the position corresponding to the template in the original image.

[0029] This method matches by calculating the sum of squares of the difference between the template and the original image at each position. When the template and the sliding window match completely, the calculated value is 0. The lower the match between the two, the larger the calculated value.

[0030] S9, subtracting the final image H from the continuous industrial product template image A to obtain a subtraction result I; S10, calculating the gradient of the subtraction result I, filtering it, and then clustering it through a clustering algorithm to obtain a defect map J; inputting the defect map J into a classifier to obtain a classification result; It should be noted that step S10 is specifically as follows: Step S10 is specifically as follows: S101, graying the subtraction result I and calculating the gradient; The image gradient calculation method will affect the subsequent matching efficiency and accuracy, so it is necessary to find a good gradient calculation method.

[0031] On the other hand, image smoothing is also conducive to producing better gradient features, because the smoothing operation can suppress, weaken or eliminate the details, mutations, edges and noise in the image, which is more conducive to the gradient accurately showing the edge of the object.

[0032] The best results were obtained using a mean smoothing mask of size 7×7.

[0033] The reason why Gaussian smoothing is not as good as mean smoothing may be that it is a weighted fuzzy method. In the present invention, a mean smoothing template is used to grayscale the subtraction result H and prepare for subsequent gradient calculation.

[0034] For the gradient calculation of the image, in order to enhance the robustness of the gradient eigenvalue, the present invention takes into account each color component of the image, and makes the gradient at a certain point of the image equal to the color gradient component with the largest amplitude. Therefore, the gradient representation method of the present invention is: the gradient at any point in the subtraction result H is equal to the color gradient component with the largest amplitude.

[0035] Specifically, for the subtraction result H, any point ( i , j ) The gradient is expressed as:

[0036] in P x , P y and M Respectively represent points ( i , j )exist x , y Directional gradient, as well as magnitude; c is a point ( i , j ), that is:

[0037] In the formula, R, G, and B represent ( i , j ), C represents the color component, and M′ represents the gradient amplitude of each color component, that is: .

[0038] S102, filtering the calculated gradients that are lower than a preset threshold to obtain a filtered image; S103, calculating the connected domains in the filtered image, and removing the connected domains whose areas are lower than a preset value, to obtain a filtered image; It should be noted that, in order to eliminate noise and impurities, the present invention sets a threshold for each channel to filter out all darker areas. At this point, only defects and a small amount of noise remain in the image. Next, a clustering algorithm can be used to calculate the location and range of the defects and frame them.

[0039] S104, inputting the filtered image into a clustering algorithm for clustering to obtain a defect map J; In the present invention, clustering uses the DBSCAN clustering algorithm for defect detection. The basic idea of ​​the DBSCAN clustering algorithm is to divide data points into different clusters according to their neighboring point sets, and by setting the neighboring distance, it is possible to detect large defects and small defects. The advantage of the DBSCAN clustering algorithm is that it does not require the number of clusters to be specified in advance, nor does it require the shape of the cluster to be assumed, and it can process clusters of any shape.

[0040] The main idea of ​​the DBSCAN clustering algorithm is: For each data point, calculate how many data points are within its proximity. If it exceeds a given threshold, the data point is called a core point.

[0041] For each core point, find all its data points that reach the threshold, that is, the data points that can be reached from the core point through a series of core points, and classify them into the same cluster.

[0042] For data points that do not belong to any cluster, they are marked as noise points.

[0043] For each cluster, a box is drawn to visualize the defect detection.

[0044] At this time, the defects on the image are framed after clustering, and defect map J is obtained; S105, input the defect image J into the classifier to obtain a classification result; As an embodiment, the classifier described in the present invention adopts a CNN classification model. The defect image I is input into the CNN classification model to obtain a classification result; S11, collecting defect images J and organizing them into a training data set; using the training data set to train the detector to obtain a detection result; As an embodiment, the present invention collects and processes the defect map J, automatically annotates it according to the results of DBSCAN, and makes a data set to input it into the detector.

[0045] In the present invention, the detector adopts the YOLOv8 model, trains the YOLOv8 model using the data set, and finally obtains the detection result using the YOLOv8 model.

[0046] The training process of the present invention adopts an automated process. In the automated training process, the defect image generated in step S11 is firstly obtained, and then the coordinates of the classified defects are extracted. These coordinate information are stored in a format such as XML or JSON. The data set contains the following information: Image metadata such as file name, size, number of channels, etc. Information such as the number, category, and location (bounding box coordinates) of defects in each image In this way, we have automated the labeling process and avoided the manual labeling method of traditional AI training. Finally, the processed data is incorporated into the training set, ready for AI training.

[0047] Next, the YOLOv8 algorithm is used for detection and classification. YOLOv8 is a fast and efficient target detection and classification algorithm that can detect the categories and locations of multiple objects in a picture at the same time. We input the detection picture into the YOLOv8 algorithm and obtain a tensor containing the object category and location information. Then, according to the output results of the algorithm, defects of different categories or levels are marked with different colors, and a rectangular box is drawn on each defect to indicate the category and range of the defect.

[0048] In general, the method of the present invention combines automation and precision together, making target detection more accurate and stable, not only reducing the workload of manual labeling, but also improving the efficiency and accuracy of target detection.

[0049] S12. The classification results and the detection results are unified and integrated in data format, and after deduplication, the final detection results are obtained.

[0050] It should be noted that in the above embodiments of the present invention, it is first necessary to understand the output formats of these two algorithms: DBSCAN: The main output of the DBSCAN algorithm is a label array, where each element represents the label of the cluster to which the corresponding data point belongs.

[0051] In this array, all data points in the same cluster have the same label, data points in different clusters have different labels, and the label of noise points is -1.

[0052] Suppose there is a data set D, containing n data points: D={p1,p2,...,pn}. After running the DBSCAN algorithm, a label array C of length n will be obtained: C={c1,c2,...,cn}. Among them, ci is the cluster label of data point pi.

[0053] This label array C is the main output of the DBSCAN algorithm. Through this array, we can know which cluster each data point belongs to, or whether it is a noise point.

[0054] YOLOv8: The output of the YOLOv8 algorithm is a list containing the bounding box coordinates, category, and confidence of the detected objects.

[0055] To fuse the output of DBSCAN into the output of YOLOv8, the following steps can be taken: Convert DBSCAN output: First, you need to convert the output of DBSCAN (i.e., the cluster label array) into a format compatible with YOLOv8 output. Suppose there is a data point pi, whose cluster label in the DBSCAN output is ci, this label can be converted into a bounding box whose coordinates are the coordinates of the data point pi, the category is ci, and the confidence is 1.

[0056] In this way, a new bounding box list is obtained, in which each element contains the coordinates, category and confidence of the bounding box.

[0057] Matching YOLOv8 output: For each bounding box in the YOLOv8 output, we can find all the DBSCAN data points contained in it and assign the cluster labels of these data points to the bounding box. Specifically, if a YOLOv8 bounding box contains multiple DBSCAN data points, we can select the cluster label with the largest number as the category of the bounding box.

[0058] Fusion results: Finally, a new output list is obtained, in which each element contains the coordinates, category, confidence, and corresponding cluster label of the bounding box. This new output list is the result of the fusion of DBSCAN and YOLOv8 outputs.

[0059] Deduplication: After obtaining the fusion result, deduplication needs to be performed. Specifically, if the ranges of two bounding boxes are similar (for example, their intersection-over-union ratio exceeds a preset threshold), only one of them can be retained.

[0060] This step can avoid duplicate or highly overlapping bounding boxes in the final output.

[0061] In the deduplication step, the intersection over union (IoU) of two bounding boxes is mainly calculated to determine whether they overlap.

[0062] The intersection over union (IoU) is the ratio of the intersection area of ​​two bounding boxes to the union area. Specifically, assuming we have two bounding boxes B1 and B2, their intersection over union (IoU) (B1, B2) can be calculated using the following formula:

[0063] in, Area(B1∩B2) yes B1 and B2 The intersection area of Area(B1∪B2) yes B1 and B2 The union area of ​​.

[0064] Then, set a threshold θ if IoU(B1,B2)>θ , then we think B1 and B2 Overlapping, deduplication is required.

[0065] There are many ways to perform the deduplication operation, such as retaining only bounding boxes with higher confidence or merging two bounding boxes into a new bounding box.

[0066] Finally, the clustering results of DBSCAN are fused into the target detection results of YOLOv8, thus realizing the fusion of the results of the two algorithms.

[0067] At this point, the automated training of YOLOV8 and the fusion of the results of the two algorithms have been realized, thus achieving the goal of full automation, greatly saving labor costs, and effectively classifying defects on the product surface and giving information on the number and category of defects.

[0068] After multiple experiments, the experimental results of the method of the present application are shown in Table 1 below, which compares the performance of the method of the present application with other methods in terms of speed, accuracy, etc.

[0069] It can be seen that the method of the present invention has shown obvious advantages in all aspects.

[0070] Table 1 Comparison between the present invention and other methods

[0071] Please refer to Figure 2 , Figure 2 4 is a schematic diagram of the working of the hardware device of an embodiment of the present invention, wherein the hardware device specifically comprises: a continuous industrial product quality inspection device 401, a processor 402 and a storage medium 403.

[0072] A continuous industrial product quality inspection device 401: The continuous industrial product quality inspection device 401 implements the continuous industrial product quality inspection method.

[0073] Processor 402: The processor 402 loads and executes the instructions and data in the storage medium 403 to implement the continuous industrial product quality detection method.

[0074] Storage medium 403: The storage medium 403 stores instructions and data; the storage medium 403 is used to implement the continuous industrial product quality detection method.

[0075] In summary, the beneficial effects of the present invention are: 1. The two template matching methods are adopted and combined to a certain extent, which solves the contradiction between speed and precision of traditional template matching and improves the accuracy and speed of template matching; 2. By introducing color components to calculate the gradient, the problem of traditional edge detection methods in filtering noise and retaining defects is solved, the accuracy of edge detection is improved, and accurate defect edges and their images are obtained; 3. The defect images obtained by secondary template matching and gradient-based methods are used to form a data set, which solves the problems of AI algorithms in terms of scarcity of defect samples and ability to adapt to new scenarios, and improves the adaptability and accuracy of AI algorithms; 4. The secondary defect detection fusion deduplication is adopted to improve the accuracy of defect detection.

[0076] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for continuous industrial product quality detection, Features: The following steps are involved: S1, calculate the corner points of the continuous industrial product template image A, and save the area image B with the most dense corner points in image A; S2, obtain the continuous industrial product template image A and reduce it by K times to obtain the reduced template image A`; S3, obtaining a continuous industrial product image C to be inspected, and reducing it by K times to obtain a reduced image C' to be inspected; S4, performing a first template matching on the reduced image to be detected C' and the reduced template image A' to obtain a first template matching result D; the first template matching result D is the matching area of ​​the image A' in the image C'; S5, enlarge the coordinates of the first template matching result D by K times, and cut out the same area from the image C according to the coordinates of the upper left corner and the length and width of the enlarged D to obtain the image E; S6, first expand the image E outward by v pixels to obtain the image E'; based on the image E', crop the position of the area image B, and expand the cropped area again by v pixels to obtain the image F; where v is less than K; S7, performing a second template matching on the image F and the regional image B to obtain a second template matching result G; the second template matching result G is the region of the regional image B in the image F; S8, performing coordinate reverse restoration calculation in the image E' according to the second template matching result G, and cropping the final image H from the image E'; S9, subtracting the final image H from the continuous industrial product template image A to obtain a subtraction result I; S10, calculating the gradient of the subtraction result I, filtering it, and then clustering it through a clustering algorithm to obtain a defect map J; Input the defect image J into the classifier to obtain the classification result; S11, collecting defect images J and arranging them into a training data set; Use the training data set to train the detector and obtain the detection results; S12. The classification results and the detection results are unified and integrated in data format, and after deduplication, the final detection results are obtained.

2. A continuous industrial product quality detection method as claimed in claim 1, Features: Step S1 is specifically as follows: S101, dividing the continuous industrial product template image A into a number of blocks of equal area, and performing corner point detection on each block; S102, each image is judged by the grayscale difference between the center point and the periphery. If it is greater than a threshold, it is considered that there may be a corner point, and all areas where there may be corner points are calculated; S103: For the area selected in step S102, use the Sobel operator to calculate the vertical and horizontal gradients of the image. I x , I y ; S104, constructing a storage energy function I x × I x , I x × I y , I y × I y ; S105, using Gaussian filtering to perform weighted summation on the M matrix; S106, calculating by the CPF response value calculation formula, wherein P times the maximum value of the CPF is used as the judgment threshold; wherein P is a preset value; S107, judging whether it is a true corner point by judging the threshold, and calculating which area has the most corner points and outputting the image of the area as the area image B with the densest corner points.

3. A continuous industrial product quality detection method as claimed in claim 2, Features: The calculation formula of the CPF response value in step S106 is as follows: , in, , ,function E ( u , v ) u , v Represents the vertical and horizontal offsets respectively. x , y To calculate the horizontal and vertical coordinates of the center of the corner window, w ( x , y ) Multiply each pixel difference by a weight; I The function represents the gray value at this coordinate. I Subscript x , y represent I right x , y The partial derivative of N is the area of ​​several blocks of the same area into which the continuous industrial product template image A is divided.

4. A continuous industrial product quality detection method as claimed in claim 1, Features: Step S10 is specifically as follows: S101, graying the subtraction result I and calculating the gradient; S102, filtering the calculated gradients that are lower than a preset threshold to obtain a filtered image; S103, calculating the connected domains in the filtered image, and removing the connected domains whose areas are lower than a preset value, to obtain a filtered image; S104, inputting the filtered image into a clustering algorithm for clustering to obtain a defect map J; S105, input the defect image J into the classifier to obtain the classification result.

5. A continuous industrial product quality detection method as claimed in claim 4, Features: In step S101, the gradient is expressed as follows: the gradient at any point in the subtraction result I is equal to the color gradient component with the largest amplitude.

6. A method for continuous industrial product quality inspection as claimed in claim 5, Features: The calculation process of the color gradient component with the largest amplitude is as follows: For any point ( i , j ), its gradient is expressed as: , in P x , P y and M Respectively represent points ( i , j )exist x , y Directional gradient, as well as magnitude; c is a point ( i , j ), that is: , In the formula, R, G, and B represent ( i , j ), C represents the color component, and M′ represents the gradient amplitude of each color component, that is: 。 7. A storage medium, Features: The storage medium stores instructions and data for implementing a continuous industrial product quality detection method as described in any one of claims 1 to 6.

8. A continuous industrial product quality inspection device, Features: include: A processor and a storage medium; the processor loads and executes instructions and data in the storage medium to implement a continuous industrial product quality detection method as described in any one of claims 1 to 6.