技术领域technical field
本发明涉及一种无损检测方法,具体涉及一种表面裂纹检测算法。The invention relates to a non-destructive detection method, in particular to a surface crack detection algorithm.
背景技术Background technique
连铸坯表面裂纹现象在生产流程中是不可避免的,若检测到裂纹就需要进行精整,甚至可能产生废品,在线检测表面裂意义重大。利用图像识别技术对裂纹进行检测是一个主要技术手段,但识别准确率不尽人意。Cracks on the surface of continuous casting slabs are inevitable in the production process. If cracks are detected, finishing needs to be carried out, and even waste products may be generated. Online detection of surface cracks is of great significance. Using image recognition technology to detect cracks is a major technical means, but the recognition accuracy is not satisfactory.
发明内容Contents of the invention
本发明克服了现有技术的不足,提出了一种表面裂纹检测算法。所述算法对图像进行识别,分类,能快速获得裂纹缺陷的范围空间,获得较好的提取和识别效果,表面缺陷识别效果好,裂纹识别率高;可靠性高,数据准确。The invention overcomes the deficiencies of the prior art and proposes a surface crack detection algorithm. The algorithm recognizes and classifies images, can quickly obtain the range space of crack defects, and obtains better extraction and recognition effects, good surface defect recognition effects, high crack recognition rate, high reliability, and accurate data.
所述算法表面裂纹的识别率可以达到97%以上。The identification rate of surface cracks of the algorithm can reach more than 97%.
本发明的技术方案为:一种表面裂纹检测算法,通过摄像设备获取图像,然后对获取的图像进行处理,包括七个步骤:The technical solution of the present invention is: a surface crack detection algorithm, which acquires images through camera equipment, and then processes the acquired images, including seven steps:
第一步,二值图像输入处理The first step, binary image input processing
把检测到的图像经过黑白模式处理后,形成二值图像f(x,y);After the detected image is processed in black and white mode, a binary image f(x, y) is formed;
第二步,图像邻域化操作The second step, the image neighborhood operation
在图像上的任意像素q(m,n),连结像素q(m,n)的像素p(i,j),若满足At any pixel q(m,n) on the image, the pixel p(i,j) connecting the pixel q(m,n) satisfies
|i-m|+|j-n|=1或|i-m|=|j-n|=1|i-m|+|j-n|=1 or |i-m|=|j-n|=1
此时的像素p(i,j)被称为像素q(m,n)的邻域,其中,i、j、m、n分别为二值图像f(x,y)上的行或列,当某黑像素p(i,j)的邻域的像素有一个为白像素时,置p(i,j)为白像素,称此运算为裂纹擦除运算;当某白像素p(i,j)的邻域的像素有一个为黑像素时,置q(j-k)为黑像素,则称此运算为裂纹识别运算;对二值图像g(y-z)从左上角开始到右下角止进行扫描,每次扫描执行裂纹擦除运算,擦除初期,粗裂纹和较细的裂纹受到擦除,每次裂纹擦除运算黑像素减少量相等,黑像素总数线性下降,擦除N次时,黑像素总数下降情况有突变;转第三步;The pixel p(i, j) at this time is called the neighborhood of the pixel q(m, n), where i, j, m, n are the rows or columns on the binary image f(x, y), respectively, When one of the pixels in the neighborhood of a certain black pixel p(i, j) is a white pixel, set p(i, j) as a white pixel, and this operation is called crack erasing operation; when a certain white pixel p(i, j) When one of the pixels in the neighborhood of j) is a black pixel, set q(j-k) as a black pixel, and this operation is called a crack recognition operation; scan the binary image g(y-z) from the upper left corner to the lower right corner , the crack erasing operation is performed for each scan. At the initial stage of erasing, coarse cracks and thinner cracks are erased. The reduction of black pixels is equal in each crack erasing operation, and the total number of black pixels decreases linearly. When erasing N times, the black pixels There is a sudden change in the decrease of the total number of pixels; go to the third step;
第三步,记录此时进行裂纹擦除运算的次数,并继续对图像进行裂纹擦除运算;黑像素总数又线性下降,擦除O次时,黑像素总数有突变,转第四步,否则,继续操作;The third step is to record the number of crack erasing operations performed at this time, and continue to perform crack erasing operations on the image; the total number of black pixels decreases linearly again. When erasing O times, the total number of black pixels has a sudden change, and then turn to the fourth step, otherwise , continue to operate;
第四步,若N和O均小于21,转第七步,若M或O大于21,识别粗裂纹,转第五步,识别细裂纹,转第六步;Step 4, if both N and O are less than 21, go to step 7, if M or O is greater than 21, identify coarse cracks, go to step 5, identify fine cracks, go to step 6;
第五步,记录N和O,对经过擦除后的二值图像g(y-z),从左上角开始到右下角止进行扫描,进行N次裂纹识别运算,即大致识别了粗裂纹,记录操作时的行列坐标,即可判断粗裂纹的范围;The fifth step is to record N and O, scan the erased binary image g(y-z) from the upper left corner to the lower right corner, and perform N times of crack identification operations, that is, roughly identify coarse cracks, and record the operation The row and column coordinates at the time can judge the scope of the coarse crack;
第六步,记录N和O,对经过擦除后的二值图像g(y-z),从左上角开始到右下角止进行扫描,进行O次裂纹识别运算,即大致识别了细裂纹,记录操作时的行列坐标,即可判断细裂纹的范围;The sixth step is to record N and O, scan the erased binary image g(y-z) from the upper left corner to the lower right corner, and perform O times of crack identification operations, that is, roughly identify fine cracks, and record the operation The row and column coordinates at the time can judge the scope of fine cracks;
第七步,停止。Step seven, stop.
本发明具有如下有益效果:The present invention has following beneficial effects:
1)本发明能快速获得裂纹缺陷的范围空间,获得较好的提取和识别效果。1) The present invention can quickly obtain the range space of crack defects, and obtain better extraction and identification effects.
2)本发明表面缺陷识别效果好,裂纹识别率高;2) The present invention has good surface defect recognition effect and high crack recognition rate;
3)本发明信噪比高,缺陷分辨能力强;3) The present invention has high signal-to-noise ratio and strong defect resolution capability;
4)本发明可靠性高,数据准确。4) The present invention has high reliability and accurate data.
具体实施方式detailed description
本发明通过摄像设备获取图像,然后对获取的图像进行处理,包括七个步骤:The present invention acquires images through camera equipment, and then processes the acquired images, including seven steps:
第一步,二值图像输入处理The first step, binary image input processing
把检测到的图像经过黑白模式处理后,形成二值图像g(y-z);After the detected image is processed in black and white mode, a binary image g(y-z) is formed;
第二步,图像邻域化操作The second step, the image neighborhood operation
在图像上的任意像素r(n-o),连结像素r(n-o)的像素q(j-k),若满足At any pixel r(n-o) on the image, the pixel q(j-k) connecting the pixel r(n-o) satisfies
|i-m|+|j-n|=1或|i-m|=|j-n|=1|i-m|+|j-n|=1 or |i-m|=|j-n|=1
此时的像素q(j-k)被称为像素r(n-o)的邻域,其中,i、j、k、o分别为二值图像g(y-z)上的行或列,当某黑像素q(j-k)的邻域的像素有一个为白像素时,置q(j-k)为白像素,称此运算为裂纹擦除运算;当某白像素q(j-k)的邻域的像素有一个为黑像素时,置q(j-k)为黑像素,则称此运算为裂纹识别运算;对二值图像g(y-z)从左上角开始到右下角止进行扫描,每次扫描执行裂纹擦除运算,擦除初期,粗裂纹和较细的裂纹受到擦除,每次裂纹擦除运算黑像素减少量相等,黑像素总数线性下降,擦除N次时,黑像素总数下降情况有突变;转第三步The pixel q(j-k) at this time is called the neighborhood of the pixel r(n-o), where i, j, k, and o are the rows or columns on the binary image g(y-z) respectively. When a black pixel q( When one of the pixels in the neighborhood of j-k) is a white pixel, set q(j-k) as a white pixel, and this operation is called crack erasing operation; when a pixel in the neighborhood of a white pixel q(j-k) has a black pixel When q(j-k) is set as a black pixel, this operation is called a crack recognition operation; the binary image g(y-z) is scanned from the upper left corner to the lower right corner, and the crack erasing operation is performed for each scan, erasing In the initial stage, coarse cracks and thinner cracks are erased, and the reduction of black pixels is equal to each crack erasing operation, and the total number of black pixels decreases linearly. When erasing N times, the total number of black pixels decreases abruptly; go to the third step
第三步,记录此时进行裂纹擦除运算的次数,并继续对图像进行裂纹擦除运算;黑像素总数又线性下降,擦除O次时,黑像素总数有突变,转第四步,否则,继续操作;The third step is to record the number of crack erasing operations performed at this time, and continue to perform crack erasing operations on the image; the total number of black pixels decreases linearly again. When erasing O times, the total number of black pixels has a sudden change, and then turn to the fourth step, otherwise , continue to operate;
第四步,若N和O均小于21,转第七步,若M或O大于21,识别粗裂纹,转第五步,识别细裂纹,转第六步;Step 4, if both N and O are less than 21, go to step 7, if M or O is greater than 21, identify coarse cracks, go to step 5, identify fine cracks, go to step 6;
第五步,记录N和O,对经过擦除后的二值图像g(y-z),从左上角开始到右下角止进行扫描,进行O次裂纹识别运算,即大致识别了粗裂纹,记录操作时的行列坐标,即可判断粗裂纹的范围;The fifth step is to record N and O, scan the erased binary image g(y-z) from the upper left corner to the lower right corner, and perform O times of crack identification operations, that is, roughly identify coarse cracks, and record the operation The row and column coordinates at the time can judge the scope of the coarse crack;
第六步,记录N和O,对经过擦除后的二值图像g(y-z),从左上角开始到右下角止进行扫描,进行O次裂纹识别运算,即大致识别了细裂纹,记录操作时的行列坐标,即可判断细裂纹的范围;The sixth step is to record N and O, scan the erased binary image g(y-z) from the upper left corner to the lower right corner, and perform O times of crack identification operations, that is, roughly identify fine cracks, and record the operation The row and column coordinates at the time can judge the scope of fine cracks;
第七步,停止。Step seven, stop.
上述算法可以实现多个宽度的裂纹识别,下面以得到裂纹图像为例,介绍这个算法的裂纹图像识别算法实现过程。The above algorithm can realize crack recognition with multiple widths. Taking the crack image as an example, the implementation process of the crack image recognition algorithm of this algorithm will be introduced.
输入:二值图像g(y-z)Input: binary image g(y-z)
输出:仅带有粗裂纹的图像。Output: Image with only coarse cracks.
算法过程:Algorithm process:
计算图面黑像素总数T,1>1,B>21.N>1,O>1;Calculate the total number of black pixels T on the drawing surface, 1>1, B>21.N>1, O>1;
进行裂纹擦除运算,计算当前图面黑像素总数T2,令EfmUb2>T.!T2,T>!T2,I>1,2!继续擦除,计算当前图面黑像素总数T2,EfmUb3>T.!T2,T>!T2,1>1,2,N>!3N,2!若}!EfmUb3.!EfmUb2}=B,EfmUb2>(EfmUb2,!EfmUb3)OB,转4,否则,!X>3+)!1!2*!裂纹识别XOB次,即得粗裂纹图象;Carry out the crack erasing operation, calculate the total number of black pixels T2 on the current drawing, and set EfmUb2>T.! T2, T>! T2, I > 1, 2! Continue to erase, calculate the total number of black pixels T2 on the current image, EfmUb3>T.! T2, T>! T2, 1>1, 2, N>! 3N, 2! like}! EfmUb3.! EfmUb2}=B, EfmUb2>(EfmUb2,!EfmUb3) OB, go to 4, otherwise, ! X>3+)! 1! 2*! The crack is identified XOB times, and the coarse crack image is obtained;
确认裂纹范围参数N,结束。Confirm the crack range parameter N, end.
在上面的算法中,求得的X是粗裂纹的平均裂纹宽度,所得的图象仅剩粗裂纹,若想得到细裂纹,可以把原图象减去裂纹图象。In the above algorithm, the obtained X is the average crack width of coarse cracks, and only coarse cracks remain in the obtained image. If you want to get fine cracks, you can subtract the crack image from the original image.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410052397.9ACN103776839B (en) | 2014-02-10 | 2014-02-10 | A kind of Surface Crack Inspection Algorithm |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410052397.9ACN103776839B (en) | 2014-02-10 | 2014-02-10 | A kind of Surface Crack Inspection Algorithm |
| Publication Number | Publication Date |
|---|---|
| CN103776839A CN103776839A (en) | 2014-05-07 |
| CN103776839Btrue CN103776839B (en) | 2016-05-04 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201410052397.9AActiveCN103776839B (en) | 2014-02-10 | 2014-02-10 | A kind of Surface Crack Inspection Algorithm |
| Country | Link |
|---|---|
| CN (1) | CN103776839B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0455898A1 (en)* | 1990-05-09 | 1991-11-13 | Robert Bishop | Image scanning inspection system |
| US6233364B1 (en)* | 1998-09-18 | 2001-05-15 | Dainippon Screen Engineering Of America Incorporated | Method and system for detecting and tagging dust and scratches in a digital image |
| CN1588428A (en)* | 2004-08-06 | 2005-03-02 | 上海大学 | Pre-processing method for skin micro image |
| CN101424645A (en)* | 2008-11-20 | 2009-05-06 | 上海交通大学 | Soldered ball surface defect detection device and method based on machine vision |
| CN102346013A (en)* | 2010-07-29 | 2012-02-08 | 同济大学 | Tunnel lining crack width measuring method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0455898A1 (en)* | 1990-05-09 | 1991-11-13 | Robert Bishop | Image scanning inspection system |
| US6233364B1 (en)* | 1998-09-18 | 2001-05-15 | Dainippon Screen Engineering Of America Incorporated | Method and system for detecting and tagging dust and scratches in a digital image |
| CN1588428A (en)* | 2004-08-06 | 2005-03-02 | 上海大学 | Pre-processing method for skin micro image |
| CN101424645A (en)* | 2008-11-20 | 2009-05-06 | 上海交通大学 | Soldered ball surface defect detection device and method based on machine vision |
| CN102346013A (en)* | 2010-07-29 | 2012-02-08 | 同济大学 | Tunnel lining crack width measuring method and device |
| Title |
|---|
| 《基于数字图像分析的碳钢腐蚀等级评定方法》;刘淼;《腐蚀与防护》;20131130;第34卷(第11期);997-1000* |
| 基于机器视觉的表面缺陷检测系统的算法研究及软件设计;陈勇;《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》;20070615(第06期);全文* |
| 数字图像技术在棒材和锻件超声检测中的应用研究;宋电子;《中国优秀博硕士学位论文全文数据库(硕士) 工程科技Ⅱ辑》;20040415(第04期);全文* |
| 沥青路面裂纹检测算法研究;孟乔;《中国优秀硕士学位论文全文数据库 信息科技辑》;20110315(第03期);全文* |
| Publication number | Publication date |
|---|---|
| CN103776839A (en) | 2014-05-07 |
| Publication | Publication Date | Title |
|---|---|---|
| CN108665458B (en) | Method for extracting and identifying surface defects of transparent body | |
| TWI643280B (en) | Defect detection using structural information | |
| CN106920245B (en) | Boundary detection method and device | |
| CN108416766A (en) | Visual inspection method for defects of double-side incident light guide plate | |
| JP2008277730A5 (en) | ||
| JP5812705B2 (en) | Crack detection method | |
| CN106780455A (en) | A kind of product surface detection method based on the local neighborhood window for sliding | |
| CN113284113B (en) | Glue overflow defect detection method, device, computer equipment and readable storage medium | |
| CN105931246A (en) | Fabric flaw detection method based on wavelet transformation and genetic algorithm | |
| CN105427324A (en) | Magneto-optic imaging defect detection method based on automatic search of binary threshold | |
| CN108511359A (en) | The detection method of wafer defect | |
| CN106355590B (en) | Mold residue visual detection method and device based on image difference making | |
| CN112036232B (en) | Image table structure identification method, system, terminal and storage medium | |
| CN104318556A (en) | Silicon steel plate surface defect image detection method under oil pollution interference | |
| Xia et al. | An automatic machine vision-based algorithm for inspection of hardwood flooring defects during manufacturing | |
| CN104568956A (en) | Machine vision based detection method for strip steel surface defects | |
| CN112381765A (en) | Equipment detection method, device, equipment and storage medium based on artificial intelligence | |
| JP2006162477A (en) | Crack detecting method on structural surfaces | |
| CN106290379A (en) | Rail surface defects based on Surface scan camera detection device and method | |
| CN102855642A (en) | Image processing device and object outline extraction method thereof | |
| Vijayan et al. | A survey on surface crack detection in concretes using traditional, image processing, machine learning, and deep learning techniques | |
| Hsu et al. | Fast vision-based surface inspection of defects for steel billets | |
| CN109242917A (en) | One kind being based on tessellated camera resolution scaling method | |
| CN103776839B (en) | A kind of Surface Crack Inspection Algorithm | |
| JP2009139133A (en) | Defect detection method and defect detection apparatus |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C41 | Transfer of patent application or patent right or utility model | ||
| CB03 | Change of inventor or designer information | Inventor after:Wang Jinhe Inventor after:Wang Shuai Inventor after:Wang Yu Inventor before:Wang Jinhe | |
| COR | Change of bibliographic data | ||
| TA01 | Transfer of patent application right | Effective date of registration:20160304 Address after:313000 No. 759, East 2nd Ring Road, Huzhou, Zhejiang Applicant after:Huzhou Teachers College Address before:315016 east campus, 201 Fenghua Road, Jiangbei District, Zhejiang, Ningbo Applicant before:Ningbo University of Technology | |
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right | Effective date of registration:20200721 Address after:Room 401, 4 / F, block a, Chuangzhi building, No.17 Xinghuo Road, Jiangbei new district, Nanjing, Jiangsu Province 210000 Patentee after:Nanjing ningchuang Jingwei Intelligent Technology Co.,Ltd. Address before:313000 No. 759, East 2nd Ring Road, Huzhou, Zhejiang Patentee before:HUZHOU TEACHERS College | |
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address | Address after:Room 507, Floor 5, Building 1, Shengfeng Lianzhigu, No. 67, the Pearl River Road, Xinwu District, Wuxi City, Jiangsu Province, 214142 Patentee after:Jiangsu Ningchuang Jingwei Intelligent Technology Co.,Ltd. Country or region after:China Address before:Room 401, 4th floor, building a, Chuangzhi building, 17 Xinghuo Road, Jiangbei new district, Nanjing City, Jiangsu Province, 210000 Patentee before:Nanjing ningchuang Jingwei Intelligent Technology Co.,Ltd. Country or region before:China |