Ceramic glaze detection method and system based on image processing and grading classifier
By using image processing and grading classifier methods in ceramic glaze detection, combined with dynamic background suppression and adaptive filtering technology, the problem of poor detection defect performance in high noise and high reflective environments is solved, and high accuracy and real-time detection of ceramic glaze defects is achieved.
Patent Information
- Application Number
- CN202411818377.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-04
AI Technical Summary
The prior art has poor performance in detecting ceramic glaze defects in high noise and high reflective environments, and cannot adapt to high reflective surfaces and complex texture environments, resulting in limited detection accuracy and real-time performance.
Using detection methods based on image processing and grading classifiers, high-resolution image data is collected through color line array CCD sensors, and combined with dynamic background suppression, adaptive filtering and precise classification technology, accurate detection of glaze defects of high-reflective ceramics is achieved.
In high noise and high reflective environments, the accuracy and real-time detection of ceramic glaze defects is significantly improved, and the working efficiency and accuracy of ceramic production quality and production process control are improved.
Smart Images

Figure CN119757354A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing and analysis, and in particular to a ceramic glaze detection method and system based on image processing and a hierarchical classifier. Background Art
[0002] With the continuous development of modern industry, the demand for ceramic products has gradually increased, and customers' requirements for product quality have also gradually increased. Therefore, the quality inspection of ceramic glaze has become a key link in ensuring product quality. At the same time, the quality of ceramic glaze is also of great significance for evaluating the beauty and commodity value of ceramic utensils. In the production process of ceramic utensils, due to the production environment, production process and raw materials, various defects are prone to occur on the ceramic glaze. Glaze defects not only affect the artistic value and beauty of ceramic devices, but may also lead to a decrease in mechanical properties, durability and service life. Especially in the high-end ceramic market, these surface defects have a great negative impact on the market value of the product. Therefore, how to efficiently and accurately detect ceramic glaze defects has become a problem that needs to be solved urgently in the ceramic industry.
[0003] A lightweight cloth defect detection method that can be deployed in embedded devices with application number CN202310142953.0. A lightweight target detection network model is constructed based on the YOLOv7 target detection network, and the MobileNetv3 structure is used as the backbone network of the YOLOv7 target detection network. The 3×3 convolution part in the ELAN structure of the YOLOv7 target detection network is replaced with a convolution layer with channel shuffle in the ShuffleNetv2 structure, and an ECA channel attention mechanism is added after each ELAN structure, and the SPPCSPC module is replaced with a GhostSPPCSPC module, that is, the ordinary convolution in the SPPCSPC module is replaced with a Ghost convolution; the lightweight target detection network model is trained for multiple rounds through a data set to obtain the optimal lightweight target detection network model; the tested cloth image is input into the optimal lightweight target detection network model for defect detection. However, the invention adopts the improved YOLO algorithm, which has high computing resource requirements, requires large-scale training data, has large delays, is limited by the deep learning reasoning speed, and general target detection. It needs to be adjusted to adapt to industrial scenarios, cannot adapt to high reflectivity and complex textures, relies on deep learning models, has poor adaptability to noise, is high cost, and relies on training and high-performance hardware.
[0004] An ultra-lightweight cloth defect detection algorithm with application number CN202410556548.8. It includes collecting defective cloth images, normalizing them and inputting them into the UL-UNet network to generate defect prediction masks, thereby outputting fabric defect detection images with defect locations and types. The UL-Net network adopts a U-shaped symmetrical structure based on the UNet network. In the encoder, the improved inverted residual module is stacked as the backbone network. At the end of the backbone network, the Non-local module is introduced; in the decoder, the SE attention mechanism is introduced as the channel attention after each convolution module; in the jump connection, the PPAG module is used. The model of this invention greatly reduces the model parameters and improves the model detection speed. While meeting the real-time performance required for cloth defect detection, it significantly reduces the enterprise's requirements for hardware configuration. However, the deep learning framework has a strong dependence on large-scale data and high-performance computing hardware. In a resource-constrained environment, there is a computing bottleneck; the area array CCD and high pixel resolution lead to limited real-time performance, and high noise and high reflective environments reduce model performance. Summary of the invention
[0005] The purpose of the present invention is to provide a ceramic glaze detection method and system based on image processing and hierarchical classifier, which can solve the problems of high noise and high reflective environment reducing model performance in the prior art, adapt to high reflective surfaces and complex texture environments, and help improve the work efficiency and accuracy in ceramic production quality and production process control.
[0006] To achieve the above object, the present invention provides a ceramic glaze detection method and system based on image processing and hierarchical classifier, comprising the following steps:
[0007] S1, scanning the ceramic glaze surface line by line through a color linear array CCD sensor to collect high-resolution RGB image data;
[0008] S2, preprocessing the RGB image data collected in the above step S1 to identify potential defect areas;
[0009] S3, preliminarily classify the potential defect areas identified by S2 and screen suspected defect areas;
[0010] S4, finely classifying the suspected defect area output in step S3;
[0011] S5, marking the defective area in real time according to the classification result of S4;
[0012] S6. The inspection results including defect location, type and quantity are transmitted to the host computer via Ethernet for real-time display and recording.
[0013] Preferably, the specific process of image preprocessing in S2 is as follows:
[0014] S21. The process of removing background noise caused by uneven illumination in RGB image data by dynamic background suppression technology, highlighting the features of defective areas and calculating the background light intensity of local areas is as follows:
[0015]
[0016] Among them, I background is the background light intensity in the local area, Mean is the mean of the pixel values in the calculated area, and I is the pixel value of the image at that position.
[0017] S22, the process of removing the background light intensity in the RGB image data and enhancing the contrast of the defective area is as follows:
[0018] I corrected (x, y) = I (x, y) - I background (x, y); (2)
[0019] Among them, Ic irrected It is the pixel value of the image at that location after background suppression processing.
[0020] S22. Adaptive filtering technology is used to remove random noise in RGB image data while retaining edges and details. The filtering parameters are dynamically adjusted according to the local characteristics of the image. A larger filtering window is used for high-noise areas, and a smaller filtering window is used for areas with rich textures. Bilateral filtering or guided filtering is used to retain edge details. The process is as follows:
[0021]
[0022] Among them, I filterrd is the pixel value of the image at that location after being processed by the filter, w i,j is the weight associated with spatial distance and grayscale difference;
[0023] S23, highlight the boundary features of the defect through edge detection technology, use the Canny edge detection algorithm and apply Gaussian filtering to smooth the image, calculate the gradient intensity and suppress the non-maximum value, set high and low thresholds, and extract the edge to clarify the contour information of the defect;
[0024] S24. Image enhancement technology is used to improve the visibility of defective areas for highlighting contrast. Contrast stretching is used to map the pixel grayscale value to a wider range. The calculation process for improving contrast is as follows:
[0025]
[0026] Among them, I enhanced is the pixel value of the enhanced image at that location, I minis the minimum value of all pixel values in the image, I max is the maximum value of all pixels in the image.
[0027] S25, combining color space conversion technology to convert RGB images into Lab color space to extract specific channels;
[0028] S26. Extract the area where the defect may exist according to the ROI, use the connectivity analysis method to extract the significant area, screen the characteristics such as the area size and shape, and exclude the background and irrelevant areas.
[0029] Preferably, the specific process of performing preliminary classification on the identified defective area in S3 is as follows:
[0030] S31, extracting ROI feature values, calculating texture features and color features for each extracted ROI feature value, and generating a feature vector for use by the classifier;
[0031] S32, using the support vector machine (SVM) classifier for fast classification, training the SVM model, using the Gaussian kernel to handle nonlinear problems, and classifying each ROI feature vector through the SVM model;
[0032] S33, marking the ROI feature vector classified as suspected defects as a key processing area, and passing it to the next step of fine classification module.
[0033] Preferably, the feature vector generation process in S31 is as follows:
[0034] S311, extracting texture features based on the gray-level co-occurrence matrix GLCM, converting the ROI into a grayscale image, defining the grayscale range and spatial relationship of pixels, and calculating the gray-level co-occurrence matrix P(i, j), which represents the co-occurrence probability of pixel pairs with grayscale values i and j at a given distance and direction;
[0035] S312, extract color features, calculate the color distribution histogram of ROI on RGB channels, obtain statistical features such as the mean, standard deviation, and skewness of each channel, and obtain the difference between RGB channels.
[0036] S313, combining the extracted texture features and color features into a feature vector in order.
[0037] Preferably, the process of calculating texture features by gray level co-occurrence matrix in S311 is as follows:
[0038] Calculate the contrast to measure the grayscale difference between pixels:
[0039]
[0040] Calculate entropy to measure the complexity of the texture Entropy:
[0041]
[0042] Calculate the energy to measure the uniformity of grayscale distribution Energy:
[0043]
[0044] Calculate the correlation to measure the linear relationship between gray levels Correction:
[0045]
[0046] Where N is the total number of gray levels in the image, the gray value ranges from 0 to 255, μ i , μ j are the mean values of gray levels i and j, σ i , σ j is the standard deviation.
[0047] Preferably, the process of extracting color features in S312 to obtain the difference between RGB channels is as follows:
[0048] Calculate the color mean μ color The formula is as follows:
[0049]
[0050] Among them, C k is the color value of the kth pixel in the image, and n is the total number of pixels in the image;
[0051] Calculate the color standard deviation σ color The formula is as follows:
[0052]
[0053] Calculate the color skewness S color The formula is as follows:
[0054]
[0055] The method for calculating the difference between RGB channels is as follows: calculate the absolute value of the difference between the mean, standard deviation and skewness of any two channels among the three channels of R, G, and B.
[0056] Preferably, if the absolute value of the difference between the mean, standard deviation and skewness of any two of the three channels R, G, and B is larger, it means that the difference between the two color channels is larger, which usually represents an area with obvious color difference, boundary or defect; if the absolute value of the difference between the mean, standard deviation and skewness of any two of the three channels R, G, and B is smaller, it means that the difference between the two color channels is smaller, which usually represents a uniform color area.
[0057] Preferably, the specific process of finely classifying the identified defective area in S4 is as follows:
[0058] S41, pre-process the defect area data identified in S3, crop and normalize each pixel value before the ROI is input into the lightweight CNN model:
[0059]
[0060] Among them, I normalized is the pixel value of the normalized image at that location, μ is the global mean, and σ is the standard deviation;
[0061] S42. Use a lightweight convolutional neural network (CNN) to classify the preprocessed ROI and output the defect type and confidence level;
[0062] S43, performing confidence screening, if the maximum confidence of the model output is higher than the threshold, it is marked as a "determined area, and for each defect area marked as a "determined area", the center coordinates of the ROI are calculated;
[0063]
[0064] Among them, Center x 、Center y is the center coordinate of ROI, (x i ,y i ) is the position of each pixel in the ROI, and N is the total number of pixels in the ROI;
[0065] If the maximum confidence level of the model output is lower than the threshold, it is marked as an "uncertain area", and the defect category and the center coordinates of the ROI are transmitted to the host computer to form a detection report.
[0066] Preferably, the lightweight convolutional neural network CNN in S42 includes an input layer, a convolution layer, a pooling layer and a classification layer. The input size of the input layer is the size of the RGB image. The convolution layer uses a depth-separable convolution to extract features. The formula is as follows:
[0067] Y=X×K depthwise ×K pointwise ; (14)
[0068] Among them, K depthwise is the deep convolution kernel, processed separately by channel. Y is the output feature map, usually the result of deep separable convolution processing. X is the input feature map, usually image data. K pointwiseIt is a point-by-point convolution kernel that uses 1×1 convolution to fuse features. The pooling layer uses global average pooling instead of the fully connected layer. The classification layer uses the softmax activation function to output the probability distribution of the defect type. The classification reasoning inputs each preprocessed ROI into the lightweight CNN model, extracts local features in the convolution layer, reduces the size of the feature map in the pooling layer, and performs classification in the fully connected layer. The model outputs the probability distribution of each defect type, and takes the category with the highest probability as the classification result.
[0069] A ceramic glaze detection system based on image processing and hierarchical classifier includes a color linear array CCD sensor, a DC motor, a non-contact polarizer, a multi-angle linear array LED light source, an image preprocessing module, a classification module, an automatic marking module, a communication module, and a host computer.
[0070] Preferably, the angle and brightness adjustment settings of the multi-angle linear array LED light source are set to a custom setting mode; the polarization angle of the non-contact polarizer is set to a dynamic adjustment mode.
[0071] Therefore, the present invention adopts a ceramic glaze detection method and system based on image processing and hierarchical classifier, which has the following beneficial effects compared with the prior art:
[0072] 1. It integrates knowledge from multiple fields such as optical optimization, image processing algorithms, hardware platform design, hierarchical classification technology, and automated control to effectively solve problems such as limited real-time performance and high noise and high reflective environments that reduce model performance.
[0073] 2. During the detection process, dynamic background suppression, adaptive filtering and precise classification are used to ensure accurate detection of highly reflective ceramic glaze defects, and real-time marking and result output are achieved, thereby improving the accuracy and stability of detection.
[0074] 3. This method helps to improve the quality of ceramic production and the work efficiency and accuracy in production process control, while promoting the widespread application of intelligent detection technology in the fields of industrial automation and visual inspection.
[0075] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 It is an implementation flow chart of a ceramic glaze defect detection method based on image processing and hierarchical classifier of the present invention;
[0077] Figure 2 This is a flowchart for implementing image preprocessing of a ceramic glaze defect detection method based on image processing and hierarchical classifier of the present invention;
[0078] Figure 3It is an operation flow chart of a primary classifier of a ceramic glaze defect detection method based on image processing and hierarchical classifier of the present invention;
[0079] Figure 4 It is an operation flow chart of a fine classifier of a ceramic glaze defect detection method based on image processing and hierarchical classifier of the present invention;
[0080] Figure 5 A schematic diagram of a ceramic glaze defect detection system based on image processing and hierarchical classifier according to the present invention;
[0081] Reference numerals
[0082] 1. DC motor; 2. Ceramic glaze; 3. Non-contact polarizer; 4. Optical lens; 5. Multi-angle linear array LED light source; 6. Color linear array CCD; 7. Image preprocessing module; 8. Classification module; 9. Automatic marking module; 10. Communication module; 11. Host computer. DETAILED DESCRIPTION
[0083] Example
[0084] In the description of the present invention, it should be noted that the terms "upper", "lower", "inside", "outside", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, or are directions or positional relationships in which the product of the invention is usually placed when in use. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0085] like Figure 1-Figure 4 As shown, a ceramic glaze detection method based on image processing and hierarchical classifier of the present invention comprises the following steps:
[0086] S1. Scan the ceramic glaze surface line by line through a color linear array CCD sensor to collect high-resolution RGB image data; to avoid imaging distortion caused by surface reflection, a non-contact polarizer combined with a multi-angle LED light source is used to evenly illuminate the ceramic glaze surface and suppress specular reflection light;
[0087] S2, preprocessing the RGB image data collected in the above step S1 to identify potential defect areas; data preprocessing effectively removes the influence of light and noise and enhances the edge details of the defect;
[0088] S21. The process of removing background noise caused by uneven illumination in RGB image data by dynamic background suppression technology, highlighting the features of defective areas and calculating the background light intensity of local areas is as follows:
[0089]
[0090] Among them, I background is the background light intensity in the local area, Mean is the mean of the pixel values in the calculated area, and I is the pixel value of the image at that position.
[0091] S22, removing the background light intensity in the RGB image data, enhancing the contrast of the defect area, and reducing the interference of light changes on detection. The process of enhancing the contrast of the defect area is as follows:
[0092] I corrected (x, y) = I (x, y) - I background (x, y); (2)
[0093] Among them, I cirrected It is the pixel value of the image at that location after background suppression processing.
[0094] S22. Adaptive filtering technology is used to remove random noise in RGB image data while retaining edges and details. The filtering parameters are dynamically adjusted according to the local characteristics of the image. A larger filtering window is used for high-noise areas, and a smaller filtering window is used for areas with rich textures. Bilateral filtering or guided filtering is used to retain edge details. The process is as follows:
[0095]
[0096] Among them, I filterrd is the pixel value of the image at that location after being processed by the filter, w i,j is the weight associated with spatial distance and grayscale difference;
[0097] S23, highlight the boundary features of the defect through edge detection technology, use the Canny edge detection algorithm and apply Gaussian filtering to smooth the image, calculate the gradient intensity and suppress the non-maximum value, set high and low thresholds, and extract the edge to clarify the contour information of the defect;
[0098] S24. Apply image enhancement technology to enhance the visibility of defective areas and highlight the contrast. Use contrast stretching to map the pixel grayscale value to a wider range to enhance the visibility of defective areas. Highlight the contrast and use contrast stretching to map the pixel grayscale value to a wider range to enhance the contrast. The contrast enhancement calculation process is as follows:
[0099]
[0100] Among them, I enhanced is the pixel value of the enhanced image at that location, I min is the minimum value of all pixel values in the image, I max is the maximum value of all pixels in the image.
[0101] S25, combining color space conversion technology to convert the RGB image into Lab color space to extract specific channels;
[0102] S26. Extract the area where the defect may exist according to the ROI, use the connectivity analysis method to extract the significant area, screen the characteristics such as the area size and shape, and exclude the background and irrelevant areas;
[0103] S3, preliminarily classify the potential defect areas identified by S2 and screen suspected defect areas;
[0104] S31, extracting ROI feature values, calculating texture features and color features for each extracted ROI feature value, and generating a feature vector for use by the classifier;
[0105] S311, extracting texture features based on the gray-level co-occurrence matrix GLCM, converting the ROI into a grayscale image, defining the grayscale range and spatial relationship of pixels, and calculating the gray-level co-occurrence matrix P(i, j), which represents the co-occurrence probability of pixel pairs with grayscale values i and j at a given distance and direction;
[0106] Calculate the contrast to measure the grayscale difference between pixels:
[0107]
[0108] Calculate entropy to measure the complexity of the texture Entropy:
[0109]
[0110] Calculate the energy to measure the uniformity of grayscale distribution Energy:
[0111]
[0112] Calculate the correlation to measure the linear relationship between gray levels Correction:
[0113]
[0114] Where N is the total number of gray levels in the image, the gray value ranges from 0 to 255, μ i , μ j are the mean values of gray levels i and j, σ i , σ j is the standard deviation;
[0115] S312, extract color features, calculate the color distribution histogram of ROI on the RGB channel, obtain the statistical features such as the mean, standard deviation, and skewness of each channel, and obtain the difference between the RGB channels:
[0116] Calculate the color mean μ colorThe formula is as follows:
[0117]
[0118] Among them, C k is the color value of the kth pixel in the image, and n is the total number of pixels in the image ′
[0119] Calculate the color standard deviation σ color The formula is as follows:
[0120]
[0121] Calculate the color skewness S color The formula is as follows:
[0122]
[0123] The method for calculating the difference between RGB channels is as follows: calculate the absolute value of the difference between the mean, standard deviation and skewness of any two of the three channels R, G, and B; if the absolute value of the difference between the mean, standard deviation and skewness of any two of the three channels R, G, and B is larger, it means that the difference between the two color channels is larger, usually indicating obvious color difference, boundaries or defective areas; if the absolute value of the difference between the mean, standard deviation and skewness of any two of the three channels R, G, and B is smaller, it means that the difference between the two color channels is smaller, usually indicating a uniform color area;
[0124] S313, combining the extracted texture features and color features into a feature vector in order;
[0125] S32, using the support vector machine (SVM) classifier for fast classification, training the SVM model, using the Gaussian kernel to handle nonlinear problems, and classifying each ROI feature vector through the SVM model;
[0126] S33, marking the ROI feature vector classified as suspected defects as the key processing area and passing it to the next step of fine classification module
[0127] S4, finely classifying the suspected defect area output in step S3;
[0128] S41. Preprocess the defect area data identified in S3 to adapt to the model input requirements and improve classification accuracy. Crop the suspected defect area ROI screened by the primary classifier in S3 before inputting the ROI into the lightweight CNN model, and adjust the ROI size to a fixed size to adapt to the input of the lightweight convolutional neural network CNN. If the ROI is too small, it can be enlarged using bilinear interpolation, and each pixel value is normalized:
[0129]
[0130] Among them, I normalized is the pixel value of the normalized image at that location, μ is the global mean, and σ is the standard deviation;
[0131] S42. Use a lightweight convolutional neural network (CNN) to classify the preprocessed ROI and output the defect type and confidence level. The lightweight convolutional neural network (CNN) includes an input layer, a convolution layer, a pooling layer, and a classification layer. The input size of the input layer is the size of an RGB image. The convolution layer uses a depth-separable convolution to extract features. The formula is as follows:
[0132] Y=X×K depthwise ×K pointwise ; (14)
[0133] Among them, K depthwise is the deep convolution kernel, processed separately by channel, Y is the output feature map, usually the result after deep separable convolution, X is the input feature map, usually image data, K pointwise It is a point-by-point convolution kernel, using 1×1 convolution to fuse features. The pooling layer uses global average pooling instead of the fully connected layer. The classification layer uses the softmax activation function to output the probability distribution of the defect type. The classification reasoning inputs each preprocessed ROI into the lightweight CNN model, extracts local features in the convolution layer, reduces the size of the feature map in the pooling layer, and performs classification in the fully connected layer. The model outputs the probability distribution of each defect type, and takes the category with the highest probability as the classification result.
[0134] S43, performing confidence screening, if the maximum confidence of the model output is higher than the threshold, it is marked as a "determined area, and for each defect area marked as a "determined area", the center coordinates of the ROI are calculated;
[0135]
[0136] Among them, Center x 、Center y is the center coordinate of ROI, (x i ,y i ) is the position of each pixel in the ROI, and N is the total number of pixels in the ROI;
[0137] If the maximum confidence level of the model output is lower than the threshold, it is marked as an "uncertain area", and the defect category and the center coordinates of the ROI are transmitted to the host computer to form a test report;
[0138] S5. According to the classification result of S4, the defective area is marked in real time; the marking method is inkjet printing to ensure that the defect location can be quickly identified;
[0139] S6. The inspection results including defect location, type and quantity are transmitted to the host computer via Ethernet for real-time display and recording.
[0140] like Figure 5 As shown, a ceramic glaze detection system based on image processing and hierarchical classifier includes a DC motor 1, a ceramic glaze 2, a non-contact polarizer 3, an optical lens 4, a multi-angle linear array LED light source 5, a color linear array CCD sensor 6, an image preprocessing module 7, a classification module 8, an automatic marking module 9, a communication module 10, and a host computer 11;
[0141] The angle and brightness adjustment of the multi-angle linear array LED light source 5 are set to a custom setting mode; the polarization angle of the non-contact polarizer 3 is set to a dynamic adjustment mode.
[0142] Example
[0143] (1) First, adjust the distance between the color linear array CCD sensor 6 and the detection area of the ceramic glaze 2 to ensure that the target detection area is at the best imaging focal length; the color linear array CCD sensor 6 can scan the ceramic glaze line by line, which is suitable for fine detection of moving objects;
[0144] (2) When the above operations are completed, a completion instruction is sent to the FPGA, and the angle and brightness of the multi-angle LED light source 5 are set through the control program and the non-contact polarizer 3 is started and controlled for dynamic adjustment; the FPGA (programmable gate array) controller is selected with powerful hardware parallel processing capabilities, which can process multiple data streams at the same time and run independently of the PC, thereby accelerating the execution speed of the algorithm; secondly, the programmability of the FPGA enables the system to better adapt to the industrial environment and improve the stability and reliability of the system.
[0145] (3) Scanning the ceramic glaze surface 2 line by line through the color linear array CCD sensor 6, collecting a high-resolution RGB image, and transmitting the image signal to the FPGA for processing;
[0146] (4) The data after the preprocessing module 7 is transmitted to the classification module 8. In the classification module 8, the support vector machine is used to quickly screen the defect area through the collaborative work of the hierarchical classifier, and then the lightweight convolutional neural network is used to accurately identify the defect type, thereby achieving efficient and accurate defect detection and classification;
[0147] (5) Based on the refined classification results, the defective area is marked by inkjet printing through the automatic marking module 9, and the detection results, including the type, location, area and other information of the defects, are transmitted to the host computer 11 through the communication module 10, and the detection results are displayed in real time in the host computer 11.
[0148] In the specific implementation process, when the ceramic glaze defect detection system starts working, the ceramic glaze 2 is first scanned line by line by the color linear array CCD sensor 6, and the collected image data is preprocessed, including dynamic background suppression, adaptive filtering and brightness correction, so as to remove image noise, reduce the influence of uneven illumination, and improve image quality; then, the region (ROI) where the defect may exist in the image is extracted to reduce the amount of calculation for subsequent processing and increase the running speed; then, the ROI is quickly screened by the support vector machine (SVM), the suspected defect area is classified, and the defect location and nature are preliminarily determined; for the screened suspected area, a lightweight convolutional neural network (CNN) is used for further fine classification to identify defect types such as cracks, bubbles and color aberration, and the classification results and confidence levels are output; finally, the classification results are transmitted to the automatic marking module or the host computer, and the detection area is marked by inkjet or laser at the same time, completing the whole process of ceramic surface defect detection and marking.
[0149] Therefore, the present invention adopts the above-mentioned content, a ceramic glaze detection method and system based on image processing and hierarchical classifier, to solve the problems of high noise and high reflective environment reducing model performance in the prior art, adapt to high reflective surfaces and complex texture environments, and help improve the work efficiency and accuracy in ceramic production quality and production process control.
[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A ceramic glaze detection method based on image processing and hierarchical classifier, characterized in that: S1, scanning the ceramic glaze surface line by line through a color linear array CCD sensor to collect high-resolution RGB image data; S2, preprocessing the RGB image data collected in the above step S1 to identify potential defect areas; S3, preliminarily classify the potential defect areas identified by S2 and screen suspected defect areas; S4, finely classifying the suspected defect area output in step S3; S5, marking the defective area in real time according to the classification result of S4; S6. Transmit the test results to the host computer via Ethernet for real-time display and recording.
2. The ceramic glaze detection method based on image processing and hierarchical classifier according to claim 1 is characterized in that: The specific process of image preprocessing in S2 is as follows: S21. The process of removing background noise caused by uneven illumination in RGB image data by dynamic background suppression technology, highlighting the features of defective areas and calculating the background light intensity of local areas is as follows: ;(1) in, is the background light intensity in the local area, is the mean of the pixel values in the calculated area, is the pixel value of the image at that position; S22, the process of removing the background light intensity in the RGB image data and enhancing the contrast of the defective area is as follows: ;(2) in, is the pixel value of the image at that location after background suppression processing; S22. Adaptive filtering technology is used to remove random noise in RGB image data while retaining edges and details. The filtering parameters are dynamically adjusted according to the local characteristics of the image. A larger filtering window is used for high-noise areas, and a smaller filtering window is used for areas with rich textures. Bilateral filtering or guided filtering is used to retain edge details. The process is as follows: ;(3) in, is the pixel value of the image at that location after being processed by the filter, is the weight associated with spatial distance and grayscale difference; S23, highlight the boundary features of the defect through edge detection technology, use the Canny edge detection algorithm and apply Gaussian filtering to smooth the image, calculate the gradient intensity and suppress the non-maximum value, set high and low thresholds, and extract the edge to clarify the contour information of the defect; S24. Image enhancement technology is used to improve the visibility of defective areas for highlighting contrast. Contrast stretching is used to map the pixel grayscale value to a wider range. The calculation process for improving contrast is as follows: ;(4) in, is the pixel value of the enhanced image at that location, is the minimum value of all pixel values in the image. is the maximum value of all pixel values in the image; S25, combining color space conversion technology to convert the RGB image into Lab color space to extract specific channels; S26. Extract the area where the defect may exist according to the ROI, use the connectivity analysis method to extract the significant area, screen the characteristics such as the area size and shape, and exclude the background and irrelevant areas.
3. The ceramic glaze detection method based on image processing and hierarchical classifier according to claim 2 is characterized in that: The specific process of preliminary classification of the identified defective areas in S3 is as follows: S31, extracting ROI feature values, calculating texture features and color features for each extracted ROI feature value, and generating a feature vector for use by the classifier; S32, using the support vector machine (SVM) classifier for fast classification, training the SVM model, using the Gaussian kernel to handle nonlinear problems, and classifying each ROI feature vector through the SVM model; S33, marking the ROI feature vector classified as suspected defects as a key processing area, and passing it to the next step of fine classification module.
4. The ceramic glaze detection method based on image processing and hierarchical classifier according to claim 3 is characterized in that: The feature vector generation process in S31 is as follows: S311, extract texture features based on gray-level co-occurrence matrix GLCM, convert ROI into grayscale image, define pixel grayscale range and spatial relationship, calculate gray-level co-occurrence matrix , indicating that the gray value is i and j The co-occurrence probability of a pair of pixels at a given distance and direction; S312, extract color features, calculate the color distribution histogram of ROI on RGB channels, obtain statistical features such as the mean, standard deviation, and skewness of each channel to obtain the difference between RGB channels; S313, combining the extracted texture features and color features into a feature vector in order.
5. The ceramic glaze detection method based on image processing and hierarchical classifier according to claim 4 is characterized in that: The process of calculating texture features through gray-level co-occurrence matrix in S311 is as follows: Calculate contrast to measure the grayscale difference between pixels : ;(5) Calculate entropy to measure the complexity of the texture : ;(6) Calculate the energy to measure the uniformity of grayscale distribution : ;(7) Calculate correlation to measure the linear relationship between gray levels : ;(8) in, N is the total number of gray levels in the image, and the gray value ranges from 0 to 255. , Grayscale i , j The mean of , is the standard deviation.
6. The ceramic glaze detection method based on image processing and hierarchical classifier according to claim 5 is characterized in that: The process of extracting color features in S312 to obtain the difference between RGB channels is as follows: Calculate the color mean The formula is as follows: ;(9) in, The first k The color value of a pixel, n is the total number of pixels in the image; Calculate color standard deviation The formula is as follows: ;(10) Calculate color skewness The formula is as follows: ;(11) The method for calculating the difference between RGB channels is as follows: calculate the absolute value of the difference between the mean, standard deviation and skewness of any two channels among the three channels of R, G, and B.
7. The ceramic glaze detection method based on image processing and hierarchical classifier according to claim 6 is characterized in that: If the absolute value of the difference between the mean, standard deviation and skewness of any two of the three channels R, G, and B is larger, it means that the difference between the two color channels is larger, which usually indicates an area with obvious color difference, boundary or defect; if the absolute value of the difference between the mean, standard deviation and skewness of any two of the three channels R, G, and B is smaller, it means that the difference between the two color channels is smaller, which usually indicates a uniform color area.
8. The ceramic glaze detection method based on image processing and hierarchical classifier according to claim 7 is characterized in that: The specific process of finely classifying the identified defect areas in S4 is as follows: S41, pre-process the defect area data identified in S3, crop and normalize each pixel value before the ROI is input into the lightweight CNN model: ; (9) in, is the pixel value of the normalized image at that location, is the global mean, is the standard deviation; S42. Use a lightweight convolutional neural network (CNN) to classify the preprocessed ROI and output the defect type and confidence level; S43, performing confidence screening, if the maximum confidence of the model output is higher than the threshold, it is marked as "determined area", and for each defect area marked as "determined area", the center coordinates of the ROI are calculated; ; in, , is the center coordinate of ROI, is the position of each pixel within the ROI, N is the total number of pixels within the ROI; If the maximum confidence level of the model output is lower than the threshold, it is marked as an "uncertain area", and the defect category and the center coordinates of the ROI are transmitted to the host computer to form a test report.
9. The ceramic glaze detection method based on image processing and hierarchical classifier according to claim 8 is characterized in that: The lightweight convolutional neural network CNN in S42 includes input layer, convolution layer, pooling layer and classification layer. The input size of the input layer is the size of the RGB image. The convolution layer uses depth-separable convolution to extract features. The formula is as follows: ; (14) in, It is a deep convolution kernel, processed separately by channel. is the output feature map, usually the result of a depth-wise separable convolution. is the input feature map, usually image data, is a point-by-point convolution kernel, using 1 1. Convolution fusion features, the pooling layer uses global average pooling instead of the fully connected layer, and the classification layer uses the softmax activation function to output the probability distribution of the defect type; classification reasoning inputs each preprocessed ROI into the lightweight CNN model, extracts local features in the convolution layer, reduces the size of the feature map in the pooling layer, and performs classification in the fully connected layer. The model outputs the probability distribution of each defect type, and takes the category with the highest probability as the classification result.
10. The ceramic glaze detection system based on image processing and hierarchical classifier according to claim 9, characterized in that: It includes a color linear array CCD sensor, a DC motor, a non-contact polarizer, a multi-angle linear array LED light source, an image preprocessing module, a classification module, an automatic marking module, a communication module, and a host computer.
11. The ceramic glaze detection system based on image processing and hierarchical classifier according to claim 10, characterized in that: The angle and brightness adjustment of the multi-angle linear array LED light source are set in a custom setting mode; the polarization angle of the non-contact polarizer is set in a dynamic adjustment mode.
Citation Information
Patent Citations
Light-weight cloth defect detection method capable of being deployed in embedded equipment
CN116188419A
Ultralight cloth defect detection algorithm
CN118446985A
Cited By
Fabric defect detection method based on image recognition
CN120525874A
Automatic ceramic glazing control system and method integrating machine vision and trajectory planning
CN120828464A
Automatic Ceramic Glazing Control System and Method Integrating Machine Vision and Trajectory Planning
CN120828464B
Intelligent fusion terminal sorting method and system based on visual identification
CN121402335A
Method for classifying waste for animal husbandry and veterinary medicine based on image processing
CN121616898A