A crack detection method based on three-dimensional image reconstruction
Through the three-dimensional image reconstruction method, the problem of unsatisfactory identification effect and high cost of crack detection for casting embryo products in the prior art is solved, and fast and accurate crack positioning and high-precision size extraction are achieved, and the recognition rate and data reliability are significantly improved.
Patent Information
- Application Number
- CN202111580101.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2041-12-22
AI Technical Summary
In the prior art, in the crack detection of cast embryo press products in industrial production, the identification effect is not ideal and the cost is high, making it difficult to quickly and accurately locate the crack position and extract the surface size and well depth size of the crack.
The crack detection method based on three-dimensional reconstruction of images is adopted, and product information is obtained through 3D scanning, pre-processing and three-dimensional reconstruction is performed, and the adaptive iteration method is used to perform binarization processing, pixel edge gradient is calculated, ROI areas are selected, and crack information is judged and assisted by combining grayscale processing and morphological operations.
It realizes rapid and accurate positioning of cracks, extracts the surface size and well depth dimensions of cracks with high accuracy, with a recognition rate of up to 90%, and has high data reliability and accuracy.
Smart Images

Figure FDA0005281425140000011 
Figure FDA0005281425140000012 
Figure FDA0005281425140000013
Abstract
Description
Technical Field
[0001] The present invention relates to the field of nondestructive testing methods in industrial testing, and in particular to a crack detection method based on three-dimensional image reconstruction. Background Art
[0002] In industrial production, cracks may occur in products during the casting process; products with cracks need to be reworked or become production waste. If cracked products cannot be found and allowed to flow into the market, it will endanger the safety of users and even cause irreparable losses. For the above reasons, crack detection is of great significance. At present, the main means of detecting product cracks is to directly use image detection, but there is a problem that the recognition effect is not ideal. There are also a few who use X-ray scanning to detect product cracks, but there is a problem of high cost. Summary of the invention
[0003] The purpose of the present invention is to provide a method for crack detection based on image three-dimensional reconstruction, which can identify and classify reconstructed three-dimensional images, quickly and accurately locate the crack position, and extract the surface size and depth size of the crack with high precision. The recognition rate of the crack can be as high as 90%, the crack data has strong reliability, and the accuracy is high.
[0004] In order to solve the above technical problems, the present invention provides a crack detection method based on three-dimensional image reconstruction, which includes 3D scanning a set product to obtain product information, and pre-processing the product information to reconstruct it into an information image through three-dimensional reconstruction; graying the reconstructed information image, and selecting an ROI area as an input image based on the pixel edge gradient change calculation of the information image; using an adaptive iterative method to binarize the input image, judge the crack information and provide supporting evidence, and return the obtained crack information to a data service center.
[0005] Furthermore, the product information includes location information and height information.
[0006] Furthermore, when the product information is preprocessed, the product information is compressed, linearly regressed and linearly interpolated, and then three-dimensionally reconstructed to obtain a tif image and a bmp image.
[0007] Furthermore, the product information is compressed by Huffman coding to reduce the data volume, and the compressed data information is linearly compensated by Ridge regression and linear interpolation.
[0008] Furthermore, when selecting the ROI area, the pixel edge gradient Δ of the information image is calculated using the Sobel operator, and the absolute value of the gradient Δ of each pixel is sorted;
[0009] According to the absolute value of the gradient Δ of each pixel, select n points [p1, p2…p n ], where ε is the set threshold;
[0010] With p1 as the center and r as the side length, divide the rectangular box R1 corresponding to p1.
[0011] With p2 as the center and r as the side length, divide the rectangular box R2 corresponding to p2.
[0012] With p n is the center, r is the side length, and the division corresponds to p n The rectangular frame R n ,
[0013] The n points with the largest gradient are obtained by union operation
[0014] Furthermore, a point P on the input image is selected n (w, h), and the gray value of this point is represented by; the image matrix is converted into a single column vector according to the set order, and P n The nth element of the vector, P n The sum of all grayscale values of s points before point is: Introducing the variable t to get the binarization of this point:
[0015]
[0016] Among them, according to s, the image width Width / 8 and t are 15.
[0017] P n The sum of all gray values of the s points before the point needs to be assigned weights according to the influence of the gray values of other points on the gray value of the current point to obtain the corrected gray value and g s (n), and iterate:
[0018]
[0019] Bring the horizontal line above and take the average value, we have: Where width is the horizontal resolution of the image, and g' s Substitute (n) into T(n) to obtain a new discrimination method:
[0020]
[0021] Initial g s (n) = s*(2 α-1 -1), where α represents the depth of the image, 2 α-1-1 represents the middle value of the grayscale value of the image; the linear relationship between the image height information and the image grayscale value is substituted into T(n), and an adaptive binary image with height variation can be obtained. If there is no crack, the binary value of the position is 1, and if there is a crack, the binary value of the position is 0, which is taken as Image_1.
[0022] Furthermore, the reconstructed image is grayed out. This grayscale information contains both the image contour and the height information is also included in the grayscale value of the image in a linear relationship, that is, H = f -1 (G),
[0023]
[0024] H = f -1 (G) Combined with the image grayscale value, select the upper and lower limits to set the threshold.
[0025] Furthermore, when the image matrix is converted into a single column vector according to the set order, the pixel p x,y The two-dimensional matrix of m rows and n columns (x=(1...m), y=(1...n)) is transformed into p x*n+y A one-dimensional vector of .
[0026] Furthermore, when conducting auxiliary evidence analysis of cracks, morphological operations and connectivity analysis are performed on Image_1 to obtain a reliable connected domain; feature analysis is performed on the obtained connected domain to extract feature information, and the crack information is judged through threshold constraint features, and the crack information is returned to the data service center.
[0027] Furthermore, when performing feature analysis on the connected domain, the directional gradient histogram is used to extract the feature vector of the connected domain. The extracted feature vector With the threshold vector Perform correlation analysis, i.e. inner product Arranged 0≤cosθ≤1; select a set threshold point μ in the interval [0, 1]. If cosθ≥μ, there is a crack.
[0028] The beneficial effects of the present invention are as follows: the crack detection method based on three-dimensional image reconstruction recognizes and classifies the reconstructed three-dimensional image, can quickly and accurately locate the crack position, and extract the surface size and depth size of the crack with high precision. The recognition rate of the crack can be as high as 90%, and the crack data has strong reliability and high precision. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0030] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] The following is a detailed description with reference to the embodiments, and the technical common sense known to those skilled in the art is omitted.
[0032] The crack detection method based on three-dimensional image reconstruction obtains the position information and height information of the detection object through a three-dimensional scanning device, reconstructs the obtained information to obtain an image, and then processes the image to determine the crack and provide supporting evidence.
[0033] Specifically, the crack detection method based on image three-dimensional reconstruction includes 3D scanning of a set product to obtain product information, wherein the product information includes position information and height information, such as z=f(x,y), and the obtained data can also be integrated into a csv file.
[0034] The product information is preprocessed and reconstructed into an information image through three-dimensional reconstruction. When the product information is preprocessed, the product information is compressed, linearly regressed and linearly interpolated, and then a tif image and a bmp image are obtained by three-dimensional reconstruction. Among them, the product information is compressed by Huffman coding to reduce the amount of data, and the compressed data information is linearly compensated by Ridge regression and linear interpolation to reduce data distortion caused by data compression.
[0035] At this time, the tif image, grayscale image, and bmp image, color or grayscale, which are reconstructed by three-dimensional reconstruction, contain both the contour information of the product and the height information of the product. The reconstructed image is grayscaled. This grayscale information contains both the contour of the image and the height information is also included in the grayscale value of the image in a linear relationship, that is, H = f -1 (G),
[0036]
[0037] Using linear interpolation, Calculate a point (x, y) between (x0, y0) and (x1, y1) as a linear approximation, convert the height information to grayscale,
[0038] G=f(H)
[0039] Among them, G is the gray value Gray, and H is the height.
[0040] Next, the reconstructed information image is grayed out, and the ROI region is selected based on the pixel edge gradient change calculation of the information image as the input image.
[0041] When selecting the ROI area, the Sobel operator is used to calculate the pixel edge gradient Δ of the information image, and the absolute value of the gradient Δ of each pixel is sorted; n points [p1, p2…pn] with an absolute value of Δ>ε are selected in descending order of the absolute value of the gradient Δ of each pixel, where ε is the set threshold;
[0042] With p1 as the center and r as the side length, divide the rectangular box R1 corresponding to p1.
[0043] With p2 as the center and r as the side length, divide the rectangular box R2 corresponding to p2.
[0044] With pn as the center and r as the side length, divide the rectangular box Rn corresponding to pn.
[0045] The n points with the largest gradient are obtained by union operation
[0046] It eliminates the manual selection operation mode and provides a common selection standard to more accurately locate the location where cracks appear.
[0047] Next, the input image is binarized using an adaptive iterative method to determine the crack information and provide supporting evidence, and the crack information is returned to the data service center.
[0048] Specifically, the obtained ROI area image is used as the input image for processing, and the above G=f(H) can be combined.
[0049] , that is, H = f -1 (G) Image binarization using a fast adaptive iterative method.
[0050] First, select a point Pn(w,h) on the input image, where w is the width, h is the height, and the grayscale value of this point is represented by; convert the image matrix into a single column vector in the set order, and the nth element of the Pn vector, the sum of all grayscale values of the s points before the Pn point is:
[0051] It should be noted here that the expression of an image in a computer is a three-dimensional matrix (x, y, p), where x and y are the coordinates of the pixel in the image, and p is a tuple (R, G, B) or (H, S, V), etc.
[0052] And when the image matrix is converted into a single column vector according to the set order, the pixel p x,y The two-dimensional matrix of m rows and n columns (x=(1...m), y=(1...n)) is transformed into p x*n+y A one-dimensional vector of .
[0053] And introduce the variable t to get the binarization of this point:
[0054]
[0055] Among them, according to s, the image width Width / 8 and t are 15 as the best values.
[0056] Furthermore, F s (n), the sum of all gray values of the s points before point Pn. It is necessary to assign weights according to the influence of the gray values of other points on the gray value of the current point. That is, the closer to the current point, the greater the influence weight, and the farther away from the current point, the smallest influence weight is taken to obtain the corrected gray value and g s (n), and iterate:
[0057]
[0058]
[0059] And considering that only one superposition direction is considered at this time, generally horizontal, the one above the horizontal direction can be brought in and averaged, that is, Where width is the horizontal resolution of the image, and g' s Substitute (n) into T(n) to obtain a new discrimination method:
[0060]
[0061] Initial g s (n) = s*(2 α-1 -1), where α represents the depth of the image, 2 α-1 -1 means the grayscale value of the image is the middle value.
[0062] Then the linear relationship between the image height information and the image gray value is H = f -1 (G) Substitute T(n) into T(n), and we can get an adaptive binary image with height variation. If there is no crack, the binary value of that position is 1, and if there is a crack, the binary value of that position is 0, which is called Image_1.
[0063] At the same time, H = f -1 (G) Combined with the image grayscale value, select the upper and lower limits to set the threshold.
[0064] When conducting auxiliary analysis of cracks, morphological operations and connectivity analysis are performed on Image_1, where morphological operations such as corrosion, expansion, and opening and closing can be performed to remove image noise and regional burrs. Connectivity analysis is performed on Image_1 to obtain a reliable connected domain, that is, connected component extraction.
[0065] Of course, a crack-free position 1 can also be extracted as Image_2, and regional analysis of Image_1 and Image_2 after morphological processing includes but is not limited to opening and closing operations such as difference and superposition, boundary extraction and tracking such as contour detection, and difference analysis.
[0066] Subtract D by pixel p =p image_1 -p image_2 , p image_1 is the value of point P corresponding to Image_1, p image_2 is the value of point P corresponding to Image_2, D p Is the difference. Is the difference D p Make a histogram, D p The probability P(D p <τ) as the difference between Image_1 and Image_2. τ is the set threshold, the smaller τ is, the finer the difference between Image_1 and Image_2 is, the larger τ is, the more blurred the difference between Image_1 and Image_2 is.
[0067] The obtained connected domain is subjected to feature analysis to extract feature information, and the crack information is judged by setting threshold constraints on the features, and the crack information is returned to the data service center.
[0068] When performing feature analysis on the connected domain, the directional gradient histogram of the connected domain is used to extract the feature vector The extracted feature vector and set the threshold vector Perform correlation analysis, i.e. inner product Arranged 0≤cosθ≤1; select a set threshold point μ in the interval [0, 1]. If cosθ≥μ, there is a crack.
[0069] The data service center will record all the information returned as splits for subsequent deep learning detection. s (n) can be used as a key factor in the learning rate and error iteration process.
[0070] The crack detection method based on image three-dimensional reconstruction recognizes and classifies the reconstructed three-dimensional images, can quickly and accurately locate the crack position, and extract the surface size and depth size of the crack with high precision. The recognition rate of cracks can be as high as 90%, and the crack data has strong reliability and high precision.
[0071] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A crack detection method based on three-dimensional image reconstruction, characterized in that: The steps include: S1. 3D scan a set product to obtain product information, and pre-process the product information to reconstruct it into an information image through three-dimensional reconstruction; S2. grayscale the reconstructed information image, and select the ROI area according to the pixel edge gradient change of the information image as the input image; S3. Use the adaptive iterative method to perform binarization processing on the input image, determine the crack information and provide supporting evidence, and return the obtained crack information to the data service center; The specific steps of S3 are: S31. Select a point Pn(w, h) on the input image, and the gray value of this point is represented by; S32. Convert the image matrix into a single column vector according to the set order, and P n The nth element of the vector, P n The sum of all grayscale values of the s points before the point is: S33. Introduce variable t to get the binarization of this point: Among them, according to s, the image width is Width / 8, and t is 15; S34.P n The sum of all gray values of the s points before the point needs to be assigned weights according to the influence of the gray values of other points on the gray value of the current point to obtain the corrected gray value and g s (n), and iterate: S35. Substitute the horizontal line above and find the average value, we have Where width is the horizontal resolution of the image, and g' s Substitute (n) into T(n) to obtain a new discrimination method: Initial g s (n) = s*(2 α-1 -1), where α represents the depth of the image, 2 α-1 -1 indicates the middle value of the grayscale of the image; S36. Substitute the linear relationship between the image height information and the grayscale value of the image into T(n), and obtain an adaptive binary image with height change. If there is no crack, the binary value of the position is 1, and if there is a crack, the binary value of the position is 0, which is used as Image_1.
2. The crack detection method based on three-dimensional image reconstruction according to claim 1, characterized in that: The product information includes location information and height information.
3. The crack detection method based on three-dimensional image reconstruction according to claim 1, characterized in that: In the step S1, when the product information is preprocessed, the product information is compressed, linearly regressed and linearly interpolated, and then a tif image and a bmp image are obtained by three-dimensional reconstruction.
4. The crack detection method based on three-dimensional image reconstruction according to claim 3 is characterized in that: The product information is compressed by Huffman coding to reduce the amount of data, and the compressed data information is linearly compensated by Ridge regression and linear interpolation.
5. The crack detection method based on three-dimensional image reconstruction according to claim 1, characterized in that: In the step S2, when selecting the ROI area, the pixel edge gradient Δ of the information image is calculated using the Sobel operator, and the absolute value of the gradient Δ of each pixel is sorted; According to the absolute value of the gradient Δ of each pixel, select n points [p1, p2…p n ], where ε is the set threshold; With p1 as the center and r as the side length, divide the rectangular box R1 corresponding to p1. With p2 as the center and r as the side length, divide the rectangular box R2 corresponding to p2. With p n is the center, r is the side length, and the division corresponds to p n The rectangular frame R n , The n points with the largest gradient are obtained by union operation 6. The crack detection method based on three-dimensional image reconstruction according to claim 1, characterized in that: The reconstructed image is grayed out. This grayscale information contains both the image contour and the height information is also included in the grayscale value of the image in a linear relationship, that is, H = f -1 (G), H = f -1 (G) Combined with the image grayscale value, select the upper and lower limit thresholds.
7. The crack detection method based on three-dimensional image reconstruction according to claim 1, characterized in that: When the image matrix is converted into a single column vector in the set order, the pixel p x,y The two-dimensional matrix of m rows and n columns (x=(1...m), y=(1...n)) is transformed into p x*n+y A one-dimensional vector of .
8. The crack detection method based on three-dimensional image reconstruction according to claim 6, characterized in that: When conducting auxiliary analysis of cracks, morphological operations and connectivity analysis are performed on Image_1 to obtain a reliable connected domain; feature analysis is performed on the obtained connected domain to extract feature information, and the crack information is judged through threshold constraint features, and the crack information is returned to the data service center.
9. The crack detection method based on three-dimensional image reconstruction according to claim 8, characterized in that: When performing feature analysis on the connected domain, the directional gradient histogram of the connected domain is used to extract the feature vector The extracted feature vector With the threshold vector Perform correlation analysis, i.e. inner product Arranged 0≤cosθ≤1; select a set threshold point μ in the interval [0, 1]. If cosθ≥μ, there is a crack.
Citation Information
Patent Citations
Surface crack texture extraction method based on fusion of seepage algorithm and adaptive Canny algorithm
CN106446905A
Small-size chip crack detection method and system based on computer vision
CN111179243A