[go: up one dir, main page]

CN119810080A - A stainless steel surface defect detection method based on machine vision - Google Patents

A stainless steel surface defect detection method based on machine vision Download PDF

Info

Publication number
CN119810080A
CN119810080A CN202411987693.8A CN202411987693A CN119810080A CN 119810080 A CN119810080 A CN 119810080A CN 202411987693 A CN202411987693 A CN 202411987693A CN 119810080 A CN119810080 A CN 119810080A
Authority
CN
China
Prior art keywords
defect
image
resolution
stainless steel
multispectral
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202411987693.8A
Other languages
Chinese (zh)
Inventor
刘志刚
李选娟
赵玉宝
王俊
王雪
曹斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Anxin Excellence Intelligent Technology Co ltd
Jiangsu Intelligent Workshop Technology Research Institute Co ltd
Original Assignee
Wuxi Anxin Excellence Intelligent Technology Co ltd
Jiangsu Intelligent Workshop Technology Research Institute Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi Anxin Excellence Intelligent Technology Co ltd, Jiangsu Intelligent Workshop Technology Research Institute Co ltd filed Critical Wuxi Anxin Excellence Intelligent Technology Co ltd
Priority to CN202411987693.8A priority Critical patent/CN119810080A/en
Publication of CN119810080A publication Critical patent/CN119810080A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Image Processing (AREA)

Abstract

本发明公开了一种基于机器视觉的不锈钢表面缺陷检测方法,涉及材料缺陷检测领域,包括,采集不锈钢表面图像,对采集的多光谱表面图像进行图像融合,生成多光谱复合图像;通过超分辨率重建算法,对低分辨率图像进行细节增强,获取高分辨率图像集;通过缺陷检测算法,从高分辨率图像集中定位缺陷区域位置,获取缺陷位置数据集;从缺陷位置数据集中提取历史和实时图像缺陷特征集,根据历史图像缺陷特征集构建缺陷分类模型;将实时图像缺陷特征集输入缺陷分类模型,进行缺陷分类与评估,获取缺陷分类数据集;生成并分发缺陷检测报告。本发明通过结合多光谱成像算法、超分辨率重建算法和缺陷分类模型,提升了不锈钢表面缺陷检测的自动化、精度和效率。

The present invention discloses a stainless steel surface defect detection method based on machine vision, which relates to the field of material defect detection, including collecting stainless steel surface images, performing image fusion on the collected multi-spectral surface images, and generating multi-spectral composite images; performing detail enhancement on low-resolution images through super-resolution reconstruction algorithms, and obtaining high-resolution image sets; locating defect area positions from high-resolution image sets through defect detection algorithms, and obtaining defect position data sets; extracting historical and real-time image defect feature sets from the defect position data sets, and constructing a defect classification model based on the historical image defect feature sets; inputting the real-time image defect feature sets into the defect classification model, and performing defect classification and evaluation, and obtaining defect classification data sets; and generating and distributing defect detection reports. The present invention improves the automation, accuracy, and efficiency of stainless steel surface defect detection by combining multi-spectral imaging algorithms, super-resolution reconstruction algorithms, and defect classification models.

Description

Stainless steel surface defect detection method based on machine vision
Technical Field
The invention relates to the field of material defect detection, in particular to a stainless steel surface defect detection method based on machine vision.
Background
In recent years, with the development of industrial automation and intelligent manufacturing, stainless steel surface defect detection is a key link of quality control, and has received a great deal of attention. Conventional defect detection methods generally rely on manual visual inspection or simple mechanical detection systems, which are not only inefficient, but also greatly affected by human factors, and it is difficult to ensure consistency and accuracy. With the continuous progress of machine vision algorithms, defect detection methods based on image processing are becoming the mainstream. The machine vision system collects stainless steel surface images through the camera equipment, and utilizes image processing and analysis algorithms to automatically identify and position defects. With the development of multispectral imaging algorithm, super-resolution reconstruction algorithm and deep learning technology, the accuracy and reliability of image detection are remarkably improved. Especially in the aspect of multi-spectrum image fusion, information of a plurality of wave bands can provide more details than a single spectrum, so that the accuracy of defect detection is improved.
Although there are a variety of defect detection methods based on machine vision, such as defect recognition using conventional image processing algorithms or deep learning methods, these methods still have some drawbacks. First, defect details in a low-resolution image are easily lost, and it is difficult for a conventional image enhancement method to effectively recover the fine details of the defects, resulting in a limitation in the accuracy of the detection result. Secondly, although the deep learning-based defect classification model can provide better performance, the deep learning-based defect classification model still faces a great challenge in a feature extraction stage, and particularly in the case of more and complex defect types, the classification model is easily affected by noise, so that a classification result is unstable. Furthermore, the prior art typically relies on a fixed set of historical defect data for training, lacking sufficient real-time and dynamic adaptation capabilities. Because of these problems, the popularization of the prior art in practical application is limited, and particularly, the performance in the aspects of fine detection and real-time feedback is not ideal.
Disclosure of Invention
The present invention has been made in view of the above-described problems occurring in the prior art.
Therefore, the invention provides a stainless steel surface defect detection method based on machine vision, which solves the problem that the stainless steel surface defect detection efficiency and accuracy are insufficient in the traditional scheme.
In order to solve the technical problems, the invention provides the following technical scheme:
The invention provides a machine vision-based stainless steel surface defect detection method, which comprises the steps of collecting a stainless steel surface image, carrying out image fusion on the collected multispectral surface image to generate a multispectral composite image, carrying out detail enhancement on a low-resolution image through a super-resolution reconstruction algorithm based on the multispectral composite image to obtain a high-resolution image set, locating a defect area position from the high-resolution image set through a defect detection algorithm to obtain a defect position data set, extracting a history and a real-time image defect feature set from the defect position data set through a feature extraction algorithm, constructing a defect classification model according to the history image defect feature set, inputting the real-time image defect feature set into the defect classification model to carry out defect classification and evaluation to obtain a defect classification data set, and generating and distributing a defect detection report based on the defect classification data set.
As a preferable scheme of the machine vision-based stainless steel surface defect detection method, the multispectral surface image comprises stainless steel surface images of visible light wave bands, near infrared wave bands and short-wave infrared wave bands.
The method for detecting the stainless steel surface defects based on machine vision is characterized by comprising the steps of collecting the stainless steel surface images, performing image fusion on the collected multispectral surface images to generate multispectral composite images,
Using a multispectral imaging sensor to acquire images of the stainless steel surface and acquiring multispectral surface images;
Denoising and artifact removal processing is carried out on the multispectral surface image through a median filtering algorithm;
registering the processed multispectral surface images by a characteristic point matching and mutual information maximization method;
And synthesizing the registered multispectral surface image into a multispectral composite image by adopting a multispectral image fusion algorithm based on guided filtering, wherein the expression is as follows:
Wherein I (x, y) is a pixel value of the fused multispectral composite image at a position (x, y), N is a spectrum number participating in fusion, I is a spectrum number index coefficient participating in fusion, e is a natural base number, λ is an image influence weighting parameter, I i (x, y) is a pixel value of the ith spectrum image at the position (x, y), μ i is a local mean value of the ith spectrum image, Z (x, y) is a normalization coefficient, x is a spatial abscissa of the image, and y is a spatial ordinate of the image.
The method for detecting the stainless steel surface defects based on the machine vision is used as a preferable scheme, wherein the multispectral composite image is used for carrying out detail enhancement on a low-resolution image through a super-resolution reconstruction algorithm to obtain a high-resolution image set,
Decomposing the multispectral composite image into a low-resolution base layer tensor and a low-resolution texture layer tensor by adopting a nonlinear sparse tensor-based decomposition method, wherein the expression is as follows:
Wherein T is the tensor representation of the multispectral composite image, B is the low resolution base layer tensor, S is the low resolution texture layer tensor, E is the noise term, B TV is the total variation regularization of the base layer tensor, S 1,2 is the mixed sparse constraint of the texture layer tensor, The coefficient is the Frobenius norm of a noise term, alpha is a low-resolution texture layer balance parameter, beta is a noise term balance parameter, and s.t. is a constrained symbol;
Constructing a multi-scale residual error dense network model based on a low-resolution texture layer tensor, performing super-resolution reconstruction on the low-resolution texture layer to obtain a high-resolution texture layer, wherein the expression is as follows:
SHR=f1(f2(f3(S)));
Wherein S HR is a high-resolution texture layer after super-resolution reconstruction, f 3 is a multi-scale convolution operation, f 2 is a residual dense network operation, and f 1 is a sub-pixel convolution upsampling operation;
performing detail interpolation based on non-parameterized kernel regression on the low-resolution base layer tensor to obtain a high-resolution base layer, wherein the expression is as follows:
Wherein B HR (x, y) is the pixel value of the high-resolution base layer, For the neighborhood range of the target pixel, x 'is the abscissa of the neighborhood pixel, y' is the ordinate of the neighborhood pixel, K (x-x ', y-y') is a Gaussian kernel function, and B (x ', y') is the pixel value of the low-resolution base layer of the neighborhood pixel;
And carrying out weighted fusion on the high-resolution base layer and the high-resolution texture layer to generate a high-resolution image set.
The method for detecting the defects on the stainless steel surface based on the machine vision is used for obtaining a defect position data set by locating the positions of the defect areas from a high-resolution image set through a defect detection algorithm, and comprises the following specific steps of,
Enhancing the image contrast of the high-resolution image set by a histogram equalization method;
detecting edges in the high-resolution image set by using a Canny edge detection algorithm, and segmenting by using an Otsu threshold selection algorithm to highlight a defect area;
Optimizing an edge detection result by using an expansion and corrosion method in morphological operation, and smoothing a defect region through an open operation and a closed operation;
And extracting the outline of the defect area of the processed image to obtain a defect position data set.
The method for detecting the stainless steel surface defects based on machine vision is a preferable scheme, wherein the method uses a feature extraction algorithm to extract historical and real-time image defect feature sets from defect position data sets, constructs a defect classification model according to the historical image defect feature sets, comprises the following specific steps of,
Calculating geometric features of the defect region based on the defect location dataset;
extracting surface texture features of the defect area by using a gray level co-occurrence matrix and a local binary pattern;
Acquiring color characteristics of the defect area through a color histogram and calculating a color mean variance;
Extracting frequency domain features of the defect area through discrete Fourier transform and discrete wavelet transform;
based on the geometric features, the surface texture features, the color features and the frequency domain features of the defect region, performing feature dimension reduction by using a principal component analysis algorithm to obtain an image defect feature set;
dividing the image defect feature set into a historical image defect feature set and a real-time image defect feature set through time sequence cutting;
selecting RBF kernel functions, optimizing super parameters through grid search, and constructing a defect classification model based on a support vector machine;
Dividing the historical image defect characteristic set into a training set and a testing set, training a support vector machine classifier by using the training set, and verifying the performance of the defect classification model by using a cross verification algorithm.
The method for detecting the defects on the stainless steel surface based on machine vision is characterized by comprising the following steps of inputting a real-time image defect feature set into a defect classification model, performing defect classification and evaluation to obtain a defect classification data set,
Loading a trained defect classification model, and verifying by using a test set;
Inputting the real-time image defect feature set into the verified defect classification model, performing defect classification prediction, and outputting a category label and a confidence score;
and integrating the defect region classification result based on the category label and the confidence score to obtain a defect classification data set.
As a preferable scheme of the stainless steel surface defect detection method based on machine vision, the method comprises the steps of generating and distributing a defect detection report based on a defect classification data set,
Collecting defect data information from a defect classification data set, and sorting the defect data information into a structured data set;
Defining a defect detection report structure, and generating a defect detection report by combining the structured data set and filling a report template through an automation tool;
The defect detection report is stored in a local server and distributed by email.
In a second aspect, the invention provides a computer device comprising a memory and a processor, the memory storing a computer program, wherein the computer program when executed by the processor implements any of the steps of the machine vision based stainless steel surface defect detection method according to the first aspect of the invention.
In a third aspect, the present invention provides a computer readable storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements any step of the machine vision based stainless steel surface defect detection method according to the first aspect of the present invention.
The method has the beneficial effects that the method is high-efficiency and accurate by combining a multispectral imaging algorithm, a super-resolution reconstruction algorithm, a defect detection algorithm, a feature extraction algorithm and a defect classification model. The method has the advantages that the quality of an image is improved by utilizing a multispectral image fusion algorithm, high-quality input is provided for subsequent detail enhancement, more details are recovered from a low-resolution image by utilizing a super-resolution reconstruction algorithm, the image definition is improved, a defect area is precisely positioned by utilizing a defect detection algorithm, a reliable basis is provided for subsequent feature extraction and classification, a more precise defect classification model is constructed by deeply analyzing defects by utilizing a feature extraction algorithm, continuous optimization is realized by combining history and real-time data, a detailed defect detection report is generated by defect classification and evaluation, and real-time and accurate data support is provided for production and quality control. The invention improves the automation, precision and efficiency of stainless steel surface defect detection and provides further technical guarantee for quality control in industrial production.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of the machine vision-based stainless steel surface defect detection method in example 1.
Fig. 2 is a flowchart for locating the location of a defective area in embodiment 1.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways other than those described herein, and persons skilled in the art will readily appreciate that the present invention is not limited to the specific embodiments disclosed below.
Further, reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic can be included in at least one implementation of the invention. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments.
Embodiment 1, referring to fig. 1 and 2, a first embodiment of the present invention provides a machine vision-based stainless steel surface defect detection method, comprising,
S1, collecting a stainless steel surface image, and performing image fusion on the collected multispectral surface image to generate a multispectral composite image.
Specifically, the method comprises the following steps:
S1.1, acquiring images of the stainless steel surface by using a multispectral imaging sensor to acquire multispectral surface images.
It should be appreciated that the multispectral imaging sensor is a high resolution near infrared/visible light camera and short wave infrared camera combination.
S1.1.1. the multispectral surface image comprises stainless steel surface images of visible light wave bands, near infrared wave bands and short wave infrared wave bands.
Specifically, the multispectral imaging sensor needs to capture images of the stainless steel surface in different spectral ranges at the same time, and mainly comprises a visible light band (400-700 nm), a near infrared band (700-1500 nm) and a short wave infrared band (1500-2500 nm).
And S1.2, denoising and artifact removal processing is carried out on the multispectral surface image through a median filtering algorithm.
Specifically, in the multispectral imaging process, noise or artifacts may occur due to factors such as uneven illumination, local defects of the sensor, and the like. The median filtering algorithm is a nonlinear filtering algorithm, and can effectively remove salt and pepper noise and other types of random noise, and meanwhile, the definition of the image edge is maintained. The filtering operation will select the median value in the neighborhood of the image pixel by pixel and replace the pixel value in the original image with this value, thus effectively smoothing the image and reducing noise.
And S1.3, registering the processed multispectral surface image by a characteristic point matching and mutual information maximization method.
Specifically, the feature point matching method finds out the alignment mode between the images by detecting the salient feature points (such as corner points, edges and the like) in the images and utilizing the geometric transformation relation between the feature points. The mutual information maximization is a registration method based on image gray distribution statistics, and can automatically calculate the similarity between two images, so that the mutual information is maximized through an optimization algorithm, and the optimal registration effect is achieved. By the method, multispectral images can be precisely aligned, and image deviation caused by different angles of imaging equipment or surface texture changes can be eliminated.
S1.4, adopting a multispectral image fusion algorithm based on guided filtering to synthesize the multispectral surface image after registration into a multispectral composite image, wherein the expression is as follows:
Wherein I (x, y) is a pixel value of the fused multispectral composite image at a position (x, y), N is a spectrum number participating in fusion, I is a spectrum number index coefficient participating in fusion, e is a natural base number, λ is an image influence weighting parameter, I i (x, y) is a pixel value of the ith spectrum image at the position (x, y), μ i is a local mean value of the ith spectrum image, Z (x, y) is a normalization coefficient, x is a spatial abscissa of the image, and f is a spatial ordinate of the image.
Preferably, the guided filtering is an efficient image fusion algorithm capable of effectively suppressing inter-spectrum interference, and is suitable for multi-spectrum image fusion. Compared with the traditional image fusion method, the method can better keep the edge information and details of the image, has lower operation complexity and can meet the real-time requirement. The weighting item can dynamically adjust the weight according to the quality of different spectrum images, so that the quality of the fused images is ensured, the comprehensive performance of the multispectral images is improved, and especially the identification of micro defects is realized.
Preferably, images of the stainless steel surface in visible light, near infrared and short wave infrared bands are obtained through a multispectral imaging algorithm, noise and artifacts are removed through a median filtering algorithm, and image quality is guaranteed. Image registration is carried out through a characteristic point matching and mutual information maximization method, so that accurate alignment of different spectrum images is ensured, and high-quality input is provided for subsequent processing. And a multispectral image fusion algorithm based on guide filtering is adopted to synthesize a multispectral composite image with high quality, so that the details and the edge information of the image are effectively reserved, and the comprehensive performance of the image is improved by dynamically adjusting a weighting item.
S2, carrying out detail enhancement on the low-resolution image through a super-resolution reconstruction algorithm based on the multispectral composite image to obtain a high-resolution image set.
Specifically, the method comprises the following steps:
s2.1, decomposing the multispectral composite image into a low-resolution base layer tensor and a low-resolution texture layer tensor by adopting a nonlinear sparse tensor-based decomposition method, wherein the expression is as follows:
Wherein T is the tensor representation of the multispectral composite image, B is the low resolution base layer tensor, S is the low resolution texture layer tensor, E is the noise term, B TV is the total variation regularization of the base layer tensor, S 1,2 is the mixed sparse constraint of the texture layer tensor, The Frobenius norm of the noise term, α is the low resolution texture layer balance parameter, β is the noise term balance parameter, and s.t. is the constrained symbol.
Preferably, the multispectral composite image T is decomposed by a tensor decomposition method to obtain a low-resolution base layer tensor B and a texture layer tensor S, and a noise term e. The B TV preserves the smoothness of the image and reduces noise, and the S 1,2 aims to extract detailed information of the image. By minimizing the loss function, the base layer and the texture layer of the low-resolution image are optimized, so that image decomposition is realized, and the low-resolution image component which is more suitable for super-resolution reconstruction is obtained.
S2.2, constructing a multi-scale residual error dense network model based on a low-resolution texture layer tensor, and carrying out super-resolution reconstruction on the low-resolution texture layer to obtain a high-resolution texture layer, wherein the expression is as follows:
SHR=f1(f2(f3(S)));
Wherein S HR is a high-resolution texture layer after super-resolution reconstruction, f 3 is a multi-scale convolution operation, f 2 is a residual dense network operation, and f 1 is a sub-pixel convolution upsampling operation.
Preferably, using the low resolution texture layer tensor S as input, a Multi-scale residual dense network (MDRN, multi-Scale Residual Dense Network) is constructed for super resolution reconstruction. The network comprises a plurality of convolution layers and a residual error module, and can effectively learn multi-scale characteristics of a texture layer and strengthen details, wherein f 3 is multi-scale convolution operation, different levels of details in an image are captured by adopting convolution kernels of different scales, f 2 is residual error dense network operation, the deep-level characteristics are extracted in a dense connection mode, convergence is accelerated, and f 1 is sub-pixel convolution up-sampling operation, and a low-resolution image is converted into a high-resolution image through convolution up-sampling. And carrying out super-resolution reconstruction on the texture layer through the network, thereby obtaining a high-resolution texture layer S HR and providing high-resolution texture information for subsequent fusion.
Further, the f 3 multi-scale convolution operation specifically comprises the following steps:
The incoming low resolution texture layer S is processed through a series of convolution layers, each employing a different size convolution kernel.
Each convolution layer passes the low resolution texture layer tensor through the convolution operation while preserving its multi-scale features.
For each scale convolution kernel, different stride and kernel sizes are used to accommodate different sized details. For example:
small-sized convolution kernels (e.g., 3x3, 5x 5) capture local detail and texture features;
Large size convolution kernels (e.g., 7x7, 9x 9) capture global information, such as a wide range of textures and shapes.
The output of each scale convolution is subjected to an activation function process (e.g., reLU) to enhance feature expression.
The f 2 residual dense network operation specifically comprises the following steps:
In each residual module, input information is directly transferred to a subsequent layer through a jump connection (skip connections), so that the gradient vanishing problem is reduced and convergence is accelerated. Each residual module contains convolution operations, activation functions (e.g., reLU), and batch normalization (Batch Normalization) operations.
The output of each layer is not only passed on to the next layer, but is also spliced with the output of all previous layers, thereby enhancing the information flow. In this way, the network is able to extract more features at each layer.
And adopting a multi-layer residual dense module, and constructing a depth network by densely connecting each layer with other layers. The output of each residual module is passed to the subsequent layer, and finally the final feature map is output by an activation function (ReLU or leak ReLU).
The f 1 sub-pixel convolution up-sampling operation specifically comprises the following steps:
in the convolution operation, a plurality of convolution cores are adopted to carry out convolution on the low-resolution image, so that a characteristic diagram of a plurality of channels is obtained.
The convolved multi-channel feature map is converted to a high resolution image using a pixel rearrangement algorithm (PixelShuffle).
The multiple channel information for each pixel in the image is rearranged into a new high resolution output.
S2.3, carrying out detail interpolation based on non-parameterized kernel regression on the low-resolution base layer tensor to obtain a high-resolution base layer, wherein the expression is as follows:
Wherein B HR (x, y) is the pixel value of the high-resolution base layer, For the neighborhood range of the target pixel, x 'is the abscissa of the neighborhood pixel, y' is the ordinate of the neighborhood pixel, K (x-x ', y-y') is the gaussian kernel function, and B (x ', y') is the pixel value of the low resolution base layer of the neighborhood pixel.
And S2.4, carrying out weighted fusion on the high-resolution base layer and the high-resolution texture layer to generate a high-resolution image set.
Specifically, the high-resolution base layer and the high-resolution texture layer are weighted and fused based on the local texture complexity, and the expression is:
Wherein, For the gradient modulus of the high resolution texture layer,I HR (x, y) is a high resolution image, integrated as a high resolution image set I HR, which is the gradient modulus of the high resolution base layer.
Preferably, a method based on nonlinear sparse tensor decomposition is adopted to decompose the low-resolution image into a base layer and a texture layer, and global structure and local detail of the image are optimized. And (3) performing super-resolution reconstruction on the texture layer by using a multi-scale residual error dense network, extracting deep features by multi-scale convolution and dense connection, and enhancing details. And the base layer carries out detail interpolation through non-parameterized kernel regression, so that the resolution ratio of the base layer is improved. By a weighted fusion method based on local texture complexity, the contributions of the base layer and the texture layer are dynamically balanced, so that details are effectively enhanced and smoothness is maintained.
S3, positioning the position of the defect area from the high-resolution image set through a defect detection algorithm, and obtaining a defect position data set.
Specifically, the method comprises the following steps:
And S3.1, enhancing the image contrast of the high-resolution image set by a histogram equalization method.
Specifically, first, a gray level histogram of a high resolution image set is calculated, representing the frequency of occurrence of different gray levels. By accumulating the histograms, the mapping relation of gray levels is calculated, so that the gray level distribution of the image tends to be uniform, and the visibility of a low-contrast area is improved. And (3) applying the equalized gray value to the original image to generate an image with enhanced contrast.
S3.2, detecting edges in the high-resolution image set by using a Canny edge detection algorithm, and segmenting by using an Otsu threshold selection algorithm to highlight a defect area.
Specifically, a Canny edge detection algorithm is used to calculate gradient values of the image and detect edges in the image. The Canny algorithm identifies edges in the image by gaussian filtering, gradient computation, non-maximum suppression, and dual-threshold segmentation. Based on the edge detection result, an Otsu threshold segmentation method is applied, an optimal threshold is automatically calculated, and the image is segmented into a foreground and a background. The Otsu method automatically selects a threshold by maximizing the inter-class variance, and effectively distinguishes a defective region. And highlighting defect areas which are potential defect positions through the segmented binary image.
And S3.3, optimizing an edge detection result by using an expansion and corrosion method in morphological operation, and smoothing a defect region through an open operation and a closed operation.
Specifically, the expansion operation is to expand the edge area through the expansion operation, fill the small gap on the edge, and enhance the visibility of the defect area. The expansion operation uses one structural element (e.g., a 3x3 matrix) to expand the pixel values near the edge to the surrounding area of the structural element.
Etching operation, namely shrinking the edge area through etching operation, removing small noise and irregular edges, and refining the defect area. The pixel values around the edge are shrunk using the structural elements.
And (3) performing an operation of combining the corrosion and the expansion, namely performing the corrosion and then the expansion to remove small noise points and smooth the edge of the defect area.
And (3) performing closed operation, namely expanding and then corroding to fill small gaps in the defect area and further smoothing the defect area.
And S3.4, carrying out contour extraction on the defect area of the processed image to obtain a defect position data set.
Specifically, a contour extraction algorithm (such as the findContours functions of OpenCV) is used to extract the contour of the defect region from the binary image. The contour extraction algorithm divides connected regions in the image into contours based on edge continuity. And screening out the defect outline according to the characteristics of the outline such as the size, the shape and the like. The minimum and maximum area thresholds are set to remove too small or too large areas. Coordinate information of each defect contour is extracted, including its location (e.g., center coordinates, bounding box location) and other relevant features (e.g., area, perimeter, shape, etc.). And storing the extracted defect position data in a JSON format, so that the subsequent defect analysis, statistics or report generation is facilitated.
The method comprises the steps of firstly enhancing the image contrast of a high-resolution image set through histogram equalization to enable a low-contrast area to be more obvious, automatically identifying and highlighting a defect area by adopting Canny edge detection and Otsu threshold segmentation, optimizing an edge detection result by utilizing morphological operation (expansion, corrosion and opening and closing operation), refining the shape of the defect area, acquiring an accurate defect position data set through a contour extraction algorithm, and providing reliable data for subsequent analysis and repair. The process is automatic, accurate and efficient, and provides powerful technical support for the fields of industrial detection, quality control and the like.
And S4, extracting historical and real-time image defect feature sets from the defect position data set by using a feature extraction algorithm, and constructing a defect classification model according to the historical image defect feature sets.
Specifically, the method comprises the following steps:
s4.1, calculating geometric features of the defect area based on the defect position data set.
Specifically, based on the acquired defect location data set, geometric features of each defect region are calculated, including area, perimeter, aspect ratio, shape factor, circularity, and the like.
The area is calculated as the total number of pixels in the defect area, and the size of the defect is reflected.
Perimeter, namely calculating the boundary length of the defect area through a contour extraction algorithm, and reflecting the appearance complexity of the defect.
Aspect ratio-aspect ratio of defect regions helps to identify the shape of the defect, e.g., whether it is bar, circular, etc.
Shape factor-the shape regularity of the defect is calculated from the ratio of perimeter to area, and is commonly used to distinguish between different types of defects.
Circularity, a measure of whether the shape of a defect area is nearly circular, a defect with high circularity may represent a different defect type.
And S4.2, extracting the surface texture characteristics of the defect area by using the gray level co-occurrence matrix and the local binary pattern.
Specifically, the gray level co-occurrence matrix (GLCM) is used for describing the spatial relation of gray values of an image by calculating the gray level co-occurrence matrix of a defect area and extracting common texture features such as contrast, correlation, energy, uniformity and the like.
Local Binary Pattern (LBP) is used for carrying out binary pattern coding of local area on each pixel, extracting texture information of the area, and the LBP can effectively capture texture features, and is particularly suitable for images with complex contrast and texture changes.
S4.3, obtaining the color characteristics of the defect area through the color histogram and the calculated color mean variance.
Specifically, the color histogram is calculated in the defect area to describe the distribution of different colors in the image. Color distribution analysis is performed using the RGB color space or other color space (e.g., HSV).
And calculating the color mean and variance of the defect area, wherein the color mean and variance are used for quantifying the color uniformity and color distribution change of the defect area and are suitable for defect identification with higher color contrast.
And S4.4, extracting the frequency domain characteristics of the defect area through discrete Fourier transform and discrete wavelet transform.
Specifically, discrete Fourier Transform (DFT) converts an image from a spatial domain to a frequency domain, analyzes frequency components in the image, and captures high-frequency and low-frequency features of the image.
Discrete Wavelet Transform (DWT) is to use a multi-scale mode to carry out wavelet transform on a defect area and extract frequency domain features under different scales. The DWT can effectively capture local frequency information of the image, and has good adaptability to different types of defect identification.
And S4.5, performing feature dimension reduction by using a principal component analysis algorithm based on the geometric features, the surface texture features, the color features and the frequency domain features of the defect region to obtain an image defect feature set.
Specifically, the geometric features, the surface texture features, the color features and the frequency domain features of the extracted defect region are combined into a high-dimensional feature vector through feature addition, feature dimension reduction is performed by using a Principal Component Analysis (PCA) algorithm, main features are extracted, and core information of data is reserved while the data dimension is reduced. The PCA maps the original feature space to a new space through linear transformation, reserves the main component with the maximum data variance, and removes redundant information, thereby improving the efficiency and accuracy of the defect classification model.
S4.6, dividing the image defect feature set into a historical image defect feature set and a real-time image defect feature set through time sequence cutting.
Specifically, the defect feature set is divided into historical data and real-time data according to the time sequence. The historical image defect feature set comprises defect feature data in a certain past time period and is used for training and constructing a defect classification model, and the real-time image defect feature set comprises data of a latest image and is used for predicting the defect classification model in real time.
S4.7, selecting RBF kernel functions, optimizing super parameters through grid search, and constructing a defect classification model based on a support vector machine.
Specifically, a Support Vector Machine (SVM) algorithm is used to classify defects, and a Radial Basis Function (RBF) kernel function is selected, because the RBF kernel can effectively process nonlinear data. The grid search method is used to optimize the superparameter of the defect classification model, such as parameters C (penalty parameters) and γ (width of kernel) of the kernel. Through grid search, traversing multiple super-parameter combinations, and selecting the parameter combination with optimal classification effect.
Further, the penalty parameter C controls the tolerance of the classifier to misclassification. A smaller C value means high tolerance to misclassification, and a defect classification model may be simpler (high variance), while a larger C value means low tolerance to misclassification, and a defect classification model is more complex (low variance, high variance).
The width γ of the kernel determines the "crowding" of the high-dimensional feature space. If γ is too large, the defect classification model may be over-fitted (low bias, high variance), and if γ is too small, the defect classification model may be under-fitted.
And S4.8, dividing the historical image defect characteristic set into a training set and a testing set, training a support vector machine classifier by using the training set, and verifying the performance of the defect classification model by using a cross verification algorithm.
Specifically, the historical image defect feature set is divided into a training set and a test set, 80% of data is used for training, and 20% of data is used for testing. And performing performance evaluation on the defect classification model through indexes such as accuracy, precision, recall rate, F1 value and the like, and evaluating the stability and generalization capability of the defect classification model by using k-fold cross validation. By repeating the training and verification process, the risk of overfitting of the defect classification model can be reduced.
Preferably, the shape, surface texture, color distribution and frequency information of the defects are comprehensively described by calculating the geometric features, texture features, color features and frequency domain features of the defects, so that multidimensional feature support is provided for the defect classification model. And then, performing feature dimension reduction by using principal component analysis, reducing redundant information and improving the efficiency of the defect classification model. The time sequence cutting method divides the historical data and the real-time data, so that the system has dynamic adaptability. And carrying out defect classification by adopting a support vector machine, optimizing super parameters through grid search, and ensuring the stability and high performance of a defect classification model. The generalization capability of the defect classification model is verified through cross verification, so that the detection precision and reliability are further improved.
S5, inputting the real-time image defect feature set into a defect classification model, performing defect classification and evaluation, and obtaining a defect classification data set.
Specifically, the method comprises the following steps:
s5.1, loading a trained defect classification model, and verifying by using a test set.
Specifically, the trained defect classification model is loaded through PyTorch, the defect classification model is rapidly verified by using the pre-prepared test set data, the performance of the defect classification model on the test data is evaluated, and the effectiveness and the stability of the defect classification model in a real scene are ensured.
S5.2, inputting the real-time image defect feature set into the verified defect classification model, performing defect classification prediction, and outputting a category label and a confidence score.
Specifically, the defect classification model predicts the type of defect based on the input features and generates corresponding type labels. Category labels include "cracks", "blemishes", "corrosion", and the like. In addition, the defect classification model outputs a confidence score that indicates the confidence level of the classification result. The higher the confidence score, the more confident the defect classification model is in the predicted outcome.
And S5.3, integrating the defect region classification result based on the category label and the confidence score to obtain a defect classification data set.
Specifically, the class label and the confidence score are associated with the ID or the unique identifier of the image in the defect region classification result, and the classification result is combined with the defect region to be stored as a JSON format file.
Preferably, through the steps, the defect classification model classifies and evaluates on the basis of the real-time image defect feature set, and the effectiveness and stability of the defect classification model on the test set are ensured. The real-time defect classification prediction can output class labels and confidence scores, and provides quick feedback for practical application. By associating the classification result with the image ID and storing the classification result in a JSON format, the standardization and systemization of data are ensured, and the subsequent analysis, report generation and fault tracking are facilitated.
And S6, generating and distributing a defect detection report based on the defect classification data set.
Specifically, the method comprises the following steps:
S6.1, collecting defect data information from the defect classification data set and sorting the defect data information into a structured data set.
Specifically, defect data information including the type, location, confidence score, detection time, etc. of the defect is extracted from the generated defect classification dataset. The record for each defect should include a defect ID, a category label, a defect location area, a confidence score, an image ID or file name, a detection timestamp.
And S6.2, defining a defect detection report structure, and generating a defect detection report by combining the structured data set and filling a report template through an automation tool.
Specifically, a defect detection report template is defined according to service requirements, and the report comprises the following core parts:
Report titles such as "defect inspection report" and associated item names or image set numbers.
Detection summary detection tasks, purposes, image and defect types involved, etc. are briefly described.
Defect analysis, namely summarizing the detection results according to categories, and listing detailed information of each defect, including defect categories, positions, confidence scores and the like.
And (3) defect statistics, namely summarizing the data of the total number of detected defects, the quantity and the severity distributed by category and the like.
Defect example map a defect image is embedded in the report, marking the defect area, as required.
Advice and processing, providing processing advice or follow-up work instruction.
The automation tool refers to Jinja template engine or ReportLab library in Python, and the script comprises automatically reading the structured dataset, automatically filling each part in the report according to the classification and statistical data of the defects, dynamically generating charts, tables and example diagrams, and enhancing the visual effect of the report.
And S6.3, storing the defect detection report in a local server, and distributing the defect detection report through an E-mail.
Specifically, defect detection reports are stored in a database and emails are sent to the relevant personnel or team via the smtplib library of Python.
Preferably, by extracting defect data information from the defect classification data set and sorting it into a structured data set, traceability and integrity of the defect data is ensured. And defining and filling a report template, and generating a defect detection report by an automation tool, so that errors and time delay in manual processing are eliminated, and the generation efficiency and consistency of the report are improved. The report template is automatically filled, the chart and the table are dynamically generated, the visual effect of the report is improved, and the user can conveniently understand and analyze the detection result. By storing the report at a local server and distributing it using email, timely sharing and efficient distribution of the report is ensured.
The embodiment also provides computer equipment, which is suitable for the situation of the stainless steel surface defect detection method based on machine vision, and comprises a memory and a processor, wherein the memory is used for storing computer executable instructions, and the processor is used for executing the computer executable instructions to realize the stainless steel surface defect detection method based on machine vision, which is provided by the embodiment.
The computer device may be a terminal comprising a processor, a memory, a communication interface, a display screen and input means connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
The present embodiment also provides a storage medium having a computer program stored thereon, which when executed by a processor implements the machine vision-based stainless steel surface defect detection method as set forth in the above embodiments, and the storage medium may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as a static random access Memory (Static Random Access Memory, SRAM for short), an electrically erasable Programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM for short), an erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM for short), a Programmable Read-Only Memory (PROM for short), a Read-Only Memory (ROM for short), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
In summary, the invention provides an efficient and accurate stainless steel surface defect detection method by combining a multispectral imaging algorithm, a super-resolution reconstruction algorithm, a defect detection algorithm, a feature extraction algorithm and a defect classification model. The method has the advantages that the quality of an image is improved by utilizing a multispectral image fusion algorithm, high-quality input is provided for subsequent detail enhancement, more details are recovered from a low-resolution image by utilizing a super-resolution reconstruction algorithm, the image definition is improved, a defect area is precisely positioned by utilizing a defect detection algorithm, a reliable basis is provided for subsequent feature extraction and classification, a more precise defect classification model is constructed by deeply analyzing defects by utilizing a feature extraction algorithm, continuous optimization is realized by combining history and real-time data, a detailed defect detection report is generated by defect classification and evaluation, and real-time and accurate data support is provided for production and quality control. The invention improves the automation, precision and efficiency of stainless steel surface defect detection and provides further technical guarantee for quality control in industrial production.
It should be noted that the above embodiments are only for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention may be modified or substituted without departing from the spirit and scope of the technical solution of the present invention, which is intended to be covered in the scope of the claims of the present invention.

Claims (10)

1.一种基于机器视觉的不锈钢表面缺陷检测方法,其特征在于:包括,1. A method for detecting stainless steel surface defects based on machine vision, characterized in that: 采集不锈钢表面图像,对采集的多光谱表面图像进行图像融合,生成多光谱复合图像;Collect stainless steel surface images, perform image fusion on the collected multispectral surface images, and generate multispectral composite images; 基于多光谱复合图像,通过超分辨率重建算法,对低分辨率图像进行细节增强,获取高分辨率图像集;Based on multispectral composite images, the low-resolution images are enhanced in detail through super-resolution reconstruction algorithms to obtain high-resolution image sets; 通过缺陷检测算法,从高分辨率图像集中定位缺陷区域位置,获取缺陷位置数据集;Through the defect detection algorithm, the defect area is located from the high-resolution image set to obtain the defect location data set; 使用特征提取算法,从缺陷位置数据集中提取历史和实时图像缺陷特征集,根据历史图像缺陷特征集构建缺陷分类模型;Use feature extraction algorithms to extract historical and real-time image defect feature sets from defect location data sets, and build a defect classification model based on the historical image defect feature sets; 将实时图像缺陷特征集输入缺陷分类模型,进行缺陷分类与评估,获取缺陷分类数据集;Input the real-time image defect feature set into the defect classification model to perform defect classification and evaluation to obtain a defect classification data set; 基于缺陷分类数据集,生成并分发缺陷检测报告。Generate and distribute defect detection reports based on defect classification datasets. 2.如权利要求1所述的基于机器视觉的不锈钢表面缺陷检测方法,其特征在于:所述多光谱表面图像包括可见光波段、近红外波段和短波红外波段的不锈钢表面图像。2. The stainless steel surface defect detection method based on machine vision as described in claim 1 is characterized in that the multispectral surface image includes stainless steel surface images in the visible light band, near infrared band and short-wave infrared band. 3.如权利要求2所述的基于机器视觉的不锈钢表面缺陷检测方法,其特征在于:所述采集不锈钢表面图像,对采集的多光谱表面图像进行图像融合,生成多光谱复合图像,具体步骤为,3. The method for detecting stainless steel surface defects based on machine vision according to claim 2 is characterized in that: the step of collecting the stainless steel surface image and fusing the collected multispectral surface image to generate a multispectral composite image comprises the following specific steps: 使用多光谱成像传感器对不锈钢表面进行图像采集,获取多光谱表面图像;Use a multispectral imaging sensor to collect images of the stainless steel surface to obtain a multispectral surface image; 通过中值滤波算法,对多光谱表面图像进行去噪和去伪影处理;The multispectral surface image is denoised and de-artifacted by using the median filtering algorithm; 通过特征点匹配和互信息最大化方法,将处理后的多光谱表面图像进行配准;The processed multispectral surface images are registered by feature point matching and mutual information maximization methods; 采用基于引导滤波的多光谱图像融合算法,将配准后的多光谱表面图像合成多光谱复合图像,表达式为:The multispectral image fusion algorithm based on guided filtering is used to synthesize the registered multispectral surface images into a multispectral composite image, which is expressed as: 其中,I(x,y)为融合后的多光谱复合图像在位置(x,y)处的像素值,N为参与融合的光谱数量,i为参与融合的光谱数量索引系数,e为自然底数,λ为图像影响加权参数,Ii(x,y)为第i个光谱图像在位置(x,y)处的像素值,μi为第i个光谱图像的局部均值,Z(x,y)为归一化系数,x为图像的空间横坐标,y为图像的空间纵坐标。Wherein, I(x,y) is the pixel value of the fused multispectral composite image at position (x,y), N is the number of spectra involved in the fusion, i is the index coefficient of the number of spectra involved in the fusion, e is the natural base, λ is the image influence weighting parameter, Ii (x,y) is the pixel value of the i-th spectral image at position (x,y), μi is the local mean of the i-th spectral image, Z(x,y) is the normalization coefficient, x is the spatial horizontal coordinate of the image, and y is the spatial vertical coordinate of the image. 4.如权利要求3所述的基于机器视觉的不锈钢表面缺陷检测方法,其特征在于:所述基于多光谱复合图像,通过超分辨率重建算法,对低分辨率图像进行细节增强,获取高分辨率图像集,具体步骤为,4. The method for detecting stainless steel surface defects based on machine vision according to claim 3 is characterized in that: based on the multi-spectral composite image, the low-resolution image is enhanced in detail by a super-resolution reconstruction algorithm to obtain a high-resolution image set, and the specific steps are: 采用基于非线性稀疏张量分解方法,将多光谱复合图像分解为低分辨率基础层张量和低分辨率纹理层张量,表达式为:Based on the nonlinear sparse tensor decomposition method, the multispectral composite image is decomposed into a low-resolution base layer tensor and a low-resolution texture layer tensor. The expression is: 其中,T为多光谱复合图像的张量表示,B为低分辨率基础层张量,S为低分辨率纹理层张量,∈为噪声项,||B||TV为基础层张量的全变分正则化,||S||1,2为纹理层张量的混合稀疏约束,为噪声项的Frobenius范数,α为低分辨率纹理层平衡参数,β为噪声项平衡参数,s.t.为受约束符号;Among them, T is the tensor representation of the multispectral composite image, B is the low-resolution base layer tensor, S is the low-resolution texture layer tensor, ∈ is the noise term, ||B|| TV is the total variation regularization of the base layer tensor, ||S|| 1,2 is the mixed sparse constraint of the texture layer tensor, is the Frobenius norm of the noise term, α is the balance parameter of the low-resolution texture layer, β is the balance parameter of the noise term, and st is the constrained symbol; 基于低分辨率纹理层张量构建多尺度残差密集网络模型,对低分辨率纹理层进行超分辨率重建,获取高分辨率纹理层,表达式为:Based on the low-resolution texture layer tensor, a multi-scale residual dense network model is constructed to perform super-resolution reconstruction on the low-resolution texture layer to obtain the high-resolution texture layer. The expression is: SHR=f1(f2(f3(S)));S HR = f 1 (f 2 (f 3 (S))); 其中,SHR为超分辨率重建后的高分辨率纹理层,f3为多尺度卷积操作,f2为残差密集网络操作,f1为亚像素卷积上采样操作;Among them, SHR is the high-resolution texture layer after super-resolution reconstruction, f3 is the multi-scale convolution operation, f2 is the residual dense network operation, and f1 is the sub-pixel convolution upsampling operation; 对低分辨率基础层张量进行基于非参数化核回归的细节插值,获取高分辨率基础层,表达式为:The low-resolution base layer tensor is interpolated with details based on non-parametric kernel regression to obtain a high-resolution base layer. The expression is: 其中,BHR(x,y)为高分辨率基础层的像素值,为目标像素的邻域范围,x′为邻域像素的横坐标,y′为邻域像素的纵坐标,K(x―x′,y―y′)为高斯核函数,B(x′,y′)为邻域像素低分辨率基础层的像素值;Among them, BHR (x,y) is the pixel value of the high-resolution base layer, is the neighborhood range of the target pixel, x′ is the horizontal coordinate of the neighborhood pixel, y′ is the vertical coordinate of the neighborhood pixel, K(x―x′,y―y′) is the Gaussian kernel function, and B(x′,y′) is the pixel value of the low-resolution base layer of the neighborhood pixel; 将高分辨率基础层和高分辨率纹理层加权融合,生成高分辨率图像集。The high-resolution base layer and the high-resolution texture layer are weightedly fused to generate a high-resolution image set. 5.如权利要求4所述的基于机器视觉的不锈钢表面缺陷检测方法,其特征在于:所述通过缺陷检测算法,从高分辨率图像集中定位缺陷区域位置,获取缺陷位置数据集,具体步骤为,5. The method for detecting stainless steel surface defects based on machine vision according to claim 4 is characterized in that: the defect detection algorithm is used to locate the defect area from the high-resolution image set to obtain the defect location data set, and the specific steps are: 通过直方图均衡化方法,增强高分辨率图像集的图像对比度;Enhance the image contrast of high-resolution image sets through histogram equalization method; 使用Canny边缘检测算法检测高分辨率图像集中的边缘,并通过Otsu阈值选择算法进行分割,突出显示缺陷区域;The edges in the high-resolution image set are detected using the Canny edge detection algorithm and segmented using the Otsu threshold selection algorithm to highlight the defective areas; 使用形态学操作中的膨胀和腐蚀方法优化边缘检测结果,通过开运算与闭运算平滑缺陷区域;Use the dilation and erosion methods in morphological operations to optimize edge detection results, and smooth defect areas through opening and closing operations; 对处理后图像的缺陷区域进行轮廓提取,获取缺陷位置数据集。The defect area of the processed image is contour extracted to obtain a defect location data set. 6.如权利要求5所述的基于机器视觉的不锈钢表面缺陷检测方法,其特征在于:所述使用特征提取算法,从缺陷位置数据集中提取历史和实时图像缺陷特征集,根据历史图像缺陷特征集构建缺陷分类模型,具体步骤为,6. The method for detecting stainless steel surface defects based on machine vision according to claim 5 is characterized in that: the feature extraction algorithm is used to extract historical and real-time image defect feature sets from the defect location data set, and a defect classification model is constructed based on the historical image defect feature sets, and the specific steps are: 基于缺陷位置数据集,计算缺陷区域的几何特征;Based on the defect location data set, the geometric features of the defect area are calculated; 使用灰度共生矩阵和局部二值模式,提取缺陷区域的表面纹理特征;The surface texture features of the defective area are extracted using gray-level co-occurrence matrix and local binary pattern. 通过颜色直方图与计算颜色均值方差,获取缺陷区域的颜色特征;Obtain the color features of the defect area by using the color histogram and calculating the color mean variance; 通过离散傅里叶变换和离散小波变换,提取缺陷区域的频域特征;The frequency domain features of the defect area are extracted through discrete Fourier transform and discrete wavelet transform; 基于缺陷区域的几何特征、表面纹理特征、颜色特征和频域特征,使用主成分分析算法进行特征降维,获取图像缺陷特征集;Based on the geometric features, surface texture features, color features and frequency domain features of the defect area, the principal component analysis algorithm is used to perform feature dimension reduction to obtain the image defect feature set; 通过时序切割,将图像缺陷特征集划分为历史图像缺陷特征集和实时图像缺陷特征集;By time series cutting, the image defect feature set is divided into a historical image defect feature set and a real-time image defect feature set; 选择RBF核函数并通过网格搜索优化超参数,构建基于支持向量机的缺陷分类模型;Select the RBF kernel function and optimize the hyperparameters through grid search to build a defect classification model based on support vector machine; 将历史图像缺陷特征集分为训练集和测试集,使用训练集训练支持向量机分类器,使用交叉验证算法对缺陷分类模型的性能进行验证。The defect feature set of historical images is divided into a training set and a test set. The training set is used to train the support vector machine classifier, and the cross-validation algorithm is used to verify the performance of the defect classification model. 7.如权利要求6所述的基于机器视觉的不锈钢表面缺陷检测方法,其特征在于:所述将实时图像缺陷特征集输入缺陷分类模型,进行缺陷分类与评估,获取缺陷分类数据集,具体步骤为,7. The method for detecting stainless steel surface defects based on machine vision according to claim 6 is characterized in that: the real-time image defect feature set is input into the defect classification model to perform defect classification and evaluation to obtain a defect classification data set, and the specific steps are: 加载训练好的缺陷分类模型,并使用测试集进行验证;Load the trained defect classification model and verify it using the test set; 将实时图像缺陷特征集输入验证后的缺陷分类模型,进行缺陷分类预测,输出类别标签和置信度评分;Input the real-time image defect feature set into the verified defect classification model to perform defect classification prediction and output the category label and confidence score; 基于类别标签和置信度评分,集成缺陷区域分类结果,获取缺陷分类数据集。Based on the category labels and confidence scores, the defect area classification results are integrated to obtain the defect classification dataset. 8.如权利要求7所述的基于机器视觉的不锈钢表面缺陷检测方法,其特征在于:所述基于缺陷分类数据集,生成并分发缺陷检测报告,具体步骤为,8. The method for detecting stainless steel surface defects based on machine vision according to claim 7 is characterized in that: the defect detection report is generated and distributed based on the defect classification data set, and the specific steps are: 从缺陷分类数据集中,收集缺陷数据信息,整理为结构化数据集;Collect defect data information from the defect classification data set and organize it into a structured data set; 定义缺陷检测报告结构,结合结构化数据集,通过自动化工具填充报告模版,生成缺陷检测报告;Define the defect detection report structure, combine the structured data set, fill in the report template through automated tools, and generate the defect detection report; 将缺陷检测报告储存在本地服务器中,通过电子邮件进行分发。Store defect inspection reports on a local server and distribute them via email. 9.一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于:所述处理器执行所述计算机程序时实现权利要求1~8任一所述的基于机器视觉的不锈钢表面缺陷检测方法的步骤。9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of the stainless steel surface defect detection method based on machine vision according to any one of claims 1 to 8 when executing the computer program. 10.一种计算机可读存储介质,其上存储有计算机程序,其特征在于:所述计算机程序被处理器执行时实现权利要求1~8任一所述的基于机器视觉的不锈钢表面缺陷检测方法的步骤。10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the stainless steel surface defect detection method based on machine vision according to any one of claims 1 to 8.
CN202411987693.8A 2024-12-31 2024-12-31 A stainless steel surface defect detection method based on machine vision Withdrawn CN119810080A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411987693.8A CN119810080A (en) 2024-12-31 2024-12-31 A stainless steel surface defect detection method based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411987693.8A CN119810080A (en) 2024-12-31 2024-12-31 A stainless steel surface defect detection method based on machine vision

Publications (1)

Publication Number Publication Date
CN119810080A true CN119810080A (en) 2025-04-11

Family

ID=95269176

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411987693.8A Withdrawn CN119810080A (en) 2024-12-31 2024-12-31 A stainless steel surface defect detection method based on machine vision

Country Status (1)

Country Link
CN (1) CN119810080A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120064320A (en) * 2025-04-29 2025-05-30 南昌航空大学 High-temperature OCT (optical coherence tomography) monitoring method and system for thermal barrier coating of aeroengine
CN120147310A (en) * 2025-05-13 2025-06-13 泉州师范学院 A product defect detection method and system based on multispectral imaging
CN120198421A (en) * 2025-05-23 2025-06-24 广东省特种设备检测研究院茂名检测院 Welding defect recognition method and system based on molten pool image
CN120219368A (en) * 2025-04-21 2025-06-27 东平金马帘子布有限责任公司 A machine vision-based defect recognition and analysis system for cord fabric production
CN120385683A (en) * 2025-05-16 2025-07-29 北京弗锐姆科技有限公司 A vision-based method for detecting the pressing quality of UHPC decorative panels
CN120411792A (en) * 2025-07-01 2025-08-01 西安笨笨畜牧有限公司 Pork surface dirt detection method and system based on image recognition
CN120471842A (en) * 2025-04-24 2025-08-12 河南科丰新材料有限公司 A method for detecting, identifying and processing rust defects on static arc contact workpieces
CN120599276A (en) * 2025-05-21 2025-09-05 兰州交通大学 An improved YOLOv8-based insulator damage detection method for distribution network transmission lines
CN120707475A (en) * 2025-05-30 2025-09-26 东莞市鸿泰达烫印有限公司 A digital printing quality detection method based on image analysis
CN120707450A (en) * 2025-06-10 2025-09-26 创客天下(北京)科技发展有限公司 A method and system for imaging surface defects of precision metal parts in a complex light field interference environment
CN120765611A (en) * 2025-07-08 2025-10-10 呼伦贝尔市林业和草原事业发展中心 Online detection method and system for wood surface defects based on machine vision
CN120876428A (en) * 2025-07-24 2025-10-31 江苏富乐华半导体科技股份有限公司 Ceramic carrier plate crack defect detection system and method based on machine vision

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120219368A (en) * 2025-04-21 2025-06-27 东平金马帘子布有限责任公司 A machine vision-based defect recognition and analysis system for cord fabric production
CN120471842A (en) * 2025-04-24 2025-08-12 河南科丰新材料有限公司 A method for detecting, identifying and processing rust defects on static arc contact workpieces
CN120064320A (en) * 2025-04-29 2025-05-30 南昌航空大学 High-temperature OCT (optical coherence tomography) monitoring method and system for thermal barrier coating of aeroengine
CN120147310A (en) * 2025-05-13 2025-06-13 泉州师范学院 A product defect detection method and system based on multispectral imaging
CN120385683A (en) * 2025-05-16 2025-07-29 北京弗锐姆科技有限公司 A vision-based method for detecting the pressing quality of UHPC decorative panels
CN120599276A (en) * 2025-05-21 2025-09-05 兰州交通大学 An improved YOLOv8-based insulator damage detection method for distribution network transmission lines
CN120198421A (en) * 2025-05-23 2025-06-24 广东省特种设备检测研究院茂名检测院 Welding defect recognition method and system based on molten pool image
CN120198421B (en) * 2025-05-23 2025-07-18 广东省特种设备检测研究院茂名检测院 Welding defect recognition method and system based on molten pool image
CN120707475A (en) * 2025-05-30 2025-09-26 东莞市鸿泰达烫印有限公司 A digital printing quality detection method based on image analysis
CN120707450A (en) * 2025-06-10 2025-09-26 创客天下(北京)科技发展有限公司 A method and system for imaging surface defects of precision metal parts in a complex light field interference environment
CN120411792A (en) * 2025-07-01 2025-08-01 西安笨笨畜牧有限公司 Pork surface dirt detection method and system based on image recognition
CN120411792B (en) * 2025-07-01 2025-09-09 西安笨笨畜牧有限公司 Pork surface dirt detection method and system based on image recognition
CN120765611A (en) * 2025-07-08 2025-10-10 呼伦贝尔市林业和草原事业发展中心 Online detection method and system for wood surface defects based on machine vision
CN120876428A (en) * 2025-07-24 2025-10-31 江苏富乐华半导体科技股份有限公司 Ceramic carrier plate crack defect detection system and method based on machine vision

Similar Documents

Publication Publication Date Title
CN119810080A (en) A stainless steel surface defect detection method based on machine vision
CN113592845A (en) Defect detection method and device for battery coating and storage medium
CN118967672A (en) Industrial defect detection method, system, device and storage medium
CN119444658A (en) A method for locating textile defects
Xu et al. Computerized classification of prostate cancer gleason scores from whole slide images
CN118527377A (en) Incomplete detection and removal device and method
CN118037091A (en) An intelligent work report quality inspection method and system based on computer vision technology
CN120088185B (en) Method and device for detecting printed matter
CN118506067B (en) Image processing method and system for power grid identification
Behara et al. Artificial intelligence in medical diagnostics: A review from a South African context
CN118761591B (en) Project matching method and system based on automatic data identification
CN118967690A (en) A defect detection method based on deep contrastive learning
CN119131006A (en) A ceramic defect intelligent detection method, system, device and storage medium based on deep learning
CN120102589A (en) Surface defect detection method and related equipment for touch screen
CN118691905A (en) Garbage classification data processing method and system based on AI recognition
CN118505708A (en) Product repairing system based on image reconstruction technology
CN107992863A (en) Multiresolution grain worm species visual identity method
CN118864845A (en) A method for identifying and segmenting characteristic regions of optical microscope images
EP4639464A1 (en) Method for image segmentation
CN114863428B (en) Lung brush cell recognition and segmentation method based on deep learning
CN119810426B (en) Plastic waste detection method, device, equipment and storage medium
CN120707568A (en) Intelligent detection method and system for cover film defects based on multi-feature fusion
CN119169298B (en) A target image segmentation method and system
CN118570244A (en) Automatic recognition system and method for billet bloom
Huang et al. A novel data augmentation method for few-shot industrial surface defect detection based on segment anything model adapter

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20250411

WW01 Invention patent application withdrawn after publication