CN114418921A - Industrial image crack detection method - Google Patents
Industrial image crack detection method Download PDFInfo
- Publication number
- CN114418921A CN114418921A CN202011088177.3A CN202011088177A CN114418921A CN 114418921 A CN114418921 A CN 114418921A CN 202011088177 A CN202011088177 A CN 202011088177A CN 114418921 A CN114418921 A CN 114418921A
- Authority
- CN
- China
- Prior art keywords
- crack
- neighborhood
- image
- detection method
- information entropy
- 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
- 238000001514 detection method Methods 0.000 title claims abstract description 25
- 239000011159 matrix material Substances 0.000 claims description 21
- 230000000877 morphologic effect Effects 0.000 claims description 8
- 230000007797 corrosion Effects 0.000 claims description 5
- 238000005260 corrosion Methods 0.000 claims description 5
- 238000005530 etching Methods 0.000 claims description 5
- 238000000034 method Methods 0.000 claims description 4
- 150000001875 compounds Chemical class 0.000 claims description 3
- 230000003628 erosive effect Effects 0.000 claims 1
- 230000002708 enhancing effect Effects 0.000 abstract 1
- 238000004445 quantitative analysis Methods 0.000 abstract 1
- 230000007547 defect Effects 0.000 description 4
- 238000005286 illumination Methods 0.000 description 4
- 238000011179 visual inspection Methods 0.000 description 3
- 238000013135 deep learning Methods 0.000 description 2
- 230000002950 deficient Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000009776 industrial production Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000012797 qualification Methods 0.000 description 1
- 238000003908 quality control method Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000007306 turnover Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N21/88—Investigating the presence of flaws or contamination
- G01N21/8851—Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/12—Edge-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N21/88—Investigating the presence of flaws or contamination
- G01N21/8851—Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
- G01N2021/8887—Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Quality & Reliability (AREA)
- Signal Processing (AREA)
- Geometry (AREA)
- Life Sciences & Earth Sciences (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Biochemistry (AREA)
- General Health & Medical Sciences (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Image Analysis (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
The invention discloses an industrial image crack detection method, which relates to the field of industrial image flaw detection and comprises the steps of enhancing an image crack area according to an image and reducing the image of an offset field; calculating the width of the crack; the length of the crack was calculated. And carrying out quantitative analysis on the flaw and the crack on the basis so as to judge whether the workpiece belongs to the flaw product.
Description
Technical Field
The invention relates to the field of industrial image flaw detection, in particular to an industrial image crack detection method.
Background
With the continuous progress of society and the continuous development of economy, modern industrial production is prosperous, industrial visual inspection technology is more and more common in more and more modern industrial production, and defects in the production process can be better inspected through an industrial visual inspection system. The surface flaws of industrial products seriously affect the quality of the products, how to avoid the surface flaws to carry out quality control is always the biggest problem faced by production enterprises, and the traditional manual detection has the defects of high cost, easy fatigue of detection personnel, easy flaws and missed detection, and the like. The qualification rate of the quality of the product is improved, the product with poor quality is reduced to be sold to customers, and the public praise of a company is effectively maintained. In addition, industrial visual inspection can also help enterprises to improve productivity, thereby improving turnover of enterprises.
The current machine vision flaw detection system integrates multiple advanced technical applications in the field of machine vision, quickly integrates an innovative detection concept, and can realize detection in different stations or single station by adopting automatic feeding and discharging and automatic removing mechanisms. Therefore, the method can be applied to industries such as automobiles, electronics and the like.
Crack detection is a common defect detection method, however, due to the image of noise, weak boundary, uneven illumination and other factors, it is difficult for the conventional gradient operator to obtain an ideal analysis result. Deep learning methods can better capture crack regions, however, such methods require large amounts of well-calibrated data. For industrial detection, objects to be analyzed are different, so that a deep learning network needs to learn again, and the problem that a large amount of calibrated data is difficult to obtain is solved. Therefore, how to acquire the cracks in the images by using the image processing technology has important research significance.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides an industrial image crack detection method which can detect parameters such as the length and the width of a workpiece crack in an image in time so as to judge whether the workpiece belongs to a qualified product.
In order to achieve the above object, the present invention provides an industrial image crack detection method, which includes the following steps:
s1, reading the image and graying;
s2, calculating the neighborhood information entropy of each pixel point:
in the formula (I), the compound is shown in the specification,the neighborhood of current point x, with size k x k, p (y) is the approximate probability of point y being in the neighborhood:
where mean is the neighborhood mean. Since the crack zone is often lower in intensity than the non-crack zone. Therefore, when the current neighborhood contains cracks, the neighborhood mean value is smaller than the normal area gray level. In order to highlight the crack region information, the probability of the part with the gray scale greater than the mean value region is defined as 0. The larger the proportion of crack regions in the neighborhood is, the larger the information entropy is.
And S3, binarizing the information entropy matrix:
since the image contains a small number of cracks, the crack zone values are higher in the entropy matrix. Therefore, the information entropy matrix can be well binarized by using the mean value and the standard deviation in the whole information entropy:
mean is the integral mean value of the information entropy matrix, and std is the integral standard deviation of the information entropy matrix.
S4, performing morphological corrosion operation on the obtained binary image;
since the neighborhood information is used in S2, the crack region included in the binarized information entropy matrix BW obtained in S3 is larger than the normal crack region range. This step thus etches BW using a morphological etching operation. The size is k × k.
And S5, calculating the length and the width of the crack area.
Due to interference of factors such as noise and uneven illumination, the acquired BW contains a false target. The target area in part of the image to be detected contains an area with lower gray level, so that the BW contains a pseudo target. This step therefore contains the following subdivision steps.
S5-01: each connected region in BW was extracted and area calculated using the following algorithm
Algorithm S5-01
Step 1: constructing a matrix BW2 with the same size as BW, wherein each point takes the value of 0, and defining a counting variable index as 0;
step 2: the BW is traversed in row order, and the first point (denoted as x) equal to 1 is found, and index is index +1, and a stack is built.
Step 3: BW (x) is 0, and BW2(x) is 1.
Step 4: and taking out the 4 neighborhood points of x, and if the value of the 4 neighborhood points in BW is 1 and the value of the 4 neighborhood points in BW2 is 0, pushing the points.
Step 5: if the current stack is not empty, then pop, note x, go to Step 3. If the current stack is empty, go to Step2 until all points in BW are 0.
Step 6: at this point, each connected region corresponds to an index in BW 2. The area of each connected region is calculated.
S5-02: and eliminating the areas with the area smaller than the threshold value and the area larger than the threshold value in the BW2, and setting the corresponding position value to be 0.
S5-03: the width of each connected region is calculated using the following algorithm
Algorithm S5-03
Step 1: a matrix BW3 equal to BW2 is constructed, with each point taking the value 0. Constructing a vector
Wide, recording the width of each connected region. Let index be 1.
Step 2: wide (index) ═ 1, and the region with index in BW2 is obtained
Step 3: performing corrosion operation on BW3, wherein the radius is 1;
step 4: if BW3 contains a non-zero element, wide (index) ═ wide (index) +1, go to Step 3. If BW3 does not contain non-zero elements. The width of the region is denoted as wide (index) ═ wide (index) × 2.
Step 5: index is index + 1; if index is less than the number of connected regions, Step2 is executed. Otherwise, the algorithm is ended.
S5-04: the length of each connected region is calculated using the following algorithm
Algorithm S5-04
Step 1: a matrix BW3 equal to BW2 is constructed, with each point taking the value 0. Constructing a vector
Length, record the Length of each connected region, and let index be 1.
Step 2: (ii) a Wide (index) ═ 1, and the region with index in BW2 is obtained
Step 3: extracting all area boundary points in BW3 and recording as R;
step 4: and (3) calculating the distance between two points in the R, wherein the maximum distance is the neighborhood length (index).
Step 5: index is index + 1; if index is less than the number of connected regions, Step2 is executed. Otherwise, the algorithm is ended.
The invention has the following beneficial effects:
the industrial image crack detection method provided by the invention can objectively quantify information such as the width and the length of the crack in the image, and reduce the influence caused by noise and uneven illumination.
Drawings
The present invention will be further described and illustrated with reference to the following drawings.
Fig. 1 is a flowchart of an industrial image crack detection method according to the present invention.
Figure 2 is an image containing a flaw.
Fig. 3 is an information entropy corresponding to the defective area of fig. 2.
Fig. 4 is a binarization result corresponding to the flaw of fig. 2 obtained by using the information entropy calculation.
FIG. 5 shows the result of morphological etching of the binarized image (FIG. 4).
Detailed Description
The technical solution of the present invention will be more clearly and completely explained by the description of the preferred embodiments of the present invention with reference to the accompanying drawings.
Examples
As shown in fig. 1, the industrial image crack detection method provided by the present invention includes the following steps:
s1, reading the image and graying. Fig. 2 is an original image.
S2, calculating the neighborhood information entropy of each pixel point:
in the formula (I), the compound is shown in the specification,the neighborhood of current point x, with size k x k, p (y) is the approximate probability of point y being in the neighborhood:
where mean is the neighborhood mean. Since the crack zone is often lower in intensity than the non-crack zone. Therefore, when the current neighborhood contains cracks, the neighborhood mean value is smaller than the normal area gray level. In order to highlight the crack region information, the probability of the part with the gray scale greater than the mean value region is defined as 0. The larger the proportion of crack regions in the neighborhood is, the larger the information entropy is. Fig. 3 is the information entropy of fig. 2. From the results, it can be seen that the defective region has a larger information entropy than the other regions.
And S3, binarizing the information entropy matrix:
since the image contains a small number of cracks, the crack zone values are higher in the entropy matrix. Therefore, the information entropy matrix can be well binarized by using the mean value and the standard deviation in the whole information entropy:
mean is the integral mean value of the information entropy matrix, and std is the integral standard deviation of the information entropy matrix. Fig. 4 shows the binarization result.
S4, performing morphological corrosion operation on the obtained binary image;
since the neighborhood information is used in S2, the crack region included in the binarized information entropy matrix BW obtained in S3 is larger than the normal crack region range. This step thus etches BW using a morphological etching operation. The size is k × k. FIG. 5 shows the result of morphological etching of the binarized image.
And S5, calculating the length and the width of the crack area.
Due to interference of factors such as noise and uneven illumination, the acquired BW contains a false target. The target area in part of the image to be detected contains an area with lower gray level, so that the BW contains a pseudo target. This step therefore contains the following subdivision steps.
S5-01: each connected region in BW was extracted and area calculated using the following algorithm
Algorithm S5-01
Step 1: constructing a matrix BW2 with the same size as BW, wherein each point takes the value of 0, and defining a counting variable index as 0;
step 2: the BW is traversed in row order, and the first point (denoted as x) equal to 1 is found, and index is index +1, and a stack is built.
Step 3: BW (x) is 0, and BW2(x) is 1.
Step 4: and taking out the 4 neighborhood points of x, and if the value of the 4 neighborhood points in BW is 1 and the value of the 4 neighborhood points in BW2 is 0, pushing the points.
Step 5: if the current stack is not empty, then pop, note x, go to Step 3. If the current stack is empty, go to Step2 until all points in BW are 0.
Step 6: at this point, each connected region corresponds to an index in BW 2. The area of each connected region is calculated.
S5-02: and eliminating the areas with the area smaller than the threshold value and the area larger than the threshold value in the BW2, and setting the corresponding position value to be 0.
S5-03: the width of each connected region is calculated using the following algorithm
Algorithm S5-03
Step 1: a matrix BW3 equal to BW2 is constructed, with each point taking the value 0. And constructing a vector Wide and recording the width of each connected region. Let index be 1.
Step 2: wide (index) ═ 1, and the region with index in BW2 is obtained
Step 3: performing corrosion operation on BW3, wherein the radius is 1;
step 4: if BW3 contains a non-zero element, wide (index) ═ wide (index) +1, go to Step 3. If BW3 does not contain non-zero elements. The width of the region is denoted as wide (index) ═ wide (index) × 2.
Step 5: index is index + 1; if index is less than the number of connected regions, Step2 is executed. Otherwise, the algorithm is ended.
S5-04: the length of each connected region is calculated using the following algorithm
Algorithm S5-04
Step 1: a matrix BW3 equal to BW2 is constructed, with each point taking the value 0. Constructing a vector
Length, record the Length of each connected region, and let index be 1.
Step 2: (ii) a Wide (index) ═ 1, and the region with index in BW2 is obtained
Step 3: extracting all area boundary points in BW3 and recording as R;
step 4: and (3) calculating the distance between two points in the R, wherein the maximum distance is the neighborhood length (index).
Step 5: index is index + 1; if index is less than the number of connected regions, Step2 is executed. Otherwise, the algorithm is ended.
And S6, judging whether the required result meets the requirement of good products or not, and if not, marking the result as a waste product.
The above detailed description merely describes preferred embodiments of the present invention and does not limit the scope of the invention. Without departing from the spirit and scope of the present invention, it should be understood that various changes, substitutions and alterations can be made herein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims and their equivalents. The scope of the invention is defined by the claims.
Claims (5)
1. An industrial image crack detection method is characterized by comprising the following steps:
s1, acquiring image data and graying;
s2, calculating the information entropy of each pixel point neighborhood;
s3, carrying out binarization by using the information entropy matrix;
s4, performing morphological corrosion operation on the obtained binary image;
s5, calculating the length and the width of the crack area;
s6, judging whether the current workpiece belongs to a qualified product
The industrial image crack detection method of claim 1, wherein in the step S2, the neighborhood information entropy of each point is calculated as:
in the formula (I), the compound is shown in the specification,is the current pointThe neighborhood of (a) is determined,is a pointApproximate probability within the neighborhood:
The industrial image crack detection method as claimed in claim 2, wherein in S3, the obtained image has a large number of crack-containing regions, so that the mean and variance of the information entropy matrix are calculated and the information is used to binarize the information entropy matrix:
2. The industrial image crack detection method of claim 3, wherein in S4, the corrected target region is obtained by using an erosion operation in the psychology, and the psychology size is consistent with the neighborhood size in S2.
3. The industrial image crack detection method of claim 4, wherein in the step S5, the communication area of each region is first extracted, the area of each communication area is calculated, and the region with the area smaller than the threshold value is deleted.
4. The length of the crack is obtained by using a zone growing method.
5. The width of the crack was calculated using a morphological etching operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011088177.3A CN114418921A (en) | 2020-10-13 | 2020-10-13 | Industrial image crack detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011088177.3A CN114418921A (en) | 2020-10-13 | 2020-10-13 | Industrial image crack detection method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114418921A true CN114418921A (en) | 2022-04-29 |
Family
ID=81260566
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011088177.3A Pending CN114418921A (en) | 2020-10-13 | 2020-10-13 | Industrial image crack detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114418921A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103048329A (en) * | 2012-12-11 | 2013-04-17 | 北京恒达锦程图像技术有限公司 | Pavement crack detecting method based on active contour model |
CN104535589A (en) * | 2015-01-20 | 2015-04-22 | 广东电网有限责任公司电力科学研究院 | Online detection method and device for low-voltage current mutual inductor |
CN107132232A (en) * | 2017-04-24 | 2017-09-05 | 西南交通大学 | A kind of crack detecting method of high ferro OCS Messenger Wire support base |
CN107527354A (en) * | 2017-07-06 | 2017-12-29 | 长安大学 | A kind of region growing method based on composite diagram |
CN111256594A (en) * | 2020-01-18 | 2020-06-09 | 中国人民解放军国防科技大学 | Method for measuring physical characteristics of surface state of aircraft skin |
-
2020
- 2020-10-13 CN CN202011088177.3A patent/CN114418921A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103048329A (en) * | 2012-12-11 | 2013-04-17 | 北京恒达锦程图像技术有限公司 | Pavement crack detecting method based on active contour model |
CN104535589A (en) * | 2015-01-20 | 2015-04-22 | 广东电网有限责任公司电力科学研究院 | Online detection method and device for low-voltage current mutual inductor |
CN107132232A (en) * | 2017-04-24 | 2017-09-05 | 西南交通大学 | A kind of crack detecting method of high ferro OCS Messenger Wire support base |
CN107527354A (en) * | 2017-07-06 | 2017-12-29 | 长安大学 | A kind of region growing method based on composite diagram |
CN111256594A (en) * | 2020-01-18 | 2020-06-09 | 中国人民解放军国防科技大学 | Method for measuring physical characteristics of surface state of aircraft skin |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114937055B (en) | Image self-adaptive segmentation method and system based on artificial intelligence | |
CN111080582B (en) | Method for detecting defects of inner and outer surfaces of workpiece | |
CN110210477B (en) | Digital instrument reading identification method | |
CN109239073B (en) | Surface defect detection method for automobile body | |
CN115063430B (en) | Electric pipeline crack detection method based on image processing | |
CN116777907A (en) | Sheet metal part quality detection method | |
CN110070523B (en) | Foreign matter detection method for bottle bottom | |
CN111598801B (en) | Identification method for weak Mura defect | |
CN117152129B (en) | Visual detection method and system for surface defects of battery cover plate | |
CN104458766A (en) | Cloth surface blemish detection method based on structure texture method | |
CN115719332A (en) | Welding quality detection method | |
CN117333467B (en) | Image processing-based glass bottle body flaw identification and detection method and system | |
CN116109577A (en) | Printing label defect detection system and method | |
CN110060239B (en) | Defect detection method for bottle opening of bottle | |
CN116381053A (en) | Ultrasonic detection method and system for welding metal materials | |
CN107610119A (en) | The accurate detection method of steel strip surface defect decomposed based on histogram | |
CN112561875A (en) | Photovoltaic cell panel coarse grid detection method based on artificial intelligence | |
CN113129265B (en) | Method and device for detecting surface defects of ceramic tiles and storage medium | |
CN114332081A (en) | Textile surface abnormity determination method based on image processing | |
CN114418921A (en) | Industrial image crack detection method | |
CN112750119A (en) | Detection and measurement method for weak defects on surface of white glass cover plate | |
CN111062939A (en) | Method for quickly discriminating quality and automatically extracting defect characteristics of strip steel surface | |
CN112330606B (en) | Defect detection method based on machine learning | |
Yun et al. | Detection of line defects in steel billets using undecimated wavelet transform | |
CN113870299A (en) | 3D printing fault detection method based on edge detection and morphological image processing |
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 |