CN105092597B - A kind of crack detecting method on hard plastic material surface - Google Patents

A kind of crack detecting method on hard plastic material surface Download PDF

Info

Publication number
CN105092597B
CN105092597B CN201510580957.2A CN201510580957A CN105092597B CN 105092597 B CN105092597 B CN 105092597B CN 201510580957 A CN201510580957 A CN 201510580957A CN 105092597 B CN105092597 B CN 105092597B
Authority
CN
China
Prior art keywords
pixel
roi
image
current
mrow
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.)
Active
Application number
CN201510580957.2A
Other languages
Chinese (zh)
Other versions
CN105092597A (en
Inventor
宋强
林国营
张鼎衢
马敬奇
吴亮生
何峰
钟震宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Electric Power Research Institute of Guangdong Power Grid Co Ltd
Original Assignee
Guangdong Institute of Intelligent Manufacturing
Electric Power Research Institute of Guangdong Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Institute of Intelligent Manufacturing, Electric Power Research Institute of Guangdong Power Grid Co Ltd filed Critical Guangdong Institute of Intelligent Manufacturing
Priority to CN201510580957.2A priority Critical patent/CN105092597B/en
Publication of CN105092597A publication Critical patent/CN105092597A/en
Application granted granted Critical
Publication of CN105092597B publication Critical patent/CN105092597B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention discloses a kind of crack detecting methods on hard plastic material surface, comprise the following steps:S1 obtains hard plastic material surface gray level image;S2 carries out binary conversion treatment to the gray level image acquired and obtains bianry image, extracts the slit region ROI image in the gray level image, the ROI is made to be separated with the background in gray level image;S3 obtains the single pixel framework information in ROI image;S4 carries out pixel point analysis to the single pixel framework information of ROI image, the product for meeting crack is marked.The present invention can quickly, precisely detect hard plastic material face crack, the on-line checking available for hard plastic material face crack.

Description

一种硬塑材料表面的裂纹检测方法A Crack Detection Method on the Surface of Hard Plastic Material

技术领域technical field

本发明涉及一种硬塑材料表面的裂纹检测方法,具体地说是一种主要用来检测利用硬塑材料作为产品封装材料的器件表面裂纹的检测方法。The invention relates to a method for detecting cracks on the surface of hard plastic materials, in particular to a method for detecting cracks on the surface of devices using hard plastic materials as product packaging materials.

背景技术Background technique

硬塑材料作为一种常用的物体组成部件,例如电子器件的包装、医疗设备的保护壳、生活用品等,甚至还可用于建筑领域,其应用范围是非常广泛的,随着传统材料的过度消耗,大批的合成硬塑材料被研制以弥补不足。硬塑材料产品的质量是非关键的,而表面裂纹是硬塑材料质量的一个重要因素,在使用过程中裂纹可能导致漏电、漏水等,降低了器件的整体寿命,甚至导致事故发生。由于硬塑材料带来可观的经济效益用量还在继续增加,为保证硬塑材料的质量,寻求一种裂纹检测方法来适应先进的生产手段是极其重要的。As a commonly used component of objects, hard plastic materials, such as packaging of electronic devices, protective cases of medical equipment, daily necessities, etc., can even be used in the field of construction, and its application range is very wide. With the excessive consumption of traditional materials , A large number of synthetic hard plastic materials have been developed to make up for the shortage. The quality of hard plastic material products is not critical, and surface cracks are an important factor in the quality of hard plastic materials. During use, cracks may lead to electric leakage, water leakage, etc., reducing the overall life of the device, and even leading to accidents. Since the amount of hard plastic materials brings considerable economic benefits and continues to increase, in order to ensure the quality of hard plastic materials, it is extremely important to find a crack detection method to adapt to advanced production methods.

随着计算机性能的持续增强,数字图像处理技术也在飞速发展,近年来涌现出一批基于数字图像处理的裂纹检测方法,主要有根据裂纹与噪声不同特性移除噪声检测裂纹;基于BP神经网络算法实现对裂纹的检测,将裂纹特征作为神经网络的输入因子,通过学习将输出作为判定裂纹的标准,但神经网络结构过于复杂,运算复杂度大,不利于在线检测;根据裂纹的线性特点,一些算法将裂纹分解成不同线段,通过判断斜率的复杂度判断裂纹,但在硬塑材料表面裂纹中,很多裂纹是由于重力挤压导致的,裂纹呈现网状,线性度非常复杂,不利于线性化;将模糊逻辑和人工神经网络相结合的裂纹检测算法是将裂纹特征作为模型的输入,由输出结果判定裂纹。除此之外还有基于小波变换的裂纹检测算法,基于直方图统计分析的检测方法,基于直方图投影与形态学算子相结合的检测方法。以上裂纹检测方法针对混凝土、公路表面裂纹,此类裂纹由腐蚀、重物碾压导致,裂纹边缘具有明显毛刺。硬塑材料表面裂纹主要由挤压、撞击等物理因素导致,由于硬塑材料材质特性裂纹边缘毛刺较少。另外常用的圆形度判别法无法将划痕这种线性非裂纹缺陷排除,故此以上方法并不适用于硬塑材料表面裂纹的检测。With the continuous enhancement of computer performance, digital image processing technology is also developing rapidly. In recent years, a number of crack detection methods based on digital image processing have emerged, mainly removing noise and detecting cracks according to the different characteristics of cracks and noise; based on BP neural network The algorithm realizes the detection of cracks. The crack feature is used as the input factor of the neural network, and the output is used as the criterion for judging the crack through learning. However, the structure of the neural network is too complex and the calculation complexity is large, which is not conducive to online detection; according to the linear characteristics of cracks, Some algorithms decompose the crack into different line segments, and judge the crack by judging the complexity of the slope, but in the cracks on the surface of hard plastic materials, many cracks are caused by gravity extrusion, and the cracks are networked, and the linearity is very complicated, which is not conducive to linearity. The crack detection algorithm that combines fuzzy logic and artificial neural network uses the crack features as the input of the model, and judges the crack by the output result. In addition, there are crack detection algorithms based on wavelet transform, detection methods based on histogram statistical analysis, and detection methods based on the combination of histogram projection and morphological operators. The above crack detection methods are aimed at cracks on the surface of concrete and roads. Such cracks are caused by corrosion and heavy rolling, and the crack edges have obvious burrs. Cracks on the surface of hard plastic materials are mainly caused by physical factors such as extrusion and impact. Due to the material characteristics of hard plastic materials, there are fewer burrs on the crack edges. In addition, the commonly used circularity discrimination method cannot exclude linear non-crack defects such as scratches, so the above method is not suitable for the detection of cracks on the surface of hard plastic materials.

随着生产力的发展,先进的生产设备能够在短时间内生产大量成品硬塑材料,为保证生产效率,提高产品检测质量,寻求一种能够适应生产环境的检测方法至关重要,要求检测算法具有快速性、稳定性、高效性。With the development of productivity, advanced production equipment can produce a large amount of finished hard plastic materials in a short period of time. In order to ensure production efficiency and improve product inspection quality, it is very important to find a detection method that can adapt to the production environment. The detection algorithm is required to have Rapidity, stability and efficiency.

发明内容Contents of the invention

本发明要解决的技术问题是提供一种能够快速、精准检测出硬塑材料表面裂纹的检测方法。The technical problem to be solved by the present invention is to provide a detection method capable of quickly and accurately detecting cracks on the surface of hard plastic materials.

为了解决上述技术问题,本发明采取以下技术方案:In order to solve the above technical problems, the present invention takes the following technical solutions:

一种硬塑材料表面的裂纹检测方法,包括以下步骤:A method for detecting cracks on the surface of a hard plastic material, comprising the following steps:

S1,获取硬塑材料表面灰度图像;S1, acquiring the grayscale image of the surface of the hard plastic material;

S2,对获取得到的灰度图像进行二值化处理得到二值图像,提取该灰度图像中的裂纹区域ROI图像,使该ROI与灰度图像中的背景相分离;S2, performing binarization processing on the obtained grayscale image to obtain a binary image, extracting the ROI image of the crack area in the grayscale image, and separating the ROI from the background in the grayscale image;

S3,获取ROI图像中的单像素骨架信息;S3, acquiring single-pixel skeleton information in the ROI image;

S4,对ROI图像的单像素骨架信息进行像素点分析,将符合裂纹特征的产品进行标记。S4, performing pixel point analysis on the single-pixel skeleton information of the ROI image, and marking products conforming to crack features.

所述对灰度图像进行二值化处理时,采用渗透算法进行处理,具体包括以下步骤:When the grayscale image is binarized, the infiltration algorithm is used to process it, which specifically includes the following steps:

S2.1,设定最大窗口为M×M,当前窗口大小为N×N,将当前窗口中心的像素点设置为种子像素点,该种子像素点为渗透区域D p 内的点,从该种子像素点开始渗透,该种子像素点的亮度I(ps)设置为初始阈值T;S2.1, set the maximum window to M×M, the current window size to N×N, set the pixel in the center of the current window as the seed pixel, and the seed pixel is a point in the penetration area Dp , from the seed The pixel starts to penetrate, and the brightness I(ps) of the seed pixel is set as the initial threshold T;

S2.2,渗透区域Dp的8邻域为Dc,判断渗透区域Dc内的像素点亮度与初始阈值T之间的大小关系,如果8邻域Dc内某一个像素点的亮度值小于初始阈值T,则将该像素点属于渗透区域Dp,否则将该像素点归属于背景DbS2.2, the 8-neighborhood of the penetration area D p is D c , judge the size relationship between the brightness of the pixel in the penetration area D c and the initial threshold T, if the brightness value of a pixel in the 8-neighborhood D c If it is smaller than the initial threshold T, the pixel belongs to the penetration area D p , otherwise the pixel belongs to the background D b ;

S2.3,判断渗透区域D p 是否抵达当前窗口边界,若渗透区域D p 未抵达当前窗口边界,则返回步骤S2.2继续当前渗透过程;若渗透区域D p 抵达当前窗口边界,则扩大当前窗口的大小,使N=N+2;S2.3. Determine whether the penetration area D p has reached the current window boundary. If the penetration area D p has not reached the current window boundary, return to step S2.2 to continue the current penetration process; if the penetration area D p reaches the current window boundary, expand the current window. The size of the window, so that N=N+2;

S2.4,以扩大后的窗口为当前窗口,开始新一轮的像素点渗透,判断当前渗透区域Dp的8邻域Dc内的像素点亮度与初始阈值T之间的大小关系;如果Dc内存在亮度小于初始阈值T的像素点,则将该像素点归属于渗透区域Dp;如果Dc内不存在亮度值小于初始阈值T的像素点,则结束渗透过程;S2.4, take the expanded window as the current window, start a new round of pixel infiltration, and judge the relationship between the pixel brightness in the 8-neighborhood D c of the current infiltration area D p and the initial threshold T; if If there is a pixel in D c whose luminance is less than the initial threshold T, the pixel is assigned to the infiltration area Dp ; if there is no pixel in D c whose luminance is less than the initial threshold T, the infiltration process ends;

S2.5,判断当前窗口大小是否大于最大窗口大小,即N是否大于M,若大于则结束渗透过程,若小于,否则返回步骤S2.3,进行新一轮的渗透过程,直至渗透结束,得到二值化图像,提取出图像中的ROI。S2.5, judge whether the current window size is larger than the maximum window size, that is, whether N is larger than M, if it is larger, the infiltration process is ended, if it is smaller, otherwise return to step S2.3, and perform a new round of infiltration process until the infiltration ends, and obtain Binarize the image and extract the ROI in the image.

所述窗口内的像素点的亮度值,通过下列公式更新计算得到,其中I(p)表示像素点亮度:The luminance value of the pixel in the window is updated and calculated by the following formula, wherein I ( p ) represents the luminance of the pixel:

.

所述获取ROI图像中的单像素骨架信息,具体包括:The acquisition of single-pixel skeleton information in the ROI image specifically includes:

将二值化图像中的ROI中的每个像素点,与预先设定好的8个消除模板进行匹配,若不存在相同的消除模板,则保留当前像素点;若存在相同的消除模板则将当前像素点再与9个保留模板进行匹配,若存在相同的保留模板,则保留当前像素点,若不存在相同的保留模板则删除当前像素点,直至将ROI中的所有像素点一一匹配,得到ROI的单像素骨架。Each pixel in the ROI in the binarized image is matched with 8 preset elimination templates. If there is no identical elimination template, the current pixel is retained; if there is the same elimination template, the The current pixel is matched with 9 reserved templates. If there is the same reserved template, the current pixel is retained. If there is no identical reserved template, the current pixel is deleted until all the pixels in the ROI are matched one by one. Get a single-pixel skeleton of the ROI.

所述步骤S4中,具体采用8邻域判定法进行裂纹判定,若该单像素骨架中含有邻域点个数大于2的像素点,则当前的硬塑材料表面具有裂纹。In the step S4, the 8-neighborhood determination method is specifically used for crack determination. If the single-pixel skeleton contains pixels with a number of neighbor points greater than 2, the current hard plastic material surface has cracks.

本发明能够快速、精准检测出硬塑材料表面裂纹,尤其是适用于作为产品封装材料的器件(如电流互感器)表面裂纹的检测方法,提升产品的质量。The invention can quickly and accurately detect cracks on the surface of hard plastic materials, and is especially suitable for the detection method of cracks on the surface of devices (such as current transformers) used as product packaging materials, thereby improving the quality of products.

附图说明Description of drawings

附图1为本发明流程示意图;Accompanying drawing 1 is the schematic flow chart of the present invention;

附图2为本发明渗透算法的处理流程示意图;Accompanying drawing 2 is a schematic diagram of the processing flow of the penetration algorithm of the present invention;

附图3为硬塑材料表面裂纹灰度图像示意图;Accompanying drawing 3 is the schematic diagram of the grayscale image of the crack on the surface of the hard plastic material;

附图4为本发明中经过二值化处理后的二值化图像示意图;Accompanying drawing 4 is the schematic diagram of the binarization image after binarization processing among the present invention;

附图5为本发明中当前像素点的抽取领域示意图;Accompanying drawing 5 is a schematic diagram of the field of extraction of current pixels in the present invention;

附图6为本发明预先定义的消除模板示意图;Accompanying drawing 6 is the schematic diagram of the elimination template predefined in the present invention;

附图7为本发明预先定义的保留模板示意图;Accompanying drawing 7 is the schematic diagram of the pre-defined retention template of the present invention;

附图8为本发明中获得的单像素骨架示意图;Accompanying drawing 8 is a schematic diagram of a single-pixel skeleton obtained in the present invention;

附图9为本发明中像素点的8邻域示意图;Accompanying drawing 9 is a schematic diagram of 8 neighborhoods of pixels in the present invention;

附图10为本发明中单像素骨架8邻域判定结果为具有裂纹的示意图。Figure 10 is a schematic diagram of the determination result of the neighborhood of the single pixel skeleton 8 having cracks in the present invention.

具体实施方式Detailed ways

为了便于本领域技术人员的理解,下面结合附图对本发明作进一步的描述。In order to facilitate the understanding of those skilled in the art, the present invention will be further described below in conjunction with the accompanying drawings.

如附图1~5所示,一种硬塑材料表面的裂纹检测方法,包括以下步骤:As shown in accompanying drawing 1~5, a kind of crack detection method on the surface of hard plastic material comprises the following steps:

S1,获取硬塑材料表面灰度图像。对待检测的目标产品进行摄像,获取其灰度图像,如附图3所示。S1, acquiring the grayscale image of the surface of the hard plastic material. The target product to be detected is photographed to obtain its grayscale image, as shown in Figure 3.

S2,对获取得到的灰度图像进行二值化处理得到二值图像,提取该灰度图像中的裂纹区域ROI图像,使该ROI与灰度图像中的背景相分离,如附图4所示。该ROI图像即为灰度图像中的目标裂纹区域。S2, perform binarization processing on the obtained grayscale image to obtain a binary image, extract the ROI image of the crack region in the grayscale image, and separate the ROI from the background in the grayscale image, as shown in Figure 4 . The ROI image is the target crack area in the grayscale image.

S3,获取ROI图像中的单像素骨架信息,如附图8所示,为去除掉背景的像素骨架信息。S3. Obtain the single-pixel skeleton information in the ROI image, as shown in FIG. 8 , which is the pixel skeleton information with the background removed.

S4,对ROI图像的单像素骨架信息进行像素点分析,将符合裂纹特征的产品进行标记,具体采用8邻域判定法进行裂纹判定,若该单像素骨架中含有邻域点个数大于2的像素点,则当前的硬塑材料表面具有裂纹。如附图10所示,为具有裂纹的产品。S4. Perform pixel point analysis on the single-pixel skeleton information of the ROI image, and mark products that meet the crack characteristics. Specifically, the 8-neighborhood judgment method is used for crack judgment. If the single-pixel skeleton contains more than 2 neighborhood points Pixels, the current hard plastic material has cracks on the surface. As shown in Figure 10, it is a product with cracks.

此外,在对灰度图像进行二值化处理时,采用渗透算法进行处理,如附图2所示,具体包括以下步骤:In addition, when the grayscale image is binarized, the permeation algorithm is used for processing, as shown in Figure 2, which specifically includes the following steps:

S2.1,设定最大窗口为M×M,当前窗口大小为N×N,将当前窗口中心的像素点设置为种子像素点,该种子像素点为渗透区域D p 内的点,从该种子像素点开始渗透,该种子像素点的亮度I(ps)设置为初始阈值T。S2.1, set the maximum window to M×M, the current window size to N×N, set the pixel in the center of the current window as the seed pixel, and the seed pixel is a point in the penetration area Dp , from the seed The pixel starts to penetrate, and the brightness I(ps) of the sub pixel is set as the initial threshold T.

S2.2,渗透区域Dp的8邻域为Dc,断渗透区域Dc内的像素点亮度与初始阈值T之间的大小关系,如果8邻域Dc内某一个像素点的亮度值小于初始阈值T,则将该像素点属于渗透区域Dp,否则将该像素点归属于背景Db。以种子像素点为中心点,开始向周围不断渗透,每渗透一个像素点,都将该像素点的亮度值与初始阈值T进行比较。S2.2, the 8-neighborhood of the penetration area D p is D c , the size relationship between the brightness of the pixels in the penetration area D c and the initial threshold T, if the brightness value of a pixel in the 8-neighborhood D c If it is smaller than the initial threshold T, the pixel belongs to the penetration area D p , otherwise the pixel belongs to the background D b . With the seed pixel point as the center point, it starts to infiltrate to the surrounding continuously, and compares the brightness value of the pixel point with the initial threshold T every time a pixel point is infiltrated.

S2.3,判断渗透区域D p 是否抵达当前窗口边界,若渗透区域D p 未抵达当前窗口边界,即还没有将当前窗口中的所有像素点渗透完,则返回步骤S2.2继续当前渗透过程;若渗透区域D p 抵达当前窗口边界,即已经将当前窗口内的所有像素点渗透完成,则扩大当前窗口的大小,使N=N+2,也就是说将原来的窗口的大小N×N扩大为(N+2)×(N+2),以+2为基数。S2.3. Determine whether the infiltration area Dp has reached the boundary of the current window. If the infiltration area Dp has not reached the boundary of the current window, that is, all the pixels in the current window have not been infiltrated, return to step S2.2 to continue the current infiltration process ; If the infiltration area D p reaches the boundary of the current window, that is, all the pixels in the current window have been infiltrated, then expand the size of the current window to make N=N+2, that is to say, the size of the original window is N×N Expand to (N+2)×(N+2), taking +2 as the base.

在参透过程当中,对于不同像素点亮度的值,通过下载列公式计算得到,中I(p)表示像素点亮度,即每经过一个像素点,都计算亮度值,然后与初始阈值T进行比较。During the penetration process, the brightness values of different pixels are calculated by downloading the column formula, where I ( p ) represents the brightness of the pixel, that is, the brightness value is calculated every time a pixel is passed, and then compared with the initial threshold T.

.

S2.4,以扩大后的窗口为当前窗口,开始新一轮的像素点渗透,判断当前渗透区域Dp的8邻域Dc内的像素点亮度与初始阈值T之间的大小关系;如果8邻域Dc内存在亮度小于初始阈值T的像素点,则将该像素点归属于渗透区域Dp;如果8邻域Dc内不存在亮度值小于初始阈值T的像素点,则结束渗透过程,表明扩大窗口后也不存在属于渗透区域Dp的像素点。S2.4, take the expanded window as the current window, start a new round of pixel infiltration, and judge the relationship between the pixel brightness in the 8-neighborhood D c of the current infiltration area D p and the initial threshold T; if If there is a pixel in the 8-neighborhood D c whose brightness is less than the initial threshold T, the pixel is assigned to the infiltration area Dp ; if there is no pixel in the 8-neighborhood D c whose luminance is less than the initial threshold T, the infiltration ends The process shows that there are no pixels belonging to the penetration area D p after expanding the window.

S2.5,判断当前窗口大小是否大于最大窗口大小,即N是否大于M,若大于则结束渗透过程,若小于,否则返回步骤S2.3,进行新一轮的渗透过程,直至渗透结束,得到二值化图像,提取出图像中的ROI。此处的N为扩大后的数值。也就是说,如果经过步骤S2.3和步骤S2.4的第一轮扩大后的窗口大小已经大于最大窗口大小,则结束渗透过程。如果经过步骤S2.3和步骤S2.4的第一轮扩大后的窗口大小是小于最大窗口大小,则再次扩大当前窗口,使当前窗口的大小的N再加2。然后返回步骤S2.3和S2.4进行新一轮的渗透。如此,经过多轮对像素点的渗透,将灰度图像转换为二值化图像,使ROI从背景中分离,增强ROI和背景之间的对比度,如附图3和4所示。S2.5, judge whether the current window size is larger than the maximum window size, that is, whether N is larger than M, if it is larger, the infiltration process is ended, if it is smaller, otherwise return to step S2.3, and perform a new round of infiltration process until the infiltration ends, and obtain Binarize the image and extract the ROI in the image. N here is an enlarged numerical value. That is to say, if the size of the expanded window after the first round of step S2.3 and step S2.4 is already greater than the maximum window size, then the infiltration process ends. If the window size after the first round of expansion through steps S2.3 and S2.4 is smaller than the maximum window size, then expand the current window again, so that the size of the current window is increased by 2. Then return to steps S2.3 and S2.4 for a new round of infiltration. In this way, after multiple rounds of infiltration of pixels, the grayscale image is converted into a binary image, the ROI is separated from the background, and the contrast between the ROI and the background is enhanced, as shown in Figures 3 and 4.

对于获取ROI图像中的单像素骨架信息,采用改进型OPTA算法进行获取,改进型OPTA算法具体过程如下,其中设置当前检测像素点为P,相邻像素点为Q,按照图5所示的抽取领域,在删除模板、保留模板中1表示ROI的像素点,0表示背景点。For obtaining the single-pixel skeleton information in the ROI image, the improved OPTA algorithm is used to obtain it. The specific process of the improved OPTA algorithm is as follows, in which the current detection pixel is set as P , and the adjacent pixel is Q , and the extraction is shown in Figure 5 Field, in the deletion template and the retention template, 1 represents the pixel point of ROI, and 0 represents the background point.

将二值化图像中的ROI中的每个像素点,与预先设定好的8个消除模板进行匹配,若不存在相同的消除模板,则保留当前像素点;若存在相同的消除模板则将当前像素点再与9个保留模板进行匹配,若存在相同的保留模板,则保留当前像素点,若不存在相同的保留模板则删除当前像素点,直至将ROI中的所有像素点一一匹配,得到ROI的单像素骨架。Each pixel in the ROI in the binarized image is matched with 8 preset elimination templates. If there is no identical elimination template, the current pixel is retained; if there is the same elimination template, the The current pixel is matched with 9 reserved templates. If there is the same reserved template, the current pixel is retained. If there is no identical reserved template, the current pixel is deleted until all the pixels in the ROI are matched one by one. Get a single-pixel skeleton of the ROI.

也就是说,先将当前二值图像中ROI的所有像素点与图6所示的预先定义的8个消除模板对比,若存在某像素点与某一模板匹配,则继续与预先设定好的9个保留模板进行匹配,否则保留该像素点。然后继续与图7所示的预先设定好的9个保留模板进行匹配,若存在某像素点与某一模板匹配,则保留该像素点,否则设置该像素点为背景点,从像素骨架中删除。最后确定是否所有像素点都与消除模板和保留模板进行匹配过,如果是,则结束,如果不是,则继续匹配直到完成所有像素点的匹配。如此,通过上述的多轮迭代,得到如附图8所示的单像素骨架。That is to say, first compare all the pixels of the ROI in the current binary image with the 8 predefined elimination templates shown in Fig. 9 reserved templates are used for matching, otherwise the pixel is reserved. Then continue to match with the 9 pre-set reserved templates shown in Figure 7. If there is a pixel that matches a certain template, then keep the pixel, otherwise set the pixel as the background point, from the pixel skeleton delete. Finally, it is determined whether all pixels have been matched with the elimination template and the retention template, if yes, then end, if not, continue to match until all pixel points are matched. In this way, through the above-mentioned multiple rounds of iterations, a single-pixel skeleton as shown in FIG. 8 is obtained.

最后,裂纹的判断,硬塑材料表面含有块状斑点、油污、裂纹等缺陷,根据不同缺陷的几何特征给出如下判定步骤。Finally, for the judgment of cracks, the surface of hard plastic materials contains defects such as blocky spots, oil stains, and cracks. The following judgment steps are given according to the geometric characteristics of different defects.

根据缺陷几何形状的不同利用圆形度,将块状缺陷从经过渗透算法所提取的ROI中去除,最终获得只含线性区域的ROI。圆形度如以下公式所示。其中P表示ROI的周长,S为ROI的面积,C为圆形度。圆形度用来判断线性复杂度,点或片状区域的圆形度接近1,圆形度越大表明区域线性越复杂。设圆形度阈值为T circle ,将C小于T circle 的ROI删除。According to the difference of the geometric shape of the defect, the circularity is used to remove the blocky defect from the ROI extracted by the penetration algorithm, and finally obtain the ROI containing only the linear region. The circularity is shown in the following formula. Where P represents the perimeter of the ROI, S is the area of the ROI, and C is the circularity. The circularity is used to judge the linear complexity. The circularity of a point or sheet area is close to 1. The larger the circularity, the more complex the linearity of the area. Set the circularity threshold as T circle , and delete the ROI whose C is smaller than T circle .

对ROI进行骨架提取。硬塑材料特殊性,以及形成裂纹的机理,使得硬塑材料表面裂纹具有细长、复杂的特点,且具有分叉点。采用改进的OPTA获得裂纹区域单像素骨架信息,通过8邻域点判别法对裂纹骨架进行分析判断,8邻域法如图9所示,图中(i,j)为当前像素点,N1、N2、.....、N8为8邻域点。选取裂纹图像如图8和划痕图像如图10所示。根据裂痕存在分叉点的特性,若骨架图像中存在邻域点个数超过2的像素点,判定为裂纹,即如图10所示,图8中含有邻域点个数大于2的像素点具有两个分叉处,该两处分叉中心的像素点具有两个邻域点个数,表明硬塑材料表面图像中含有裂纹。当然,实际中,可能具有3个、4个或者更多邻域点,只要大于2的邻域点个数,都判定为具有裂纹。Skeleton extraction is performed on the ROI. Due to the particularity of hard plastic materials and the mechanism of crack formation, the cracks on the surface of hard plastic materials are slender, complex, and have bifurcation points. The improved OPTA is used to obtain the single-pixel skeleton information in the crack area, and the crack skeleton is analyzed and judged by the 8-neighborhood point discrimination method. N2, ..., N8 are 8 neighborhood points. The selected crack image is shown in Figure 8 and the scratch image is shown in Figure 10. According to the characteristics of bifurcation points in cracks, if there are pixels with more than 2 neighbor points in the skeleton image, it is judged as a crack, that is, as shown in Figure 10, there are pixels with more than 2 neighbor points in Figure 8 There are two bifurcations, and the pixel points at the center of the two bifurcations have two neighbor points, indicating that the surface image of the hard plastic material contains cracks. Of course, in practice, there may be 3, 4 or more neighboring points, as long as the number of neighboring points is greater than 2, it is determined to have cracks.

需要说明的是,以上所述并非是对本发明技术方案的限定,在不脱离本发明的创造构思的前提下,任何显而易见的替换均在本发明的保护范围之内。It should be noted that the above description is not a limitation to the technical solution of the present invention, and any obvious replacements are within the protection scope of the present invention without departing from the inventive concept of the present invention.

Claims (3)

1.一种硬塑材料表面的裂纹检测方法,包括以下步骤:1. A crack detection method on the surface of a hard plastic material, comprising the following steps: S1,获取硬塑材料表面灰度图像;S1, acquiring the grayscale image of the surface of the hard plastic material; S2,对获取得到的灰度图像进行二值化处理得到二值图像,采用渗透算法进行处理,提取该灰度图像中的裂纹区域ROI图像,使该ROI与灰度图像中的背景相分离,计算ROI的圆形度,其中P表示ROI的周长,S为ROI的面积,C为圆形度,设圆形度阈值为Tcircle,将C小于Tcircle的ROI删除;S2, performing binarization processing on the acquired grayscale image to obtain a binary image, and processing with a penetration algorithm, extracting the ROI image of the crack area in the grayscale image, and separating the ROI from the background in the grayscale image, Calculate the circularity of the ROI, Where P represents the perimeter of the ROI, S is the area of the ROI, and C is the circularity. The circularity threshold is set to Tcircle, and the ROI with C smaller than Tcircle is deleted; S3,获取ROI图像中的单像素骨架信息,采用改进型OPTA算法进行获取,具体包括:S3, obtain the single-pixel skeleton information in the ROI image, and use the improved OPTA algorithm to obtain, specifically including: 将二值化图像中的ROI中的每个像素点,与预先设定好的8个消除模板进行匹配,若不存在相同的消除模板,则保留当前像素点;若存在相同的消除模板则将当前像素点再与9个保留模板进行匹配,若存在相同的保留模板,则保留当前像素点,若不存在相同的保留模板则删除当前像素点,直至将ROI中的所有像素点一一匹配,得到ROI的单像素骨架;Each pixel in the ROI in the binarized image is matched with 8 preset elimination templates. If there is no identical elimination template, the current pixel is retained; if there is the same elimination template, the The current pixel is matched with 9 reserved templates. If there is the same reserved template, the current pixel is retained. If there is no identical reserved template, the current pixel is deleted until all the pixels in the ROI are matched one by one. Get the single-pixel skeleton of ROI; S4,对ROI图像的单像素骨架信息进行像素点分析,将符合裂纹特征的产品进行标记;S4, performing pixel point analysis on the single-pixel skeleton information of the ROI image, and marking products that meet the crack characteristics; 所述对灰度图像进行二值化处理时,采用渗透算法进行处理,具体包括以下步骤:When the grayscale image is binarized, the infiltration algorithm is used to process it, which specifically includes the following steps: S2.1,设定最大窗口为M×M,当前窗口大小为N×N,将当前窗口中心的像素点设置为种子像素点,该种子像素点为渗透区域Dp内的点,从该种子像素点开始渗透,该种子像素点的亮度I(ps)设置为初始阈值T;S2.1, set the maximum window to M×M, the current window size to N×N, set the pixel in the center of the current window as the seed pixel, and the seed pixel is a point in the penetration area Dp , from the seed The pixel starts to penetrate, and the brightness I(ps) of the seed pixel is set as the initial threshold T; S2.2,渗透区域Dp的8邻域为Dc,判断渗透区域Dc内的像素点亮度与初始阈值T之间的大小关系,如果8邻域Dc内某一个像素点的亮度值小于初始阈值T,则将该像素点属于渗透区域Dp,否则将该像素点归属于背景DbS2.2, the 8-neighborhood of the penetration area D p is D c , judge the size relationship between the brightness of the pixel in the penetration area D c and the initial threshold T, if the brightness value of a pixel in the 8-neighborhood D c If it is smaller than the initial threshold T, the pixel belongs to the penetration area D p , otherwise the pixel belongs to the background D b ; S2.3,判断渗透区域Dp是否抵达当前窗口边界,若渗透区域Dp未抵达当前窗口边界,则返回步骤S2.2继续当前渗透过程;若渗透区域Dp抵达当前窗口边界,则扩大当前窗口的大小,使N=N+2;S2.3. Determine whether the penetration area D p has reached the current window boundary. If the penetration area D p has not reached the current window boundary, return to step S2.2 to continue the current penetration process; if the penetration area D p reaches the current window boundary, expand the current window. The size of the window such that N=N+2; S2.4,以扩大后的窗口为当前窗口,开始新一轮的像素点渗透,判断当前渗透区域Dp的8邻域Dc内的像素点亮度与初始阈值T之间的大小关系;如果Dc内存在亮度小于初始阈值T的像素点,则将该像素点归属于渗透区域Dp;如果Dc内不存在亮度值小于初始阈值T的像素点,则结束渗透过程;S2.4, take the expanded window as the current window, start a new round of pixel infiltration, and judge the relationship between the pixel brightness in the 8-neighborhood D c of the current infiltration area D p and the initial threshold T; if If there is a pixel in D c whose luminance is less than the initial threshold T, the pixel is assigned to the infiltration area Dp ; if there is no pixel in D c whose luminance is less than the initial threshold T, the infiltration process ends; S2.5,判断当前窗口大小是否大于最大窗口大小,即N是否大于M,若大于则结束渗透过程,若小于,否则返回步骤S2.3,进行新一轮的渗透过程,直至渗透结束,得到二值化图像,提取出图像中的ROI。S2.5, judge whether the current window size is larger than the maximum window size, that is, whether N is larger than M, if it is larger, the infiltration process is ended, if it is smaller, otherwise return to step S2.3, and perform a new round of infiltration process until the infiltration ends, and obtain Binarize the image and extract the ROI in the image. 2.根据权利要求1所述的硬塑材料表面的裂纹检测方法,其特征在于,所述窗口内的像素点的亮度值,通过下列公式更新计算得到,其中I(p)表示像素点亮度:2. the crack detection method on the hard plastic material surface according to claim 1, is characterized in that, the luminance value of the pixel point in the described window is updated and calculated by following formula, and wherein I (p) represents the pixel point luminance: <mrow> <mi>T</mi> <mo>=</mo> <mi>m</mi> <mi>a</mi> <mi>x</mi> <mrow> <mo>(</mo> <munder> <mrow> <mi>m</mi> <mi>a</mi> <mi>x</mi> </mrow> <mrow> <mi>p</mi> <mo>&amp;Element;</mo> <msub> <mi>D</mi> <mi>p</mi> </msub> </mrow> </munder> <mo>(</mo> <mrow> <mi>I</mi> <mrow> <mo>(</mo> <mi>p</mi> <mo>)</mo> </mrow> </mrow> <mo>)</mo> <mo>,</mo> <mi>T</mi> <mo>)</mo> </mrow> <mo>+</mo> <mi>w</mi> <mo>.</mo> </mrow> <mrow><mi>T</mi><mo>=</mo><mi>m</mi><mi>a</mi><mi>x</mi><mrow><mo>(</mo><munder><mrow><mi>m</mi><mi>a</mi><mi>x</mi></mrow><mrow><mi>p</mi><mo>&amp;Element;</mo><msub><mi>D</mi><mi>p</mi></msub></mrow></munder><mo>(</mo><mrow><mi>I</mi><mrow><mo>(</mo><mi>p</mi><mo>)</mo></mrow></mrow><mo>)</mo><mo>,</mo><mi>T</mi><mo>)</mo></mrow><mo>+</mo><mi>w</mi><mo>.</mo></mrow> 3.根据权利要求2所述的硬塑材料表面的裂纹检测方法,其特征在于,所述步骤S4中,具体采用8邻域判定法进行裂纹判定,若该单像素骨架中含有邻域点个数大于2的像素点,则当前的硬塑材料表面具有裂纹。3. The crack detection method on the surface of a hard plastic material according to claim 2, characterized in that, in the step S4, specifically adopting the 8-neighborhood determination method to determine the crack, if the single-pixel skeleton contains a number of neighborhood points If the number of pixels is greater than 2, the surface of the current hard plastic material has cracks.
CN201510580957.2A 2015-09-14 2015-09-14 A kind of crack detecting method on hard plastic material surface Active CN105092597B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510580957.2A CN105092597B (en) 2015-09-14 2015-09-14 A kind of crack detecting method on hard plastic material surface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510580957.2A CN105092597B (en) 2015-09-14 2015-09-14 A kind of crack detecting method on hard plastic material surface

Publications (2)

Publication Number Publication Date
CN105092597A CN105092597A (en) 2015-11-25
CN105092597B true CN105092597B (en) 2018-05-29

Family

ID=54573512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510580957.2A Active CN105092597B (en) 2015-09-14 2015-09-14 A kind of crack detecting method on hard plastic material surface

Country Status (1)

Country Link
CN (1) CN105092597B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446905B (en) * 2016-07-25 2019-05-28 广东省智能制造研究所 The extracting method for the face crack texture that percolation algorithm and adaptive Canny algorithm blend
CN107331029B (en) * 2017-06-23 2019-09-20 深圳怡化电脑股份有限公司 Bank note dislocation detection method, device, equipment and storage medium
CN107991307B (en) * 2017-08-28 2020-04-28 中国人民解放军总后勤部油料研究所 Automatic detection device and method for surface cracks of soft material
CN109752391B (en) * 2018-12-25 2020-06-30 中国农业大学 A quantification method for carrot surface defect recognition based on machine vision
CN111555150B (en) * 2020-05-14 2022-01-18 广东电网有限责任公司 Distribution box
CN113899746B (en) * 2021-09-30 2024-05-17 江苏纹动测控科技有限公司 A DIC-based method for measuring fatigue crack growth morphology in steel structures
CN117274240B (en) * 2023-11-17 2024-01-23 资阳建工建筑有限公司 Bearing platform foundation concrete surface crack identification method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382999A (en) * 2008-10-17 2009-03-11 哈尔滨工业大学 A Fast and Efficient Fingerprint Thinning Method
KR101328266B1 (en) * 2011-12-26 2013-11-14 주식회사 포스코 Apparatus for detecting surface crack of hot slab
WO2015001624A1 (en) * 2013-07-03 2015-01-08 株式会社 日立製作所 Ultrasonic flaw detection method, ultrasonic flaw detection device, and weld inspection method for panel structure
CN104535589A (en) * 2015-01-20 2015-04-22 广东电网有限责任公司电力科学研究院 Online detection method and device for low-voltage current mutual inductor
CN104616275A (en) * 2013-11-04 2015-05-13 北京兆维电子(集团)有限责任公司 Defect detecting method and defect detecting device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382999A (en) * 2008-10-17 2009-03-11 哈尔滨工业大学 A Fast and Efficient Fingerprint Thinning Method
KR101328266B1 (en) * 2011-12-26 2013-11-14 주식회사 포스코 Apparatus for detecting surface crack of hot slab
WO2015001624A1 (en) * 2013-07-03 2015-01-08 株式会社 日立製作所 Ultrasonic flaw detection method, ultrasonic flaw detection device, and weld inspection method for panel structure
CN104616275A (en) * 2013-11-04 2015-05-13 北京兆维电子(集团)有限责任公司 Defect detecting method and defect detecting device
CN104535589A (en) * 2015-01-20 2015-04-22 广东电网有限责任公司电力科学研究院 Online detection method and device for low-voltage current mutual inductor

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种改进的图像模板细化算法;王家隆等;《中国图像图形学报》;20040331;正文第299-300页,附图5、7 *
基于图像处理的铁路混凝土桥梁裂纹探测和信息获取;张登峰;《中国优秀硕士学位论文全文数据库》;20140715;正文第24-27页 *

Also Published As

Publication number Publication date
CN105092597A (en) 2015-11-25

Similar Documents

Publication Publication Date Title
CN105092597B (en) A kind of crack detecting method on hard plastic material surface
CN115345885B (en) Appearance quality detection method for metal fitness equipment
Anand et al. Flaw detection in radiographic weldment images using morphological watershed segmentation technique
CN103839268B (en) Method for detecting fissure on surface of subway tunnel
CN103488988B (en) Method for extracting insulators in electrical equipment based on unmanned aerial vehicle line patrol visible light image
CN102663726B (en) Method and device for material segmentation of material accumulation images
CN109544583B (en) Method, device and equipment for extracting interested area of leather image
CN106157303A (en) A kind of method based on machine vision to Surface testing
CN109215009B (en) Continuous casting billet surface image defect detection method based on deep convolution neural network
CN108830857B (en) An Adaptive Binarization Segmentation Method for Chinese Inscriptions on Inscriptions
CN113012124B (en) Shoe print hole and embedded object feature detection and description method
JP5812705B2 (en) Crack detection method
CN106447673A (en) Chip pin extraction method under non-uniform illumination condition
CN106097368A (en) A kind of recognition methods in veneer crack
CN108020554A (en) A kind of steel strip surface defect recognition detection method
CN107862689A (en) Leather surface substantially damaged automatic identifying method and computer-readable recording medium
CN110458843B (en) Method and system for segmentation of mask images
CN112085699A (en) Pavement crack extraction method based on two-dimensional image
CN109767426B (en) Shield tunnel water leakage detection method based on image feature recognition
CN105447489A (en) Character and background adhesion noise elimination method for image OCR system
CN104992175A (en) Over-merged steel billet character segmentation method based on tree type relationship
CN104240252A (en) Detecting Algorithm for cracks of surface of high-temperature billet of machine vision bar
Fang et al. Towards real-time crack detection using a deep neural network with a Bayesian fusion algorithm
CN115761613A (en) Automatic tunnel crack detection method based on convolutional network
CN104657972A (en) Ambiguity judging method and system of image block

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180516

Address after: 510000 water Donggang 8, Dongfeng East Road, Yuexiu District, Guangzhou, Guangdong.

Applicant after: ELECTRIC POWER RESEARCH INSTITUTE, GUANGDONG POWER GRID CO., LTD.

Applicant after: Guangdong Institute of intelligent manufacturing

Address before: 510000 water Donggang 8, Dongfeng East Road, Yuexiu District, Guangzhou, Guangdong.

Applicant before: ELECTRIC POWER RESEARCH INSTITUTE, GUANGDONG POWER GRID CO., LTD.

Applicant before: Guangdong Institute of Automation

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200424

Address after: 510080 Dongfeng East Road, Dongfeng, Guangdong, Guangzhou, Zhejiang Province, No. 8

Patentee after: Electric Power Research Institute of Guangdong Power Grid Co.,Ltd.

Address before: 510000, Guangdong, Guangzhou province Yuexiu District Dongfeng East Road water all Gang 8

Co-patentee before: GUANGDONG INSTITUTE OF INTELLIGENT MANUFACTURING

Patentee before: Electric Power Research Institute of Guangdong Power Grid Co.,Ltd.