CN117094975A - Method and device for detecting surface defects of steel and electronic equipment - Google Patents
Method and device for detecting surface defects of steel and electronic equipment Download PDFInfo
- Publication number
- CN117094975A CN117094975A CN202311068561.0A CN202311068561A CN117094975A CN 117094975 A CN117094975 A CN 117094975A CN 202311068561 A CN202311068561 A CN 202311068561A CN 117094975 A CN117094975 A CN 117094975A
- Authority
- CN
- China
- Prior art keywords
- image
- steel surface
- defect
- gray
- gray level
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/40—Image enhancement or restoration using histogram techniques
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/194—Segmentation; Edge detection involving foreground-background segmentation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30136—Metal
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Computing Systems (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Databases & Information Systems (AREA)
- Multimedia (AREA)
- Quality & Reliability (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Molecular Biology (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Image Analysis (AREA)
Abstract
本发明提供一种钢铁表面缺陷检测方法、装置及电子设备。该方法包括:根据待测钢铁表面图像的前景灰度均值和背景灰度均值,生成待测钢铁表面图像的二值化分割阈值;对待测钢铁表面图像依次进行灰度均衡化处理、滤波处理以及边缘增强处理,得到第一图像;利用二值化分割阈值对第一图像进行二值化处理,得到第二图像;根据第二图像和预先训练的缺陷检测模型,生成待测钢铁表面图像的缺陷检测结果;其中,缺陷检测模型是基于预设训练集训练得到的,预设训练集包括多张钢铁表面缺陷图像和钢铁表面无缺陷图像,钢铁表面缺陷图像对应有缺陷类型。本发明能够解决现有的缺陷检测方法无法满足实际工业生产中对钢铁表面缺陷检测的高速度要求的问题。
The invention provides a steel surface defect detection method, device and electronic equipment. The method includes: generating a binary segmentation threshold of the steel surface image to be tested based on the mean foreground grayscale and background grayscale of the steel surface image to be tested; sequentially performing grayscale equalization processing, filtering processing, and Edge enhancement processing is performed to obtain the first image; the first image is binarized using a binary segmentation threshold to obtain the second image; defects of the steel surface image to be tested are generated based on the second image and the pre-trained defect detection model Detection results; among them, the defect detection model is trained based on a preset training set. The preset training set includes multiple steel surface defect images and steel surface defect-free images. The steel surface defect images correspond to defective types. The invention can solve the problem that existing defect detection methods cannot meet the high-speed requirements for steel surface defect detection in actual industrial production.
Description
技术领域Technical field
本发明涉及钢铁检测技术领域,尤其涉及一种钢铁表面缺陷检测方法、装置及电子设备。The present invention relates to the technical field of steel detection, and in particular to a steel surface defect detection method, device and electronic equipment.
背景技术Background technique
钢铁作为一种重要的工业原材料,广泛应用于航空航天设备、汽车组件、工业设备等生产制备场景。因此,钢铁的质量直接决定了以其为原材料的工业成本的质量。为保证钢铁的质量,一般会检测钢铁表面是否存在缺陷,并以钢铁表面的缺陷程度去评估钢铁的质量。As an important industrial raw material, steel is widely used in production and preparation scenarios such as aerospace equipment, automotive components, and industrial equipment. Therefore, the quality of steel directly determines the quality of the industrial cost of using it as raw materials. In order to ensure the quality of steel, the steel surface is generally tested for defects, and the quality of the steel is evaluated based on the degree of defects on the steel surface.
目前,通常采用人工抽检的方式进行钢铁表面缺陷检测。然而,人工抽检的方式无法满足实际工业生产中对钢铁表面缺陷检测的高速度要求。At present, manual inspection is usually used to detect steel surface defects. However, manual sampling cannot meet the high-speed requirements for steel surface defect detection in actual industrial production.
发明内容Contents of the invention
本发明实施例提供了一种钢铁表面缺陷检测方法、装置及电子设备,以解决现有的缺陷检测方法无法满足实际工业生产中对钢铁表面缺陷检测的高速度要求的问题。Embodiments of the present invention provide a steel surface defect detection method, device and electronic equipment to solve the problem that existing defect detection methods cannot meet the high-speed requirements for steel surface defect detection in actual industrial production.
第一方面,本发明实施例提供了一种钢铁表面缺陷检测方法,包括:In a first aspect, embodiments of the present invention provide a steel surface defect detection method, including:
根据待测钢铁表面图像的前景灰度均值和背景灰度均值,生成待测钢铁表面图像的二值化分割阈值;According to the mean foreground gray value and background gray value of the steel surface image to be tested, the binary segmentation threshold of the steel surface image to be tested is generated;
对待测钢铁表面图像依次进行灰度均衡化处理、滤波处理以及边缘增强处理,得到第一图像;The image of the steel surface to be tested is subjected to grayscale equalization, filtering and edge enhancement in sequence to obtain the first image;
利用二值化分割阈值对第一图像进行二值化处理,得到第二图像;Binarize the first image using a binary segmentation threshold to obtain the second image;
根据第二图像和预先训练的缺陷检测模型,生成待测钢铁表面图像的缺陷检测结果;其中,缺陷检测模型是基于预设训练集训练得到的,预设训练集包括多张钢铁表面缺陷图像和钢铁表面无缺陷图像,钢铁表面缺陷图像对应有缺陷类型。According to the second image and the pre-trained defect detection model, a defect detection result of the steel surface image to be tested is generated; wherein, the defect detection model is trained based on a preset training set, and the preset training set includes multiple steel surface defect images and Images of steel surfaces without defects, and images of steel surface defects corresponding to defective types.
在一种可能的实现方式中,根据待测钢铁表面图像的前景灰度均值和背景灰度均值,生成待测钢铁表面图像的二值化分割阈值,包括:In a possible implementation, a binary segmentation threshold of the steel surface image to be tested is generated based on the foreground gray average and the background gray average of the steel surface image to be tested, including:
对待测钢铁表面图像进行前背景分割操作,得到前景区域和背景区域;Perform foreground and background segmentation operations on the steel surface image to be tested to obtain the foreground area and background area;
计算待测钢铁表面图像的平均灰度值、前景区域与待测钢铁表面图像的第一像素比值、背景区域与待测钢铁表面图像的第二像素比值;Calculate the average gray value of the steel surface image to be tested, the first pixel ratio of the foreground area and the steel surface image to be tested, and the second pixel ratio of the background area to the steel surface image to be tested;
根据平均灰度值和第一像素比值,得到前景灰度均值;According to the average gray value and the first pixel ratio, the average foreground gray value is obtained;
根据平均灰度值和第二像素比值,得到背景灰度均值;According to the average gray value and the second pixel ratio, the background gray mean value is obtained;
计算前景灰度均值和背景灰度均值的平均值,并将平均值定义为二值化分割阈值。Calculate the average value of the foreground gray value and the background gray value, and define the average value as the binary segmentation threshold.
在一种可能的实现方式中,利用二值化分割阈值对第一图像进行二值化处理,包括:In a possible implementation, the first image is binarized using a binary segmentation threshold, including:
将第一图像中大于二值化分割阈值的像素点所对应的灰度值设为第一灰度值;Set the grayscale value corresponding to the pixel point in the first image that is greater than the binary segmentation threshold as the first grayscale value;
将第一图像中小于二值化分割阈值的像素点所对应的灰度值设为第二灰度值。The grayscale value corresponding to the pixel point in the first image that is smaller than the binary segmentation threshold is set as the second grayscale value.
在一种可能的实现方式中,根据第二图像和预先训练的缺陷检测模型,生成待测钢铁表面图像的缺陷检测结果,包括:In a possible implementation, the defect detection results of the surface image of the steel to be tested are generated based on the second image and the pre-trained defect detection model, including:
对第二图像进行闭运算处理,得到闭运算图像;Perform closed operation processing on the second image to obtain a closed operation image;
对闭运算图像进行缺陷区域识别;Identify defective areas on closed operation images;
当闭运算图像中存在尺寸大于预设阈值的缺陷区域时,在待测钢铁表面图像中标记出与闭运算图像中的尺寸大于预设阈值的缺陷区域相对应的图像区域,并将标记后的待测钢铁表面图像输入至缺陷检测模型,得到待测钢铁表面图像对应的缺陷类型的缺陷检测结果;When there is a defective area in the closed operation image with a size larger than the preset threshold, the image area corresponding to the defective area in the closed operation image with a size larger than the preset threshold is marked in the steel surface image to be tested, and the marked area is The surface image of the steel to be tested is input into the defect detection model, and the defect detection results of the defect type corresponding to the surface image of the steel to be tested are obtained;
当闭运算图像中不存在尺寸大于预设阈值的缺陷区域时,生成待测钢铁表面图像为无缺陷的缺陷检测结果。When there is no defect area with a size larger than the preset threshold in the closed operation image, a defect detection result is generated that the surface image of the steel to be tested is defect-free.
在一种可能的实现方式中,对待测钢铁表面图像依次进行灰度均衡化处理、滤波处理以及边缘增强处理,得到第一图像,包括:In a possible implementation, the image of the steel surface to be tested is sequentially subjected to grayscale equalization processing, filtering processing and edge enhancement processing to obtain the first image, including:
根据待测钢铁表面图像的灰度直方图获取用于灰度均衡化处理的灰度映射关系,并根据灰度映射关系对待测钢铁表面图像进行灰度均衡化处理,得到第三图像;Obtain the grayscale mapping relationship for grayscale equalization processing based on the grayscale histogram of the steel surface image to be tested, and perform grayscale equalization processing on the steel surface image to be tested based on the grayscale mapping relationship to obtain the third image;
根据第三图像的空间临近度和第三图像的像素值相似度,获取用于滤波处理的卷积权值,并根据卷积权值对第三图像进行滤波处理,得到第四图像;According to the spatial proximity of the third image and the pixel value similarity of the third image, the convolution weight used for filtering is obtained, and the third image is filtered according to the convolution weight to obtain a fourth image;
获取用于边缘增强处理的第四图像的水平梯度图像和竖直梯度图像,并根据水平梯度图像和竖直梯度图像得到第一图像。The horizontal gradient image and the vertical gradient image of the fourth image used for edge enhancement processing are acquired, and the first image is obtained based on the horizontal gradient image and the vertical gradient image.
在一种可能的实现方式中,根据待测钢铁表面图像的灰度直方图获取用于灰度均衡化处理的灰度映射关系,并根据灰度映射关系对待测钢铁表面图像进行灰度均衡化处理,得到第三图像,包括:In one possible implementation, a grayscale mapping relationship for grayscale equalization processing is obtained based on the grayscale histogram of the steel surface image to be tested, and the grayscale equalization is performed on the steel surface image to be tested based on the grayscale mapping relationship. Process to obtain the third image, including:
将待测钢铁表面图像划分为若干个局部图像,获取所有局部图像对应的灰度直方图;其中,每个局部图像均对应一个灰度直方图,灰度直方图为局部图像中各个灰度级别对应的概率密度函数,灰度直方图的横坐标为局部图像中各个像素点的灰度级别,灰度直方图的纵坐标为各个灰度级别的像素点在局部图像中出现的频率;Divide the surface image of the steel to be tested into several partial images, and obtain the grayscale histograms corresponding to all partial images; among them, each partial image corresponds to a grayscale histogram, and the grayscale histogram is each grayscale level in the partial image. For the corresponding probability density function, the abscissa of the gray histogram is the gray level of each pixel in the local image, and the ordinate of the gray histogram is the frequency of occurrence of each gray level pixel in the local image;
对灰度直方图进行对比度限制处理,得到第二灰度直方图;Perform contrast limitation processing on the grayscale histogram to obtain a second grayscale histogram;
获取第二灰度直方图对应的累计概率密度函数,将累计概率密度函数与灰度级别总数进行计算,得到用于灰度均衡化处理的灰度映射关系;其中,累计概率密度函数为第二灰度直方图对应的第二概率密度函数的积分;Obtain the cumulative probability density function corresponding to the second grayscale histogram, calculate the cumulative probability density function and the total number of grayscale levels, and obtain the grayscale mapping relationship for grayscale equalization processing; wherein, the cumulative probability density function is the second grayscale histogram. The integral of the second probability density function corresponding to the grayscale histogram;
根据灰度映射关系对局部图像进行灰度均衡化处理,直到所有的局部图像处理完成;Perform grayscale equalization processing on the local image according to the grayscale mapping relationship until all local image processing is completed;
将所有处理后的局部图像进行整合,得到第三图像。All processed partial images are integrated to obtain a third image.
在一种可能的实现方式中,根据第三图像的空间临近度和第三图像的像素值相似度,获取用于滤波处理的卷积权值,并根据卷积权值对第三图像进行滤波处理,得到第四图像,包括:In a possible implementation, the convolution weight used for filtering is obtained according to the spatial proximity of the third image and the pixel value similarity of the third image, and the third image is filtered according to the convolution weight. After processing, the fourth image is obtained, including:
在第三图像中定义一个中心点;Define a center point in the third image;
计算第三图像中每个像素点到中心点的空间临近度,以及每个像素点与中心点的像素值相似度;Calculate the spatial proximity between each pixel in the third image and the center point, and the pixel value similarity between each pixel and the center point;
将每个像素点的空间临近度与像素值相似度相乘,得到每个像素点的卷积权值;Multiply the spatial proximity of each pixel and the pixel value similarity to obtain the convolution weight of each pixel;
根据每个像素点的卷积权值与每个像素点的像素值得到第四图像。The fourth image is obtained based on the convolution weight of each pixel and the pixel value of each pixel.
在一种可能的实现方式中,获取用于边缘增强处理的第四图像的水平梯度图像和竖直梯度图像,并根据水平梯度图像和竖直梯度图像得到第一图像,包括:In a possible implementation, obtaining the horizontal gradient image and the vertical gradient image of the fourth image used for edge enhancement processing, and obtaining the first image based on the horizontal gradient image and the vertical gradient image includes:
获取第四图像在水平方向所对应的水平矩阵,以及第四图像在竖直方向所对应的竖直矩阵;Obtain the horizontal matrix corresponding to the fourth image in the horizontal direction, and the vertical matrix corresponding to the fourth image in the vertical direction;
将水平矩阵与第四图像进行平面卷积计算,得到水平梯度图像;Perform planar convolution calculation on the horizontal matrix and the fourth image to obtain the horizontal gradient image;
将竖直矩阵与第四图像进行平面卷积计算,得到竖直梯度图像;Perform planar convolution calculation on the vertical matrix and the fourth image to obtain a vertical gradient image;
将水平梯度图像与竖直梯度图像进行按位或运算,得到第一图像。Perform a bitwise OR operation on the horizontal gradient image and the vertical gradient image to obtain the first image.
第二方面,本发明实施例提供了一种钢铁表面缺陷检测装置,包括:In a second aspect, embodiments of the present invention provide a steel surface defect detection device, including:
生成模块,用于根据待测钢铁表面图像的前景灰度均值和背景灰度均值,生成待测钢铁表面图像的二值化分割阈值;The generation module is used to generate the binary segmentation threshold of the steel surface image to be tested based on the foreground grayscale mean value and the background grayscale mean value of the steel surface image to be tested;
第一处理模块,用于对待测钢铁表面图像依次进行灰度均衡化处理、滤波处理以及边缘增强处理,得到第一图像;The first processing module is used to sequentially perform grayscale equalization processing, filtering processing and edge enhancement processing on the steel surface image to be tested to obtain the first image;
第二处理模块,用于利用二值化分割阈值对第一图像进行二值化处理,得到第二图像;The second processing module is used to perform binarization processing on the first image using the binarization segmentation threshold to obtain the second image;
检测模块,用于根据第二图像和预先训练的缺陷检测模型,生成待测钢铁表面图像的缺陷检测结果;其中,缺陷检测模型是基于预设训练集训练得到的,预设训练集包括多张钢铁表面缺陷图像和钢铁表面无缺陷图像,钢铁表面缺陷图像对应有缺陷类型。The detection module is used to generate defect detection results of the steel surface image to be tested based on the second image and a pre-trained defect detection model; wherein the defect detection model is trained based on a preset training set, and the preset training set includes multiple images The steel surface defect image and the steel surface defect-free image, the steel surface defect image corresponds to the defect type.
第三方面,本发明实施例提供了一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上第一方面或第一方面的任一种可能的实现方式所述的方法的步骤。In a third aspect, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program Implement the steps of the method described in the above first aspect or any possible implementation of the first aspect.
本发明实施例提供一种钢铁表面缺陷检测方法、装置及电子设备,其首先根据预先获取到的待测钢铁表面图像的前景灰度均值和背景灰度均值,生成待测钢铁表面图像的二值化分割阈值,之后通过对待测钢铁表面图像依次进行灰度均衡化处理、滤波处理以及边缘增强处理等预处理,得到第一图像,再通过得到的二值化分割阈值对第一图像进行二值化处理,得到像素只有黑白的第二图像,最后根据第二图像和预先训练完成的缺陷检测模型,得到待测钢铁表面图像的缺陷检测结果。Embodiments of the present invention provide a steel surface defect detection method, device and electronic equipment, which first generates a binary value of the steel surface image to be tested based on the foreground gray average and background gray average of the steel surface image to be tested that are obtained in advance segmentation threshold, and then perform pre-processing such as gray equalization, filtering, and edge enhancement on the steel surface image to be tested in order to obtain the first image, and then use the obtained binary segmentation threshold to binary the first image. processing to obtain a second image with only black and white pixels. Finally, based on the second image and the pre-trained defect detection model, the defect detection results of the steel surface image to be tested are obtained.
如此,通过合适的二值化分割阈值将待测钢铁表面图像进行二值化处理,可以使第一图像中的像素转换为黑色或白色,进而使第一图像的对比度增强、清晰度增强,达到缩短缺陷位置识别时间,加快缺陷检测过程的技术效果。且由于第二图像中只有两种颜色,而第二图像的组成颜色少也侧面说明了第二图像的数据量小,因此,后续图像处理的速度会明显快于未经过二值化处理的图像。此外,采用基于大量数据训练得到的缺陷检测模型得到的检测结果也更加精确。因此,本发明可以在实际工业生产中高速、精确的对钢铁表面的缺陷进行检测。In this way, by binary processing the steel surface image to be measured through an appropriate binary segmentation threshold, the pixels in the first image can be converted into black or white, thereby enhancing the contrast and clarity of the first image to achieve Shorten the defect location identification time and accelerate the technical effect of the defect detection process. And since there are only two colors in the second image, and the small number of colors in the second image also illustrates the small amount of data in the second image, the speed of subsequent image processing will be significantly faster than that of the image that has not been binarized. . In addition, the detection results obtained by using a defect detection model trained based on a large amount of data are also more accurate. Therefore, the present invention can detect defects on the steel surface at high speed and accurately in actual industrial production.
附图说明Description of the drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings in the following description are only illustrative of the present invention. For some embodiments, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1是本发明实施例提供的一种钢铁表面缺陷检测方法的实现流程图;Figure 1 is an implementation flow chart of a steel surface defect detection method provided by an embodiment of the present invention;
图2是本发明实施例提供的一种局部图像的灰度直方图的示意图;Figure 2 is a schematic diagram of a grayscale histogram of a partial image provided by an embodiment of the present invention;
图3是本发明实施例提供的一种灰度阈值设置及更新灰度直方图的示意图;Figure 3 is a schematic diagram of a grayscale threshold setting and updating a grayscale histogram provided by an embodiment of the present invention;
图4是本发明实施例提供的一种图像形态学闭运算处理前后的对照示意图;Figure 4 is a schematic comparison diagram before and after an image morphology closed operation process provided by an embodiment of the present invention;
图5是本发明实施例提供的一种二值矩阵的结构示意图;Figure 5 is a schematic structural diagram of a binary matrix provided by an embodiment of the present invention;
图6是本发明实施例提供的一种钢铁表面缺陷检测方法的具体实现流程图;Figure 6 is a specific implementation flow chart of a steel surface defect detection method provided by an embodiment of the present invention;
图7是本发明实施例提供的一种钢铁表面缺陷检测装置的结构示意图;Figure 7 is a schematic structural diagram of a steel surface defect detection device provided by an embodiment of the present invention;
图8是本发明实施例提供的一种电子设备的示意图。Figure 8 is a schematic diagram of an electronic device provided by an embodiment of the present invention.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本发明实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本发明。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本发明的描述。In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the present invention in unnecessary detail.
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图通过具体实施例来进行说明。In order to make the purpose, technical solutions and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.
钢铁的表面质量是钢铁最为重要的质量因素之一,钢铁表面质量的优劣直接影响其最终产品的性能与质量。然而在钢铁加工过程中,由于原材料或者工艺等原因,钢铁表面可能会出现结疤、裂纹、刮伤、孔洞或麻点等不同类型的缺陷。这些缺陷不仅影响产品的外观,而且还降低了产品的抗腐蚀性、耐磨性和疲劳强度等性能。因此,如何检测钢铁的表面缺陷,以提高钢铁的表面质量,是钢铁加工企业非常关注的问题。The surface quality of steel is one of the most important quality factors of steel. The surface quality of steel directly affects the performance and quality of its final product. However, during steel processing, different types of defects such as scars, cracks, scratches, holes or pitting may appear on the steel surface due to raw materials or processes. These defects not only affect the appearance of the product, but also reduce the corrosion resistance, wear resistance, fatigue strength and other properties of the product. Therefore, how to detect surface defects of steel to improve the surface quality of steel is a matter of great concern to steel processing enterprises.
但现有技术中采用人工抽检的方式对钢铁表面进行缺陷检测,不仅无法满足实际工业生产中对钢铁表面缺陷检测的高速度要求,还可能在检测过程中遗漏缺陷。可见,现有技术并不能满足高速场景下的高精度的缺陷检测。因此,本发明提供了一种可以解决现有技术问题的、适用于高速场景下的高精度的钢铁表面缺陷检测方法。However, the existing technology uses manual spot inspection to detect defects on the steel surface, which not only cannot meet the high-speed requirements for detecting steel surface defects in actual industrial production, but also may cause defects to be missed during the detection process. It can be seen that the existing technology cannot meet the high-precision defect detection in high-speed scenarios. Therefore, the present invention provides a high-precision steel surface defect detection method that can solve the problems of the existing technology and is suitable for high-speed scenarios.
图1为本发明实施例提供的钢铁表面缺陷检测方法的实现流程图,详述如下:Figure 1 is a flow chart of the implementation of the steel surface defect detection method provided by the embodiment of the present invention. The details are as follows:
步骤101,根据待测钢铁表面图像的前景灰度均值和背景灰度均值,生成待测钢铁表面图像的二值化分割阈值。Step 101: Generate a binary segmentation threshold of the steel surface image to be tested based on the mean foreground gray value and background gray value of the steel surface image to be tested.
在一些实施例中,获取待测钢铁表面图像可以通过1、划分钢铁表面。2、采用普通相机对每个划分的区域进行拍摄。3、将获取到的所有图像整合,得到待测钢铁表面图像。除上述方法外,也可以通过线扫相机获取待测钢铁表面图像。In some embodiments, obtaining the surface image of the steel to be measured can be obtained by 1. dividing the surface of the steel. 2. Use an ordinary camera to shoot each divided area. 3. Integrate all the acquired images to obtain the surface image of the steel to be tested. In addition to the above methods, the surface image of the steel to be tested can also be obtained through a line scan camera.
需要说明的是,线扫相机的原理为相机与被拍摄物体做相对匀速运动,从而得到完整的、清晰的被拍摄物体的图像。由于线扫相机的结构简单、成本低以及灵活度高,因此,本发明优先采用线扫相机获取待测钢铁表面图像。It should be noted that the principle of a line scan camera is that the camera and the object being photographed move relatively uniformly, thereby obtaining a complete and clear image of the object being photographed. Due to the simple structure, low cost and high flexibility of the line scan camera, the present invention preferentially uses the line scan camera to obtain the surface image of the steel to be measured.
在一些实施例中,可以采用前背景分割模型对待测钢铁表面图像进行前背景分割,得到待测钢铁表面图像的前景区域和背景区域,进而计算得到前景灰度均值和背景灰度均值。In some embodiments, a foreground and background segmentation model can be used to perform foreground and background segmentation on the steel surface image to be measured, to obtain the foreground area and background area of the steel surface image to be measured, and then calculate the foreground grayscale mean and background grayscale mean.
在一些实施例中,可以采用多张已有的钢铁表面图像、钢铁表面图像的前景区域以及钢铁表面图像的背景区域对前背景分割模型进行训练,以保证前背景分割模型的精确度。In some embodiments, multiple existing steel surface images, the foreground area of the steel surface image, and the background area of the steel surface image can be used to train the foreground and background segmentation model to ensure the accuracy of the foreground and background segmentation model.
在一种可能实施方式中,本发明并不限制前背景分割模型所采用的算法类型,例如,可以采用全卷积神经网络作为前背景分割模型的算法框架。In a possible implementation, the present invention does not limit the type of algorithm used in the foreground and background segmentation model. For example, a fully convolutional neural network can be used as the algorithm framework of the foreground and background segmentation model.
在一些实施例中,将待测钢铁表面图像分割为前景区域和背景区域之后,可通过待测钢铁表面图像整张图像的总平均灰度值,以及前景区域、背景区域与整张图像的占比关系得到前景灰度均值和背景灰度均值。其具体实施方式可以为:In some embodiments, after the steel surface image to be measured is divided into a foreground area and a background area, the total average gray value of the entire image of the steel surface image to be measured can be used, as well as the proportion of the foreground area, background area and the entire image. The ratio relationship is used to obtain the mean foreground gray level and the mean background gray level. Its specific implementation can be:
1、计算待测钢铁表面图像整张图像的总平均灰度值。1. Calculate the total average gray value of the entire image of the steel surface image to be tested.
2、计算前景区域中像素点占总像素点的第一像素比值。2. Calculate the first pixel ratio of the pixels in the foreground area to the total pixels.
3、计算背景区域中像素点占总像素点的第二像素比值。3. Calculate the second pixel ratio of the pixels in the background area to the total pixels.
4、将总平均灰度值分别与第一像素比值、第二像素比值相乘,得到待测钢铁表面图像的前景灰度均值和背景灰度均值。4. Multiply the total average gray value by the first pixel ratio and the second pixel ratio respectively to obtain the foreground gray mean and background gray mean of the steel surface image to be tested.
在一些实施例中,二值化分割阈值可以为前景灰度均值和背景灰度均值的平均值。In some embodiments, the binary segmentation threshold may be the average of the foreground grayscale mean and the background grayscale mean.
在一些实施例中,获取二值化分割阈值可以为后续的二值化处理时提供参数数据,从而方便后续图像处理,以提高待测钢铁表面图像的缺陷检测速度。In some embodiments, obtaining the binary segmentation threshold can provide parameter data for subsequent binarization processing, thereby facilitating subsequent image processing and improving the defect detection speed of the steel surface image to be tested.
具体的,步骤101的具体实施步骤可以包括:Specifically, the specific implementation steps of step 101 may include:
1、对前背景分割模型进行训练,得到训练完成的前背景分割模型。1. Train the foreground and background segmentation model to obtain the trained foreground and background segmentation model.
2、采用线扫相机获取待测钢铁的待测钢铁表面图像。2. Use a line scan camera to obtain the surface image of the steel to be tested.
3、采用前背景分割模型将待测钢铁表面图像分割为前景区域和背景区域。3. Use the foreground and background segmentation model to segment the steel surface image to be tested into a foreground area and a background area.
4、计算待测钢铁表面图像的总平均灰度值,计算前景区域中像素点占总像素点的第一像素比值,以及背景区域中像素点占总像素点的第二像素比值。例如,假设前景区域中的像素点为50,背景区域中的像素点为100,总像素点为200,则第一像素比值为0.25,第二像素比值为0.5。4. Calculate the total average gray value of the steel surface image to be tested, calculate the first pixel ratio of pixels in the foreground area to the total pixels, and the second pixel ratio of the pixels in the background area to the total pixels. For example, assuming that the pixel points in the foreground area are 50, the pixel points in the background area are 100, and the total pixel points are 200, then the first pixel ratio is 0.25 and the second pixel ratio is 0.5.
5、将第一像素比值与总平均灰度值相乘得到前景灰度均值,将第二像素比值与总平均灰度相乘得到背景灰度均值。例如,假设总平均灰度值为50,则前景灰度均值为12.5,背景灰度均值为25。5. Multiply the first pixel ratio and the total average gray value to obtain the foreground gray average, and multiply the second pixel ratio and the total average gray to obtain the background gray average. For example, assuming that the overall average gray value is 50, the average foreground gray value is 12.5 and the average background gray value is 25.
6、计算前景灰度均值和背景灰度均值的平均值,并将该平均值作为二值化分割阈值。例如,按照上述计算,二值化分割阈值为即18.75。6. Calculate the average of the foreground gray average and the background gray average, and use this average as the binary segmentation threshold. For example, according to the above calculation, the binary segmentation threshold is That is 18.75.
步骤102,对待测钢铁表面图像依次进行灰度均衡化处理、滤波处理以及边缘增强处理,得到第一图像。Step 102, perform grayscale equalization processing, filtering processing and edge enhancement processing in sequence on the steel surface image to be tested to obtain the first image.
具体的,本发明提供的灰度均衡化处理的主要技术特征是将一幅图像的直方图分布转变为近似均匀分布,从而增加图像的对比度。Specifically, the main technical feature of the grayscale equalization process provided by the present invention is to transform the histogram distribution of an image into an approximately uniform distribution, thereby increasing the contrast of the image.
首先对灰度均衡化处理进行介绍。具体的,灰度均衡化处理的具体实施步骤可以为步骤201-204:First, the grayscale equalization process is introduced. Specifically, the specific implementation steps of the gray level equalization process may be steps 201-204:
步骤201,将待测钢铁表面图像划分为若干个局部图像,获取所有局部图像对应的灰度直方图。Step 201: Divide the surface image of the steel to be tested into several partial images, and obtain the grayscale histograms corresponding to all partial images.
在一些实施例中,将待测钢铁表面图像划分为若干个局部图像,可以对每个局部图像做出相应的处理,得到更加精确、美观的灰度均衡化处理后的图像。In some embodiments, the surface image of the steel to be measured is divided into several partial images, and each partial image can be processed accordingly to obtain a more accurate and beautiful grayscale equalized image.
在一些实施例中,本发明并不限制局部图像的具体尺寸大小,但划分得到的局部图像的尺寸大小应该处于适中范围,不应过小或过大。In some embodiments, the present invention does not limit the specific size of the partial image, but the size of the divided partial image should be in a moderate range and should not be too small or too large.
在一些实施例中,灰度直方图是反映一幅图像中各个灰度级别像素点出现的频率与灰度级别的关系。因此,应用到本发明中,灰度直方图的横坐标可以为局部图像中各个像素点的灰度级别,灰度直方图的纵坐标可以为各个灰度级别的像素点在局部图像中出现的频率,且每个局部图像均对应一个灰度直方图。In some embodiments, the grayscale histogram reflects the relationship between the frequency of occurrence of each grayscale pixel point in an image and the grayscale level. Therefore, when applied to the present invention, the abscissa of the gray histogram can be the gray level of each pixel point in the local image, and the ordinate of the gray histogram can be the pixel point of each gray level appearing in the local image. frequency, and each local image corresponds to a grayscale histogram.
需要说明的是,灰度直方图也可以看作局部图像中各个灰度级别对应的概率密度函数。It should be noted that the grayscale histogram can also be regarded as the probability density function corresponding to each grayscale level in the local image.
因此,可以根据计算各个灰度级别对应的概率密度。式中,P表示概率密度函数,i表示当前灰度级别,ni表示灰度级别为当前灰度级别的像素点个数,L表示灰度级别总数,n表示像素点的总个数。Therefore, it can be based on Calculate the probability density corresponding to each gray level. In the formula, P represents the probability density function, i represents the current gray level, n i represents the number of pixels whose gray level is the current gray level, L represents the total number of gray levels, and n represents the total number of pixels.
为更加确切的表达出灰度直方图的概率,下面以一个具体的实施例来解释灰度直方图:In order to express the probability of the grayscale histogram more accurately, the following uses a specific embodiment to explain the grayscale histogram:
在一些实施例中,假设某个局部图像中共有36个像素点,其中,灰度级别为1的像素点有6个,灰度级别为2的像素点有4个,灰度级别为3的像素点有6个,灰度级别为4的像素点有6个,灰度级别为5的像素点有2个,灰度级别为6的像素点有12个。可见,灰度级别为1的像素点的频率为灰度级别为2的像素点的频率为/>灰度级别为3的像素点的频率为/>灰度级别为4的像素点的频率为/>灰度级别为5的像素点的频率为/>灰度级别为6的像素点的频率为/>根据各个灰度级别对应的频率得到了如图2所示的当前假设下该局部图像的灰度直方图。In some embodiments, it is assumed that there are 36 pixels in a certain local image, among which there are 6 pixels with gray level 1, 4 pixels with gray level 2, and 3 pixels. There are 6 pixels, 6 pixels with gray level 4, 2 pixels with gray level 5, and 12 pixels with gray level 6. It can be seen that the frequency of pixels with gray level 1 is The frequency of pixels with gray level 2 is/> The frequency of pixels with gray level 3 is/> The frequency of pixels with gray level 4 is/> The frequency of pixels with gray level 5 is/> The frequency of pixels with gray level 6 is/> According to the frequency corresponding to each gray level, the gray histogram of the local image under the current hypothesis is obtained as shown in Figure 2.
步骤202,对灰度直方图进行对比度限制处理,得到第二灰度直方图。Step 202: Perform contrast limitation processing on the grayscale histogram to obtain a second grayscale histogram.
在一些实施例中,如图3所示,对比度限制处理可以理解为在灰度直方图中设置一个灰度阈值,并在灰度直方图中存在概率密度大于灰度阈值的像素点时,将像素点平均分配给各个灰度级别。之后再基于分配后的各个灰度级别的像素点在局部图像中出现的频率更新灰度直方图,得到第二灰度直方图。In some embodiments, as shown in Figure 3, contrast limitation processing can be understood as setting a grayscale threshold in the grayscale histogram, and when there are pixels with a probability density greater than the grayscale threshold in the grayscale histogram, Pixels are evenly distributed to each gray level. Then, the grayscale histogram is updated based on the frequency of occurrence of the assigned pixels of each grayscale level in the local image to obtain a second grayscale histogram.
在一种可能实施方式中,通过重新分配局部图像的像素点,可以使一定灰度级别范围内的像素点的数量大致相同,从而方便后续均衡化的操作。In one possible implementation, by redistributing the pixels of the local image, the number of pixels within a certain gray level range can be made approximately the same, thereby facilitating subsequent equalization operations.
需要说明的是,本发明并不限制灰度阈值的具体取值,例如,可以为25%、30%或27%等。It should be noted that the present invention does not limit the specific value of the grayscale threshold, for example, it can be 25%, 30% or 27%.
步骤203,获取第二灰度直方图对应的累计概率密度函数,将累计概率密度函数与灰度级别总数进行计算,得到用于灰度均衡化处理的灰度映射关系。Step 203: Obtain the cumulative probability density function corresponding to the second grayscale histogram, calculate the cumulative probability density function and the total number of grayscale levels, and obtain a grayscale mapping relationship for grayscale equalization processing.
在一些实施例中,累计概率密度函数为第二灰度直方图对应的第二概率密度函数的积分。In some embodiments, the cumulative probability density function is the integral of the second probability density function corresponding to the second grayscale histogram.
需要说明的是,在求得第二灰度直方图对应的累计概率密度函数后,还需将上述累计概率密度函数归一化到(0,L-1)范围之间。It should be noted that after obtaining the cumulative probability density function corresponding to the second grayscale histogram, the above cumulative probability density function also needs to be normalized to the range of (0, L-1).
在一种可能实施方式中,通过将累计概率密度函数归一化到(0,L-1)范围之间可以实现将第二直方图从比较集中的某个灰度级别区间变成在全部灰度级别范围内的均匀分布。In a possible implementation, by normalizing the cumulative probability density function to the range of (0, L-1), the second histogram can be changed from a certain gray level interval in the comparison set to one in all gray levels. Uniform distribution within the range of degree levels.
在一些实施例中,灰度映射关系可以通过累计概率密度函数与灰度级别总数的相乘得到。In some embodiments, the grayscale mapping relationship can be obtained by multiplying the cumulative probability density function and the total number of grayscale levels.
步骤204,根据灰度映射关系对局部图像进行灰度均衡化处理,直到所有的局部图像处理完成。Step 204: perform grayscale equalization processing on the local image according to the grayscale mapping relationship until all local image processing is completed.
在一些实施例中,步骤201已说明每个局部图像均对应一个灰度直方图,因此,每个局部图像也均对应着一个灰度映射关系。可见,每个局部图像对应的灰度映射关系可能是不同的。因此,在实际应用中,局部图像需与其对应的灰度映射关系进行运算,以得到处理后的局部图像。In some embodiments, step 201 has stated that each partial image corresponds to a grayscale histogram, and therefore, each partial image also corresponds to a grayscale mapping relationship. It can be seen that the grayscale mapping relationship corresponding to each local image may be different. Therefore, in practical applications, the partial image needs to be calculated on its corresponding grayscale mapping relationship to obtain the processed partial image.
步骤205,将所有处理后的局部图像进行整合,得到第三图像。Step 205: Integrate all processed partial images to obtain a third image.
在一些实施例中,按照步骤201中的划分的规则将所有处理后的局部图像进行整合,即得到灰度均衡化的待测钢铁表面图像。In some embodiments, all processed partial images are integrated according to the division rules in step 201, that is, a grayscale equalized image of the steel surface to be tested is obtained.
前述内容介绍了灰度均衡化处理,下面对滤波处理进行介绍。The foregoing content introduces the grayscale equalization process, and the filtering process is introduced below.
在一些实施例中,由于传输介质和记录设备等的不完善,图像在其传输记录过程中往往会收到多种噪声的污染。因此,在图像处理过程中是有必要对图像进行滤波处理的。需要说明的是,滤波处理也可以看作去噪处理,是对图像进行去噪、平滑的一种技术手段。In some embodiments, due to imperfections in transmission media and recording equipment, images are often contaminated by various noises during their transmission and recording process. Therefore, it is necessary to filter the image during image processing. It should be noted that filtering processing can also be regarded as denoising processing, which is a technical means to denoise and smooth images.
具体的,滤波处理的具体实施步骤可以为步骤301-304:Specifically, the specific implementation steps of the filtering process may be steps 301-304:
步骤301,在第三图像中定义一个中心点。Step 301: Define a center point in the third image.
在一些实施例中,本发明并不限制中心点的具体选择位置,但中心点应该从第三图像中位置适中的区域选取,不应过度偏向某一方向。In some embodiments, the present invention does not limit the specific selection position of the center point, but the center point should be selected from a moderately located area in the third image and should not be excessively biased in a certain direction.
步骤302,计算第三图像中每个像素点到中心点的空间临近度,以及每个像素点与中心点的像素值相似度。Step 302: Calculate the spatial proximity between each pixel in the third image and the center point, and the pixel value similarity between each pixel and the center point.
在一些实施例中,可以根据计算每个像素点到中心点的空间临近度,以及每个像素点与中心点的像素值相似度。式中,ws表示空间临近度,wr表示像素值相似度,(k,l)表示像素点,(x,y)表示中心点,f(k,l)表示像素点的像素值,f(x,y)表示中心点的像素值,e表示自然对数的底数。In some embodiments, it can be based on Calculate the spatial proximity of each pixel to the center point, and the pixel value similarity between each pixel and the center point. In the formula, w s represents the spatial proximity, w r represents the pixel value similarity, (k, l) represents the pixel point, (x, y) represents the center point, f (k, l) represents the pixel value of the pixel point, f (x,y) represents the pixel value of the center point, and e represents the base of the natural logarithm.
步骤303,将每个像素点的空间临近度与像素值相似度相乘,得到每个像素点的卷积权值;Step 303: Multiply the spatial proximity of each pixel by the pixel value similarity to obtain the convolution weight of each pixel;
在一些实施例中,可以根据w(x,y,k,l)=ws(x,y,k,l)×wr(x,y,k,l)得到每个像素点的卷积权值。式中,w表示卷积权值。In some embodiments, the convolution of each pixel can be obtained according to w (x, y, k, l) = w s (x, y, k, l) × w r (x, y, k, l) weight. In the formula, w represents the convolution weight.
步骤304,根据每个像素点的卷积权值与每个像素点的像素值得到第四图像。Step 304: Obtain a fourth image based on the convolution weight of each pixel and the pixel value of each pixel.
在一些实施例中,可以通过以下步骤得到第四图像:1、计算第三图像中所有像素点的像素值与卷积权值的乘积,并将所有乘积相加得到乘积和;2、计算所有卷积权值的和;3、将乘积和与卷积权值的和作比,得到第四图像。In some embodiments, the fourth image can be obtained through the following steps: 1. Calculate the product of the pixel values of all pixels in the third image and the convolution weight, and add all the products to obtain the sum of products; 2. Calculate all The sum of the convolution weights; 3. Compare the sum of the products with the sum of the convolution weights to obtain the fourth image.
具体的,上述步骤的公式可以为:式中,g(x,y)表示第四图像,S(x,y)表示以(x,y)为中心的(2N+1)*(2N+1)范围内的区域。Specifically, the formula for the above steps can be: In the formula, g(x,y) represents the fourth image, and S(x,y) represents the area within the range of (2N+1)*(2N+1) centered on (x,y).
需要说明的是,上述S(x,y)在本发明中可以指代为第三图像所在区域。It should be noted that the above S(x,y) may refer to the area where the third image is located in the present invention.
在一些实施例中,由于滤波处理后的第四图像可能比较平滑,缺陷的边缘性不强。因此,可以将边缘增强处理与滤波处理相结合,达到去除图像中的噪声以及加强缺陷区域边缘的技术效果。In some embodiments, since the fourth image after filtering may be relatively smooth, the edges of the defects are not strong. Therefore, edge enhancement processing and filtering processing can be combined to achieve the technical effects of removing noise in the image and enhancing the edges of defective areas.
前述内容介绍了滤波处理,下面对边缘增强处理进行介绍。The foregoing content introduces the filtering process, and the edge enhancement process is introduced below.
在一些实施例中,本发明提供的边缘增强处理的主要技术内容可以为在图像的水平方向和竖直方向使用算子进行卷积计算,得到两个方向的梯度结果,通过将两个方向的梯度结果进行结合,实现缺陷区域的边缘增强。In some embodiments, the main technical content of the edge enhancement processing provided by the present invention can be to use operators to perform convolution calculations in the horizontal and vertical directions of the image to obtain gradient results in two directions. The gradient results are combined to achieve edge enhancement of defective areas.
具体的,边缘增强处理的具体实施步骤可以为步骤401-404:Specifically, the specific implementation steps of edge enhancement processing may be steps 401-404:
步骤401,获取第四图像在水平方向所对应的水平矩阵,以及第四图像在竖直方向所对应的竖直矩阵。Step 401: Obtain the horizontal matrix corresponding to the fourth image in the horizontal direction and the vertical matrix corresponding to the fourth image in the vertical direction.
在一些实施例中,由于边缘增强处理是使用算子对图像进行卷积计算,因此,第四图像所对应的水平矩阵和竖直矩阵的内部参数是由算子的类型决定的。In some embodiments, since the edge enhancement process uses an operator to perform convolution calculation on the image, the internal parameters of the horizontal matrix and the vertical matrix corresponding to the fourth image are determined by the type of the operator.
在一些实施例中,以Sobel算子为例,第四图像对应的水平矩阵可以为第四图像对应的竖直矩阵可以为/> In some embodiments, taking the Sobel operator as an example, the horizontal matrix corresponding to the fourth image can be The vertical matrix corresponding to the fourth image can be/>
步骤402,将水平矩阵与第四图像进行平面卷积计算,得到水平梯度图像。Step 402: Perform planar convolution calculation on the horizontal matrix and the fourth image to obtain a horizontal gradient image.
在一些实施例中,可以根据得到水平梯度图像。式中,X(x,y)表示水平梯度图像。In some embodiments, it can be based on Get a horizontal gradient image. In the formula, X(x,y) represents the horizontal gradient image.
在一些实施例中,将水平矩阵与第四图像进行平面卷积计算相当于采用水平矩阵提取水平方向的边缘。In some embodiments, performing planar convolution calculation on the horizontal matrix and the fourth image is equivalent to using the horizontal matrix to extract edges in the horizontal direction.
步骤403,将竖直矩阵与第四图像进行平面卷积计算,得到竖直梯度图像。Step 403: Perform planar convolution calculation on the vertical matrix and the fourth image to obtain a vertical gradient image.
在一些实施例中,可以根据得到竖直梯度图像。式中,Y(x,y)表示竖直梯度图像。In some embodiments, it can be based on Get a vertical gradient image. In the formula, Y(x,y) represents the vertical gradient image.
在一些实施例中,将竖直矩阵与第四图像进行平面卷积计算相当于采用竖直矩阵提取竖直方向的边缘。In some embodiments, performing planar convolution calculation on the vertical matrix and the fourth image is equivalent to using the vertical matrix to extract edges in the vertical direction.
步骤404,将水平梯度图像与竖直梯度图像进行按位或运算,得到第一图像。Step 404: Perform a bitwise OR operation on the horizontal gradient image and the vertical gradient image to obtain the first image.
在一些实施例中,可以根据得到第一图像。式中,G(x,y)表示第一图像,/>表示按位或运算。In some embodiments, it can be based on Get the first image. In the formula, G(x,y) represents the first image,/> Represents bitwise OR operation.
在一些实施例中,综合水平方向和竖直方向的边缘信息可以得到整幅图像的边缘,突出缺陷区域与背景的分界,使后续对缺陷区域的定位、标记更加简单。In some embodiments, the edge information of the entire image can be obtained by combining the edge information in the horizontal and vertical directions, highlighting the boundary between the defective area and the background, making subsequent positioning and marking of the defective area simpler.
步骤103,利用二值化分割阈值对第一图像进行二值化处理,得到第二图像。Step 103: Binarize the first image using a binary segmentation threshold to obtain a second image.
在一些实施例中,二值化处理的具体步骤可以为:1、将第一图像中大于二值化分割阈值的像素点所对应的灰度值设为第一灰度值。2、将第一图像中小于二值化分割阈值的像素点所对应的灰度值设为第二灰度值。In some embodiments, the specific steps of the binarization process may be: 1. Set the grayscale value corresponding to the pixel point in the first image that is greater than the binary segmentation threshold as the first grayscale value. 2. Set the gray value corresponding to the pixel point in the first image that is smaller than the binary segmentation threshold as the second gray value.
需要说明的是,为使二值化处理后的第一图像的对比度更高,且参考灰度值的取值范围,第一灰度值的取值可以为255,第二灰度值的取值可以为0。It should be noted that, in order to make the contrast of the first image after binarization processing higher, and with reference to the value range of the gray value, the value of the first gray value can be 255, and the value of the second gray value can be 255. The value can be 0.
在一种可能的实施方式中,对第一图像进行二值化处理,可以使第一图像中的像素转换为黑色或白色,从而使第一图像的对比度增强、清晰度增强。此外,由于第二图像中只有两种颜色,因此,相较之前的图像,第二图像的数据量也会减小。In a possible implementation, binarizing the first image can convert the pixels in the first image to black or white, thereby enhancing the contrast and clarity of the first image. In addition, since there are only two colors in the second image, the data amount of the second image will also be reduced compared to the previous image.
值得一提的是,第二图像的数据量小也会侧面说明后续图像处理的速度会快于未二值化处理的图像。因此,对第一图像进行二值化处理可以落实本发明适用于高速场景的技术效果。It is worth mentioning that the small amount of data in the second image also indicates that the speed of subsequent image processing will be faster than that of images that are not binarized. Therefore, performing binarization processing on the first image can achieve the technical effect of the present invention being suitable for high-speed scenes.
步骤104,根据第二图像和预先训练的缺陷检测模型,生成待测钢铁表面图像的缺陷检测结果;其中,缺陷检测模型是基于预设训练集训练得到的,预设训练集包括多张钢铁表面缺陷图像和钢铁表面无缺陷图像,钢铁表面缺陷图像对应有缺陷类型。Step 104: Generate defect detection results of the steel surface image to be tested based on the second image and the pre-trained defect detection model; wherein the defect detection model is trained based on a preset training set, and the preset training set includes multiple steel surfaces. The defect image and the steel surface defect-free image, the steel surface defect image corresponds to the defect type.
前述内容介绍了边缘增强处理,下面对形态学闭运算处理进行介绍。The foregoing content introduces edge enhancement processing, and the morphological closing operation processing is introduced below.
在一些实施例中,为使输入至缺陷检测模型中的图像更加精确,还可以对第二图像进行形态学闭运算处理,得到闭运算图像。如图4所示的图像形态学闭运算处理前后的对照示意图,图a为形态学闭运算处理前的图像,图b为形态学闭运算处理后的图像,图a和图b中的白色部分为缺陷区域,黑色部分为无缺陷区域。可见,进行形态学闭运算处理不仅可以去除第二图像背景中的小型噪声,还可以填充连通区域中的小型孔洞、断开较少部分连接的相邻物体。In some embodiments, in order to make the image input into the defect detection model more accurate, the second image may also be subjected to morphological closed operation processing to obtain a closed operation image. As shown in Figure 4, the comparison diagram before and after the image morphological closing operation is processed. Picture a is the image before the morphological closing operation. Picture b is the image after the morphological closing operation. The white parts in pictures a and b are is the defective area, and the black part is the defect-free area. It can be seen that performing morphological closing operation processing can not only remove small noise in the background of the second image, but also fill small holes in connected areas and disconnect adjacent objects with fewer connections.
具体的,形态学闭运算处理的具体实施步骤可以为步骤501-503:Specifically, the specific implementation steps of the morphological closing operation processing may be steps 501-503:
步骤501,定义一个二值矩阵,该二值矩阵由结构元素组成。如图5所示的二值矩阵的结构示意图,图中黑色部分表示结构元素的有效部分,取值为1,图中白色部分表示结构元素的无效部分,取值为0。Step 501: Define a binary matrix composed of structural elements. As shown in Figure 5, the structural diagram of a binary matrix is shown. The black part in the figure represents the effective part of the structural element, and the value is 1. The white part in the figure represents the ineffective part of the structural element, and the value is 0.
步骤502,采用结构元素对第二图像进行膨胀操作。即采用结构元素从第二图像中的每个像素点开始移动,对第二图像进行卷积。Step 502: Use structural elements to expand the second image. That is, structural elements are used to move from each pixel point in the second image to convolve the second image.
需要说明的是,对于膨胀操作过程中的每个像素点来说,只要结构元素与某个像素点的周围像素点相交的部分中,有至少一个像素点的像素值为非零,就将该像素点的像素值设为1。It should be noted that for each pixel during the expansion operation, as long as the pixel value of at least one pixel in the portion where the structural element intersects with the surrounding pixels of a certain pixel is non-zero, the pixel will be The pixel value of the pixel is set to 1.
步骤503,采用结构元素对膨胀后的第二图像进行腐蚀操作。即采用结构元素从膨胀后的第二图像中的每个像素点开始移动,对膨胀后的第二图像进行卷积。Step 503: Use structural elements to perform an erosion operation on the expanded second image. That is, the structural elements are used to move from each pixel point in the expanded second image, and the expanded second image is convolved.
需要说明的是,对于腐蚀操作过程中的每个像素点来说,只有某个像素点的邻近区域与结构元素的相交部分中的所有像素点的像素值都为非零时,才可以将该像素点的像素值设为1;否则,则将该像素点的像素值设为0。It should be noted that for each pixel during the erosion operation, only when the pixel values of all pixels in the intersection between the adjacent area of a pixel and the structural element are non-zero, the pixel can be converted into a pixel. The pixel value of the pixel is set to 1; otherwise, the pixel value of the pixel is set to 0.
在一些实施例中,缺陷检测模型的训练过程可以为:1、基于预设训练集训练缺陷检测模型。该预设训练集中包括多张钢铁表面缺陷图像和钢铁表面无缺陷图像,以及钢铁表面缺陷图像对应的缺陷类型。2、基于预设训练集和应用场景对缺陷检测模型的参数进行调整以及优化,得到训练完成的缺陷检测模型。In some embodiments, the training process of the defect detection model may be: 1. Train the defect detection model based on a preset training set. The preset training set includes multiple steel surface defect images and steel surface defect-free images, as well as defect types corresponding to the steel surface defect images. 2. Adjust and optimize the parameters of the defect detection model based on the preset training set and application scenarios to obtain the trained defect detection model.
需要说明的是,缺陷检测模型可以是一种深度学习模型,且在训练时间不充足的情况下,还可以根据迁移学习来缩短缺陷检测模型的训练过程。It should be noted that the defect detection model can be a deep learning model, and when the training time is insufficient, transfer learning can also be used to shorten the training process of the defect detection model.
需要说明的是,假设缺陷检测模型是深度学习模型,在实际训练过程中,由于个别缺陷区域尺寸的差异较大,因此,为提升缺陷检测模型对各个尺寸的缺陷区域的特征提取能力,可以将深度学习模型的颈部结构即特征金字塔网络替换为Inception块。It should be noted that assuming that the defect detection model is a deep learning model, during the actual training process, due to the large differences in the sizes of individual defect areas, in order to improve the feature extraction capabilities of the defect detection model for defect areas of various sizes, you can The neck structure of the deep learning model, that is, the feature pyramid network, is replaced with the Inception block.
在一些实施例中,在得到闭运算图像后,可以对闭运算图像进行缺陷区域识别。In some embodiments, after obtaining the closed operation image, defective area identification can be performed on the closed operation image.
具体的,当闭运算图像中不存在尺寸大于预设阈值的缺陷区域,且该闭运算图像所对应的待测钢铁表面图像与钢铁表面无缺陷图像的相似度大于第一预设值时,确定该闭运算图像对应的待测钢铁表面图像无缺陷。Specifically, when there is no defect area with a size larger than a preset threshold in the closed operation image, and the similarity between the steel surface image to be tested corresponding to the closed operation image and the defect-free steel surface image is greater than the first preset value, it is determined The surface image of the steel to be tested corresponding to the closed operation image has no defects.
在一种可能的实施方式中,本发明并不限制第一预设值的取值。例如,第一预设值可以为90%、95%或96%等。In a possible implementation, the present invention does not limit the value of the first preset value. For example, the first preset value may be 90%, 95% or 96%, etc.
在一些实施例中,在闭运算图像中存在尺寸大于预设阈值的缺陷区域的情况下时,可以参考闭运算图像中缺陷区域的位置在待测钢铁表面图像标记缺陷区域的位置,并将标记后的待测钢铁表面图像保存至可疑图像队列,之后输入至缺陷检测模型中,得到待测钢铁表面图像对应的缺陷类型的缺陷检测结果。In some embodiments, when there is a defective area with a size larger than a preset threshold in the closed operation image, the location of the defective area in the closed operation image can be marked on the steel surface image to be tested by referring to the position of the defective area, and the mark can be The final surface image of the steel to be tested is saved to the suspicious image queue, and then input into the defect detection model to obtain the defect detection results of the defect type corresponding to the surface image of the steel to be tested.
在一种可能的实施方式中,在原图中标记缺陷区域,之后输入至缺陷检测模型中,不仅可以实现对缺陷所在位置的初步定位,节省检测过程中的缺陷定位时间,还可以从源头上保证图像以及缺陷结果的准确性,解决将处理后的图像输入至缺陷检测模型中可能会带来的检测误差的问题。In one possible implementation, marking the defect area in the original image and then inputting it into the defect detection model can not only achieve preliminary positioning of the location of the defect, save defect positioning time during the detection process, but also ensure safety from the source. The accuracy of images and defect results solves the problem of detection errors that may be caused by inputting processed images into the defect detection model.
具体的,当闭运算图像中存在尺寸大于预设阈值的缺陷区域,且标记的缺陷区域是钢铁表面缺陷图像的相似度大于第二预设值时,生成该闭运算图像对应的待测钢铁表面图像对应的缺陷类型的缺陷检测结果。Specifically, when there is a defect area with a size larger than a preset threshold in the closed operation image, and the marked defect area is a steel surface defect image whose similarity is greater than the second preset value, the steel surface to be tested corresponding to the closed operation image is generated. Defect detection results of the defect type corresponding to the image.
在一种可能的实施方式中,本发明并不限制第二预设值的取值。例如,第二预设值可以为90%、95%或96%等。In a possible implementation, the present invention does not limit the value of the second preset value. For example, the second preset value may be 90%, 95%, 96%, etc.
在一些实施例中,缺陷的类型可以包括裂纹、划伤、折叠、耳子、结疤、锈蚀、气泡、麻点、疏松、非金属夹杂物、过烧、白点、焊疤或端部毛刺等。In some embodiments, types of defects may include cracks, scratches, folds, ears, scabs, rust, bubbles, pitting, looseness, non-metallic inclusions, burns, white spots, weld scars, or end burrs. wait.
需要注意的是,当闭运算图像中存在尺寸大于预设阈值的缺陷区域,且在钢铁表面缺陷图像中并未查找到与标记的缺陷区域相似的钢铁表面缺陷图像时,确定标记的缺陷区域不是缺陷,也无缺陷类型。It should be noted that when there is a defect area with a size larger than the preset threshold in the closed operation image, and no steel surface defect image similar to the marked defect area is found in the steel surface defect image, it is determined that the marked defect area is not Defects, and no defect types.
需要说明的是,待测钢铁表面图像可能存在多处缺陷区域,在将标记后的待测钢铁表面图像输入至缺陷检测模型中进行缺陷检测时,缺陷检测模型是同时对多处缺陷区域进行缺陷检测的。因此,本发明并不需要一个一个对缺陷区域进行缺陷检测,可见,本发明的检测过程可以满足实际工业生产中对钢铁表面缺陷检测的高速度要求。It should be noted that there may be multiple defective areas in the surface image of the steel to be tested. When the marked surface image of the steel to be tested is input into the defect detection model for defect detection, the defect detection model detects defects in multiple defective areas at the same time. Detected. Therefore, the present invention does not need to detect defects in defective areas one by one. It can be seen that the detection process of the present invention can meet the high-speed requirements for steel surface defect detection in actual industrial production.
需要说明的是,在确定标记后的待测钢铁表面图像存在缺陷后,可以将待测钢铁表面图像存储到预设训练集中,为预设训练集新增训练数据。It should be noted that after it is determined that the marked surface image of the steel to be tested is defective, the surface image of the steel to be tested can be stored in a preset training set, and new training data can be added to the preset training set.
在一些实施例中,在实际应用中,可以在可疑图像队列设置监控,若可疑图像队列新增了标记后的待测钢铁表面图像,则立刻将标记后的待测钢铁表面图像输入至缺陷检测模型中进行检测,得到待测钢铁表面图像的检测结果。In some embodiments, in practical applications, monitoring can be set up in the suspicious image queue. If a marked steel surface image to be tested is added to the suspicious image queue, the marked steel surface image to be tested is immediately input to the defect detection Detection is carried out in the model and the detection results of the surface image of the steel to be tested are obtained.
值得一提的是,在可疑图像队列设置监控,可以保证可疑图像队列中无其他待测图像时,新增到可疑图像队列中的待测图像可以第一时间输入至缺陷检测模型中,以解决待测图像在加入可疑图像队列后无反应导致的浪费时间的问题。It is worth mentioning that when monitoring the suspicious image queue is set up to ensure that there are no other images to be tested in the suspicious image queue, the new images to be tested in the suspicious image queue can be input into the defect detection model as soon as possible to solve the problem. The problem of wasting time is caused by the unresponsiveness of the image to be tested after being added to the suspicious image queue.
如图6所示的钢铁表面缺陷检测方法的具体实现流程图,可见,本发明能够兼顾高速钢铁缺陷检测任务中的处理速度要求和缺陷检测精度要求。As shown in the specific implementation flow chart of the steel surface defect detection method in Figure 6, it can be seen that the present invention can take into account the processing speed requirements and defect detection accuracy requirements in high-speed steel defect detection tasks.
本发明实施例提供一种钢铁表面缺陷检测方法,其首先根据预先获取到的待测钢铁表面图像的前景灰度均值和背景灰度均值,生成待测钢铁表面图像的二值化分割阈值,之后通过对待测钢铁表面图像依次进行灰度均衡化处理、滤波处理以及边缘增强处理等预处理,得到第一图像,再通过得到的二值化分割阈值对第一图像进行二值化处理,得到像素只有黑白的第二图像,最后根据第二图像和预先训练完成的缺陷检测模型,得到待测钢铁表面图像的缺陷检测结果。Embodiments of the present invention provide a steel surface defect detection method, which first generates a binary segmentation threshold of the steel surface image to be tested based on the foreground gray average and background gray average of the steel surface image to be tested, and then The first image is obtained by sequentially performing preprocessing such as gray equalization, filtering, and edge enhancement on the steel surface image to be tested, and then binarizes the first image through the obtained binary segmentation threshold to obtain pixels. There is only a second image in black and white. Finally, based on the second image and the pre-trained defect detection model, the defect detection results of the surface image of the steel to be tested are obtained.
如此,通过合适的二值化分割阈值将待测钢铁表面图像进行二值化处理,可以使第一图像中的像素转换为黑色或白色,进而使第一图像的对比度增强、清晰度增强,达到缩短缺陷位置识别时间,加快缺陷检测过程的技术效果。且由于第二图像中只有两种颜色,而第二图像的组成颜色少也侧面说明了第二图像的数据量小,因此,后续图像处理的速度会明显快于未经过二值化处理的图像。此外,采用基于大量数据训练得到的缺陷检测模型得到的检测结果也更加精确。因此,本发明可以在实际工业生产中高速、精确的对钢铁表面的缺陷进行检测。In this way, by binary processing the steel surface image to be measured through an appropriate binary segmentation threshold, the pixels in the first image can be converted into black or white, thereby enhancing the contrast and clarity of the first image to achieve Shorten the defect location identification time and accelerate the technical effect of the defect detection process. And since there are only two colors in the second image, and the small number of colors in the second image also illustrates the small amount of data in the second image, the speed of subsequent image processing will be significantly faster than that of the image that has not been binarized. . In addition, the detection results obtained by using a defect detection model trained based on a large amount of data are also more accurate. Therefore, the present invention can detect defects on the steel surface at high speed and accurately in actual industrial production.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。It should be understood that the sequence number of each step in the above embodiment does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
以下为本发明的装置实施例,对于其中未详尽描述的细节,可以参考上述对应的方法实施例。The following are device embodiments of the present invention. For details that are not described in detail, reference may be made to the above corresponding method embodiments.
图7示出了本发明实施例提供的钢铁表面缺陷检测装置的结构示意图,为了便于说明,仅示出了与本发明实施例相关的部分,详述如下:Figure 7 shows a schematic structural diagram of a steel surface defect detection device provided by an embodiment of the present invention. For convenience of explanation, only the parts related to the embodiment of the present invention are shown. The details are as follows:
如图7所示,钢铁表面缺陷检测装置7包括:As shown in Figure 7, the steel surface defect detection device 7 includes:
生成模块71,用于根据待测钢铁表面图像的前景灰度均值和背景灰度均值,生成待测钢铁表面图像的二值化分割阈值;The generation module 71 is used to generate a binary segmentation threshold of the steel surface image to be tested based on the foreground grayscale mean value and the background grayscale mean value of the steel surface image to be tested;
第一处理模块72,用于对待测钢铁表面图像依次进行灰度均衡化处理、滤波处理以及边缘增强处理,得到第一图像;The first processing module 72 is used to sequentially perform grayscale equalization processing, filtering processing and edge enhancement processing on the steel surface image to be tested to obtain the first image;
第二处理模块73,用于利用二值化分割阈值对第一图像进行二值化处理,得到第二图像;The second processing module 73 is used to binarize the first image using the binarization segmentation threshold to obtain the second image;
检测模块74,用于根据第二图像和预先训练的缺陷检测模型,生成待测钢铁表面图像的缺陷检测结果;其中,缺陷检测模型是基于预设训练集训练得到的,预设训练集包括多张钢铁表面缺陷图像和钢铁表面无缺陷图像,钢铁表面缺陷图像对应有缺陷类型。The detection module 74 is used to generate defect detection results of the steel surface image to be tested based on the second image and a pre-trained defect detection model; wherein the defect detection model is trained based on a preset training set, and the preset training set includes multiple There are images of steel surface defects and images of steel surfaces without defects, and the steel surface defect images correspond to defective types.
在一种可能的实现方式中,生成模块71具体用于:In a possible implementation, the generation module 71 is specifically used to:
对待测钢铁表面图像进行前背景分割操作,得到前景区域和背景区域;Perform foreground and background segmentation operations on the steel surface image to be tested to obtain the foreground area and background area;
计算待测钢铁表面图像的平均灰度值、前景区域与待测钢铁表面图像的第一像素比值、背景区域与待测钢铁表面图像的第二像素比值;Calculate the average gray value of the steel surface image to be tested, the first pixel ratio of the foreground area and the steel surface image to be tested, and the second pixel ratio of the background area to the steel surface image to be tested;
根据平均灰度值和第一像素比值,得到前景灰度均值;According to the average gray value and the first pixel ratio, the average foreground gray value is obtained;
根据平均灰度值和第二像素比值,得到背景灰度均值;According to the average gray value and the second pixel ratio, the background gray mean value is obtained;
计算前景灰度均值和背景灰度均值的平均值,并将平均值定义为二值化分割阈值。Calculate the average value of the foreground gray value and the background gray value, and define the average value as the binary segmentation threshold.
在一种可能的实现方式中,第二处理模块73具体用于:In a possible implementation, the second processing module 73 is specifically used to:
将第一图像中大于二值化分割阈值的像素点所对应的灰度值设为第一灰度值;Set the grayscale value corresponding to the pixel point in the first image that is greater than the binary segmentation threshold as the first grayscale value;
将第一图像中小于二值化分割阈值的像素点所对应的灰度值设为第二灰度值。The grayscale value corresponding to the pixel point in the first image that is smaller than the binary segmentation threshold is set as the second grayscale value.
在一种可能的实现方式中,检测模块74具体用于:In a possible implementation, the detection module 74 is specifically used to:
对第二图像进行闭运算处理,得到闭运算图像;Perform closed operation processing on the second image to obtain a closed operation image;
对闭运算图像进行缺陷区域识别;Identify defective areas on closed operation images;
当闭运算图像中存在尺寸大于预设阈值的缺陷区域时,在待测钢铁表面图像中标记出与闭运算图像中的尺寸大于预设阈值的缺陷区域相对应的图像区域,并将标记后的待测钢铁表面图像输入至缺陷检测模型,得到待测钢铁表面图像对应的缺陷类型的缺陷检测结果;When there is a defective area in the closed operation image with a size larger than the preset threshold, the image area corresponding to the defective area in the closed operation image with a size larger than the preset threshold is marked in the steel surface image to be tested, and the marked area is The surface image of the steel to be tested is input into the defect detection model, and the defect detection results of the defect type corresponding to the surface image of the steel to be tested are obtained;
当闭运算图像中不存在尺寸大于预设阈值的缺陷区域时,生成待测钢铁表面图像为无缺陷的缺陷检测结果。When there is no defect area with a size larger than the preset threshold in the closed operation image, a defect detection result is generated that the surface image of the steel to be tested is defect-free.
在一种可能的实现方式中,第一处理模块72具体用于:In a possible implementation, the first processing module 72 is specifically used to:
根据待测钢铁表面图像的灰度直方图获取用于灰度均衡化处理的灰度映射关系,并根据灰度映射关系对待测钢铁表面图像进行灰度均衡化处理,得到第三图像;Obtain the grayscale mapping relationship for grayscale equalization processing based on the grayscale histogram of the steel surface image to be tested, and perform grayscale equalization processing on the steel surface image to be tested based on the grayscale mapping relationship to obtain the third image;
根据第三图像的空间临近度和第三图像的像素值相似度,获取用于滤波处理的卷积权值,并根据卷积权值对第三图像进行滤波处理,得到第四图像;According to the spatial proximity of the third image and the pixel value similarity of the third image, the convolution weight used for filtering is obtained, and the third image is filtered according to the convolution weight to obtain a fourth image;
获取用于边缘增强处理的第四图像的水平梯度图像和竖直梯度图像,并根据水平梯度图像和竖直梯度图像得到第一图像。The horizontal gradient image and the vertical gradient image of the fourth image used for edge enhancement processing are acquired, and the first image is obtained based on the horizontal gradient image and the vertical gradient image.
在一种可能的实现方式中,第一处理模块72具体用于:In a possible implementation, the first processing module 72 is specifically used to:
将待测钢铁表面图像划分为若干个局部图像,获取所有局部图像对应的灰度直方图;其中,每个局部图像均对应一个灰度直方图,灰度直方图为局部图像中各个灰度级别对应的概率密度函数,灰度直方图的横坐标为局部图像中各个像素点的灰度级别,灰度直方图的纵坐标为各个灰度级别的像素点在局部图像中出现的频率;Divide the surface image of the steel to be tested into several partial images, and obtain the grayscale histograms corresponding to all partial images; among them, each partial image corresponds to a grayscale histogram, and the grayscale histogram is each grayscale level in the partial image. For the corresponding probability density function, the abscissa of the gray histogram is the gray level of each pixel in the local image, and the ordinate of the gray histogram is the frequency of occurrence of each gray level pixel in the local image;
对灰度直方图进行对比度限制处理,得到第二灰度直方图;Perform contrast limitation processing on the grayscale histogram to obtain a second grayscale histogram;
获取第二灰度直方图对应的累计概率密度函数,将累计概率密度函数与灰度级别总数进行计算,得到用于灰度均衡化处理的灰度映射关系;其中,累计概率密度函数为第二灰度直方图对应的第二概率密度函数的积分;Obtain the cumulative probability density function corresponding to the second grayscale histogram, calculate the cumulative probability density function and the total number of grayscale levels, and obtain the grayscale mapping relationship for grayscale equalization processing; wherein, the cumulative probability density function is the second grayscale histogram. The integral of the second probability density function corresponding to the grayscale histogram;
根据灰度映射关系对局部图像进行灰度均衡化处理,直到所有的局部图像处理完成;Perform grayscale equalization processing on the local image according to the grayscale mapping relationship until all local image processing is completed;
将所有处理后的局部图像进行整合,得到第三图像。All processed partial images are integrated to obtain a third image.
在一种可能的实现方式中,第一处理模块72具体用于:In a possible implementation, the first processing module 72 is specifically used to:
在第三图像中定义一个中心点;Define a center point in the third image;
计算第三图像中每个像素点到中心点的空间临近度,以及每个像素点与中心点的像素值相似度;Calculate the spatial proximity between each pixel in the third image and the center point, and the pixel value similarity between each pixel and the center point;
将每个像素点的空间临近度与像素值相似度相乘,得到每个像素点的卷积权值;Multiply the spatial proximity of each pixel and the pixel value similarity to obtain the convolution weight of each pixel;
根据每个像素点的卷积权值与每个像素点的像素值得到第四图像。The fourth image is obtained based on the convolution weight of each pixel and the pixel value of each pixel.
在一种可能的实现方式中,第一处理模块72具体用于:In a possible implementation, the first processing module 72 is specifically used to:
获取第四图像在水平方向所对应的水平矩阵,以及第四图像在竖直方向所对应的竖直矩阵;Obtain the horizontal matrix corresponding to the fourth image in the horizontal direction, and the vertical matrix corresponding to the fourth image in the vertical direction;
将水平矩阵与第四图像进行平面卷积计算,得到水平梯度图像;Perform planar convolution calculation on the horizontal matrix and the fourth image to obtain the horizontal gradient image;
将竖直矩阵与第四图像进行平面卷积计算,得到竖直梯度图像;Perform planar convolution calculation on the vertical matrix and the fourth image to obtain a vertical gradient image;
将水平梯度图像与竖直梯度图像进行按位或运算,得到第一图像。Perform a bitwise OR operation on the horizontal gradient image and the vertical gradient image to obtain the first image.
本发明实施例提供一种钢铁表面缺陷检测装置,其首先根据预先获取到的待测钢铁表面图像的前景灰度均值和背景灰度均值,生成待测钢铁表面图像的二值化分割阈值,之后通过对待测钢铁表面图像依次进行灰度均衡化处理、滤波处理以及边缘增强处理等预处理,得到第一图像,再通过得到的二值化分割阈值对第一图像进行二值化处理,得到像素只有黑白的第二图像,最后根据第二图像和预先训练完成的缺陷检测模型,得到待测钢铁表面图像的缺陷检测结果。Embodiments of the present invention provide a steel surface defect detection device, which first generates a binary segmentation threshold of the steel surface image to be measured based on the foreground gray average and background gray average of the steel surface image to be measured, and then The first image is obtained by sequentially performing preprocessing such as gray equalization, filtering, and edge enhancement on the steel surface image to be tested, and then binarizes the first image through the obtained binary segmentation threshold to obtain pixels. There is only a second image in black and white. Finally, based on the second image and the pre-trained defect detection model, the defect detection results of the surface image of the steel to be tested are obtained.
如此,通过合适的二值化分割阈值将待测钢铁表面图像进行二值化处理,可以使第一图像中的像素转换为黑色或白色,进而使第一图像的对比度增强、清晰度增强,达到缩短缺陷位置识别时间,加快缺陷检测过程的技术效果。且由于第二图像中只有两种颜色,而第二图像的组成颜色少也侧面说明了第二图像的数据量小,因此,后续图像处理的速度会明显快于未经过二值化处理的图像。此外,采用基于大量数据训练得到的缺陷检测模型得到的检测结果也更加精确。因此,本发明可以在实际工业生产中高速、精确的对钢铁表面的缺陷进行检测。In this way, by binary processing the steel surface image to be measured through an appropriate binary segmentation threshold, the pixels in the first image can be converted into black or white, thereby enhancing the contrast and clarity of the first image to achieve Shorten the defect location identification time and accelerate the technical effect of the defect detection process. And since there are only two colors in the second image, and the small number of colors in the second image also illustrates the small amount of data in the second image, the speed of subsequent image processing will be significantly faster than that of the image that has not been binarized. . In addition, the detection results obtained by using a defect detection model trained based on a large amount of data are also more accurate. Therefore, the present invention can detect defects on the steel surface at high speed and accurately in actual industrial production.
图8是本发明实施例提供的电子设备的示意图。如图8所示,该实施例的电子设备8包括:处理器80、存储器81以及存储在所述存储器81中并可在所述处理器80上运行的计算机程序82。所述处理器80执行所述计算机程序82时实现上述各个钢铁表面缺陷检测方法实施例中的步骤,例如图1所示的步骤101至步骤104。或者,所述处理器80执行所述计算机程序82时实现上述各装置实施例中各模块/单元的功能,例如图7所示模块/单元71至74的功能。Figure 8 is a schematic diagram of an electronic device provided by an embodiment of the present invention. As shown in FIG. 8 , the electronic device 8 of this embodiment includes: a processor 80 , a memory 81 , and a computer program 82 stored in the memory 81 and executable on the processor 80 . When the processor 80 executes the computer program 82, it implements the steps in each of the above embodiments of the steel surface defect detection method, such as steps 101 to 104 shown in FIG. 1 . Alternatively, when the processor 80 executes the computer program 82, it implements the functions of each module/unit in each of the above device embodiments, such as the functions of the modules/units 71 to 74 shown in FIG. 7 .
示例性的,所述计算机程序82可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器81中,并由所述处理器80执行,以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序82在所述电子设备8中的执行过程。例如,所述计算机程序82可以被分割成图7所示的模块/单元71至74。Exemplarily, the computer program 82 can be divided into one or more modules/units, the one or more modules/units are stored in the memory 81 and executed by the processor 80 to complete this invention. The one or more modules/units may be a series of computer program instruction segments capable of completing specific functions. The instruction segments are used to describe the execution process of the computer program 82 in the electronic device 8 . For example, the computer program 82 may be divided into modules/units 71 to 74 as shown in FIG. 7 .
所述电子设备8可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8仅仅是电子设备8的示例,并不构成对电子设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备还可以包括输入输出设备、网络接入设备、总线等。The electronic device 8 may include, but is not limited to, a processor 80 and a memory 81 . Those skilled in the art can understand that FIG. 8 is only an example of the electronic device 8 and does not constitute a limitation of the electronic device 8. It may include more or fewer components than shown in the figure, or some components may be combined, or different components may be used. , for example, the electronic device may also include input and output devices, network access devices, buses, etc.
所称处理器80可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 80 can be a central processing unit (Central Processing Unit, CPU), or other general-purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
所述存储器81可以是所述电子设备8的内部存储单元,例如电子设备8的硬盘或内存。所述存储器81也可以是所述电子设备8的外部存储设备,例如所述电子设备8上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器81还可以既包括所述电子设备8的内部存储单元也包括外部存储设备。所述存储器81用于存储所述计算机程序以及所述电子设备所需的其他程序和数据。所述存储器81还可以用于暂时地存储已经输出或者将要输出的数据。The memory 81 may be an internal storage unit of the electronic device 8 , such as a hard disk or memory of the electronic device 8 . The memory 81 may also be an external storage device of the electronic device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), or a secure digital (SD) equipped on the electronic device 8. card, flash card, etc. Further, the memory 81 may also include both an internal storage unit of the electronic device 8 and an external storage device. The memory 81 is used to store the computer program and other programs and data required by the electronic device. The memory 81 can also be used to temporarily store data that has been output or is to be output.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional units and modules is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs. Module completion means dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be hardware-based. It can also be implemented in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the present application. For the specific working processes of the units and modules in the above system, please refer to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, each embodiment is described with its own emphasis. For parts that are not detailed or documented in a certain embodiment, please refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered to be beyond the scope of the present invention.
在本发明所提供的实施例中,应该理解到,所揭露的装置/电子设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/电子设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided by the present invention, it should be understood that the disclosed apparatus/electronic equipment and methods can be implemented in other ways. For example, the device/electronic device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components can be combined or can be integrated into another system, or some features can be omitted, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or units, which may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个钢铁表面缺陷检测方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、电载波信号、电信信号以及软件分发介质等。If the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, the steps of each of the above embodiments of the steel surface defect detection method can be implemented. Wherein, the computer program includes computer program code, which may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM) , random access memory (Random Access Memory, RAM), electrical carrier signals, telecommunications signals, and software distribution media, etc.
以上所述实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围,均应包含在本发明的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still implement the above-mentioned implementations. The technical solutions described in the examples are modified, or some of the technical features are equivalently replaced; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of each embodiment of the present invention, and should be included in within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311068561.0A CN117094975A (en) | 2023-08-23 | 2023-08-23 | Method and device for detecting surface defects of steel and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311068561.0A CN117094975A (en) | 2023-08-23 | 2023-08-23 | Method and device for detecting surface defects of steel and electronic equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117094975A true CN117094975A (en) | 2023-11-21 |
Family
ID=88772980
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311068561.0A Pending CN117094975A (en) | 2023-08-23 | 2023-08-23 | Method and device for detecting surface defects of steel and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117094975A (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117451727A (en) * | 2023-12-25 | 2024-01-26 | 四川鑫华达科技有限公司 | A quality control method for nozzle processing |
| CN117495884A (en) * | 2024-01-02 | 2024-02-02 | 湖北工业大学 | A steel surface defect segmentation method, device, electronic equipment and storage medium |
| CN118279307A (en) * | 2024-06-03 | 2024-07-02 | 魅杰光电科技(上海)有限公司 | Method and system for detecting defects of semiconductor device material |
| CN118429327A (en) * | 2024-06-03 | 2024-08-02 | 苏州荣视软件技术有限公司 | Ceramic substrate surface defect detection method and system based on deep learning |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112053368A (en) * | 2019-09-23 | 2020-12-08 | 华北电力大学(保定) | Weld center identification method and system for thin plate welding |
| US20210174489A1 (en) * | 2019-12-04 | 2021-06-10 | Beijing Boe Optoelectronics Technology Co., Ltd. | Method and apparatus for detecting a screen, and electronic device |
| CN114723649A (en) * | 2020-12-21 | 2022-07-08 | 武汉Tcl集团工业研究院有限公司 | Panel defect detection method, storage medium and terminal equipment |
| CN114926407A (en) * | 2022-04-28 | 2022-08-19 | 哈尔滨理工大学 | Steel surface defect detection system based on deep learning |
| US20230260101A1 (en) * | 2022-05-06 | 2023-08-17 | Nanjing University Of Aeronautics And Astronautics | Subtle defect detection method based on coarse-to-fine strategy |
-
2023
- 2023-08-23 CN CN202311068561.0A patent/CN117094975A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112053368A (en) * | 2019-09-23 | 2020-12-08 | 华北电力大学(保定) | Weld center identification method and system for thin plate welding |
| US20210174489A1 (en) * | 2019-12-04 | 2021-06-10 | Beijing Boe Optoelectronics Technology Co., Ltd. | Method and apparatus for detecting a screen, and electronic device |
| CN114723649A (en) * | 2020-12-21 | 2022-07-08 | 武汉Tcl集团工业研究院有限公司 | Panel defect detection method, storage medium and terminal equipment |
| CN114926407A (en) * | 2022-04-28 | 2022-08-19 | 哈尔滨理工大学 | Steel surface defect detection system based on deep learning |
| US20230260101A1 (en) * | 2022-05-06 | 2023-08-17 | Nanjing University Of Aeronautics And Astronautics | Subtle defect detection method based on coarse-to-fine strategy |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117451727A (en) * | 2023-12-25 | 2024-01-26 | 四川鑫华达科技有限公司 | A quality control method for nozzle processing |
| CN117451727B (en) * | 2023-12-25 | 2024-03-12 | 四川鑫华达科技有限公司 | A quality control method for nozzle processing |
| CN117495884A (en) * | 2024-01-02 | 2024-02-02 | 湖北工业大学 | A steel surface defect segmentation method, device, electronic equipment and storage medium |
| CN117495884B (en) * | 2024-01-02 | 2024-03-22 | 湖北工业大学 | A steel surface defect segmentation method, device, electronic equipment and storage medium |
| CN118279307A (en) * | 2024-06-03 | 2024-07-02 | 魅杰光电科技(上海)有限公司 | Method and system for detecting defects of semiconductor device material |
| CN118429327A (en) * | 2024-06-03 | 2024-08-02 | 苏州荣视软件技术有限公司 | Ceramic substrate surface defect detection method and system based on deep learning |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN117094975A (en) | Method and device for detecting surface defects of steel and electronic equipment | |
| CN110930390B (en) | Chip pin missing detection method based on semi-supervised deep learning | |
| CN113706464B (en) | Printed matter appearance quality detection method and system | |
| CN118275449B (en) | Copper strip surface defect detection method, device and equipment | |
| CN113538500B (en) | Image segmentation method and device, electronic equipment and storage medium | |
| CN108764328A (en) | The recognition methods of Terahertz image dangerous material, device, equipment and readable storage medium storing program for executing | |
| CN116109637B (en) | System and method for detecting appearance defects of turbocharger impeller based on vision | |
| CN113537037A (en) | Pavement disease identification method, system, electronic device and storage medium | |
| CN115587966A (en) | A method and system for detecting whether parts are missing or not under the condition of uneven illumination | |
| CN114627113B (en) | A printed circuit board defect detection method, system, device and medium | |
| CN115601385A (en) | Bubble form processing method, bubble form processing apparatus, bubble form processing medium, and program product | |
| CN114596242A (en) | Defect detection method, apparatus, electronic device, and computer-readable storage medium | |
| CN117392066B (en) | Defect detection method, device, equipment and storage medium | |
| CN110473222A (en) | Image-element extracting method and device | |
| Sanghadiya et al. | Surface defect detection in a tile using digital image processing: Analysis and evaluation | |
| CN115797314A (en) | Part surface defect detection method, system, equipment and storage medium | |
| CN112465817B (en) | Pavement crack detection method based on directional filter | |
| CN114596210A (en) | Noise estimation method, device, terminal equipment and computer readable storage medium | |
| CN113505702A (en) | Pavement disease identification method and system based on double neural network optimization | |
| CN113066088A (en) | Detection method, detection device and storage medium in industrial detection | |
| CN117710287A (en) | Material detection method and device, electronic equipment and storage medium | |
| CN113610773A (en) | Gasket hole quality detection method, system and device and storage medium | |
| CN111311610A (en) | Image segmentation method and terminal device | |
| CN115719326A (en) | PCB defect detection method and device | |
| CN115239595A (en) | Method for detecting qualification of two-dimensional code of packaging printed matter |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |