A surface defect detection and quantification method based on photometric stereo vision
Through the surface defect detection method based on photometric stereo vision, combined with the fusion and quantization of divergence, curvature, Gaussian curvature and average curvature images, the problem of low accuracy in defect detection in the prior art is solved, and more efficient and accurate Defect detection and quantification.
Patent Information
- Application Number
- CN202410046360.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-12
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-01-12
AI Technical Summary
The prior art detects and quantifies surface defects, especially tiny defects, have low accuracy and are difficult to effectively identify and quantify, affecting product quality.
Using a detection method based on photometric stereo vision, the normal vector of the object surface is calculated through image acquisition under multiple light sources in different directions, and the divergence, curvature, Gaussian curvature and average curvature images are obtained, image fusion and edge detection are performed, and candidate defects are quantified. depth.
It improves the accuracy and sensitivity of surface defect detection, can better identify and quantify the depth and characteristics of defects, and improves the reliability of product quality inspection.
Smart Images

Figure CN117876331B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a surface defect detection and quantification method based on photometric stereo vision. Background Art
[0002] Surface defect detection is an important part of industrial production. In the field of new energy, lithium battery covers, photovoltaic junction boxes and other products will have different appearance defects during the manufacturing process. Common defect types include scratches, pits, bubbles, abrasions, bumps, etc. The traditional 2D imaging method is to perform imaging under a single light source and a fixed optical path. For tiny defects, due to their special properties such as shape, depth, and direction, the imaging effect is often poor. If these defects cannot be detected, it will affect the quality of the product. The surface defect detection technology based on photometric stereo vision can detect three-dimensional surface defects with high efficiency and accuracy.
[0003] As Su Yuting pointed out in his paper "Battery Defect Detection Method Based on Photometric Stereo and Deep Learning", battery defect detection is easily disturbed by the black appearance, which leads to the problem that the effective identification of defects cannot be achieved through the limited vision of observing an image under a single light source. Therefore, the photometric stereo vision method is used to detect scratches, folds, bubbles and other defects. For example, Xi Changze used the photometric stereo algorithm in the paper "Machine Vision Detection Method and Application Research of Metal Workpiece Surface Defects" to obtain the surface gradient defect map of the part, and more obviously detected the concave and convex defects on the surface. For example, the patent document "A Method and Device for Detecting and Analyzing Object Surface Defects Based on Photometric Stereo" with the publication number CN113658155A performs defect analysis based on photometric stereo, avoiding the problem that traditional image processing technology is difficult to analyze and find defects on a variety of different object surfaces, and has the characteristics of high detection accuracy and strong universality. For example, the patent document "Defect Detection Method and Device Based on Photometric Stereo and Deep Learning Algorithm" with publication number CN115656189A combines photometric stereo with deep learning methods to solve the problems of low detection accuracy and inaccurate recognition of images directly taken by industrial cameras, thereby improving the accuracy of defect detection.
[0004] The photometric stereo algorithm can obtain reflection maps, curl maps, divergence maps, and curvature maps based on multiple images with different illumination angles. Different types of images can represent different surface defect characteristics. Divergence and curl represent the convergence or rotation strength of the normal vector field of the defect surface, and mean curvature and Gaussian curvature represent the curvature of the defect surface. However, the above literature only selects one type of image to obtain defect detection results using existing visual detection methods, and does not further quantify the degree of defect concavity, such as the depth of scratches and pits, resulting in inaccurate detection results. Therefore, how to improve the detection accuracy of surface defects of objects is a technical problem that needs to be solved urgently. To this end, we propose a surface defect detection and quantification method based on photometric stereo vision. Summary of the invention
[0005] The purpose of the present invention is to provide a surface defect detection and quantification method based on photometric stereo vision to solve the problems raised in the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solution: a surface defect detection and quantification method based on photometric stereo vision, comprising the following steps:
[0007] Step 1: The camera’s viewing angle remains unchanged, and the surface image of the object to be measured is illuminated by multiple light sources from different directions;
[0008] Step 2: Calculate the surface normal vector of the object according to the direction vector of different light sources and the image grayscale;
[0009] Step 3: Calculate the divergence, curl, Gaussian curvature and mean curvature of the object to be measured according to the normal vector;
[0010] Step 4: Normalize the divergence, curl, Gaussian curvature, and mean curvature to grayscale values between 0 and 255 to obtain the divergence graph I. c 、Curl Graph I d , Gaussian curvature graph I gc , mean curvature map I mc ;
[0011] Step 5: Diffuse the scatter plot I c 、Curl Graph I d , Gaussian curvature graph I gc , mean curvature map I mc Perform image fusion to obtain a fusion image I f ;
[0012] Step 6: Detect the edge of the fusion image. First, use median filtering to remove the noise in the fusion image, and then subtract it from the fusion image to obtain a difference image. Binarize the difference image to obtain the bright edge.
[0013] Step 7: Detect candidate defects;
[0014] Step 8: Quantify the depth P of the candidate defect.
[0015] Preferably, the specific steps of step 2 are:
[0016] Suppose the normal vector of a point P on the surface of the object is n, and n is a unit vector, that is, ||n||=1, the light source is a parallel light source or a point light source, and the direction vector s i is a normalized unit vector, N is the number of light sources, and the grayscale of point P in different images is I = [I1 I2 … I N ] T , satisfying the following equation:
[0017]
[0018] Among them, k d is the reflectivity;
[0019] When N=3, the s matrix is invertible, and then we have: k d n=s -1 I, and thus reflectivity k d =||s -1 I||,
[0020] When N>3, s is not a square matrix, and the least squares method is needed to calculate the normal vector and reflectivity, and the equation becomes k d n=(s T s) -1 s T I, and thus reflectivity k d =||(s T s) -1 s T I||,
[0021] Preferably, the specific steps of step three are:
[0022] The normal vector of any point P on the surface of an object can be expressed as n = (p, q, -1) T , then the gradients in the x and y directions are p and q respectively, and the derivative of p in the x direction is recorded as p is derived in the y direction, denoted as The derivative of q in the x direction is recorded as The derivative of q in the y direction is recorded as
[0023] Preferably, the calculation formulas for the divergence, curl, Gaussian curvature and mean curvature are respectively:
[0024] Divergence:
[0025] Curl:
[0026] Gaussian curvature:
[0027] Mean curvature:
[0028] Preferably, the specific steps of step five are:
[0029] I c ,I d ,I gc ,I mc Construct levels of Gaussian pyramid;
[0030] I c ,I d ,I gc ,I mc Construct levels-1 Laplacian pyramid;
[0031] Will I c ,I d ,I gc ,I mc The same layers of the Laplacian pyramid are superimposed and fused in equal proportion to form a new Laplacian pyramid;
[0032] Will I c ,I d ,I gc ,I mc The last layer of the Gaussian pyramid, i.e., the levels-1 layer, is superimposed and fused in equal proportion. The fused image is used as the starting image and the new Laplacian pyramid is used to reconstruct the image layer by layer to obtain the final fused image I f .
[0033] Preferably, the specific steps of step six are:
[0034] The convolution kernel size of the median filter is ksize, which is generally an odd number greater than 1. The grayscale values of all pixels in the ksize×ksize neighborhood of the center pixel are sorted, and the value in the middle is taken as the grayscale value of the center pixel. The filtered image is recorded as I m ;
[0035] I f with I m Subtract and get the difference map: I diff =|I f -I m |;
[0036] Thresh is the grayscale threshold. If I diff If the pixel value in is greater than thresh, it is changed to maxval; otherwise, it is changed to 0 to obtain a binary image.
[0037] Preferably, the specific steps of step seven are:
[0038] Perform contour extraction on the binary image to obtain the contour area of the defect; set the area threshold t area and length threshold t length , remove the contour areas with smaller area and length; then use morphological operations to expand the remaining contour areas, so as to merge the contour areas with closer distances; finally, perform connected domain analysis to obtain candidate defects.
[0039] Preferably, the defects in step eight may be point defects, including pits and bubbles;
[0040] For point defects, first calculate its minimum bounding box based on the candidate defect contour area, use the Sobel operator to obtain the gradient value of the minimum bounding box area, and then calculate the gradient mean m of the candidate defect contour area g , as a quantitative standard of depth.
[0041] Preferably, the defect in step eight may also be a linear defect;
[0042] For linear defects, first calculate its minimum bounding box based on the contour area of the candidate defect. The minimum bounding box area minus the candidate defect area is the non-candidate defect area. Calculate the grayscale mean μ of the non-candidate defect area. no Then the candidate defect area and non-candidate defect area are both μ no Calculate the respective grayscale variance, denoted as σ 2 , Will As a quantitative standard of depth.
[0043] Preferably, in step one, the light source includes an irradiation angle and a distribution angle, the number of the light sources may be four, the irradiation angles are all 45°, and the distribution angles are 0°, 90°, 180° and 270° respectively.
[0044] Technical effects and advantages of the present invention:
[0045] (1) The present invention uses divergence and curl to represent the convergence or rotation intensity of the normal vector field of the defect surface, and the mean curvature and Gaussian curvature to represent the curvature of the defect surface. The present invention performs image fusion on the divergence map, curl map, Gaussian curvature map, and mean curvature map of photometric stereo vision, so that a single image has more feature information and can better highlight the features of the defect;
[0046] (2) The present invention uses median filtering, image subtraction, and binarization to extract defect edges, which is more accurate and faster than the common canny edge detection method;
[0047] (3) The present invention quantifies the depth of point-shaped and line-shaped defects, making defect detection more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a schematic diagram of a flow chart of the surface defect detection and quantification method based on photometric stereo vision of the present invention.
[0049] Figure 2 Schematic diagram of light sources at different angles according to the present invention.
[0050] Figure 3 Schematic diagram of images captured by light sources at different angles according to the present invention.
[0051] Figure 4 It is a schematic diagram of the normalized characteristics of the present invention.
[0052] Figure 5 It is a schematic diagram of the feature fusion process of the present invention.
[0053] Figure 6 This is a schematic diagram of superposition and fusion of the present invention.
[0054] Figure 7 This is a schematic diagram of feature fusion of the present invention.
[0055] Figure 8 This is a schematic diagram of the quantification of point defects in the present invention.
[0056] Fig. 9 It is a schematic diagram of the linear defect quantization structure of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. 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.
[0058] The present invention provides Figure 1-9 A surface defect detection and quantification method based on photometric stereo vision is shown, comprising the following steps:
[0059] Step 1: The camera’s viewing angle remains unchanged, and the surface image of the object to be measured is illuminated by multiple light sources from different directions;
[0060] Step 2: Calculate the surface normal vector of the object according to the direction vector of different light sources and the image grayscale;
[0061] Step 3: Calculate the divergence, curl, Gaussian curvature and mean curvature of the object to be measured according to the normal vector;
[0062] Step 4: Normalize the divergence, curl, Gaussian curvature, and mean curvature to grayscale values between 0 and 255 to obtain the divergence graph I. c 、Curl Graph I d , Gaussian curvature graph I gc , mean curvature map I mc ;
[0063] Step 5: Diffuse the scatter plot I c 、Curl Graph I d , Gaussian curvature graph I gc , mean curvature map I mc Perform image fusion to obtain a fusion image I f ;
[0064] Step 6: Detect the edge of the fusion image. First, use median filtering to remove the noise in the fusion image, and then subtract it from the fusion image to obtain a difference image. Binarize the difference image to obtain the bright edge.
[0065] Step 7: Detect candidate defects;
[0066] Step 8: Quantify the depth P of the candidate defect.
[0067] The specific steps of step 2 are:
[0068] Suppose the normal vector of a point P on the surface of the object is n, and n is a unit vector, that is, ||n||=1, the light source is a parallel light source or a point light source, and the direction vector s i is a normalized unit vector, N is the number of light sources, and the grayscale of point P in different images is I = [I1 I2 … I N ] T , satisfying the following equation:
[0069]
[0070] Among them, k d is the reflectivity;
[0071] When N=3, the s matrix is invertible, and then we have: k d n=s -1 I, and thus reflectivity k d =||s -1 I||,
[0072] When N>3, s is not a square matrix, and the least squares method is needed to calculate the normal vector and reflectivity, and the equation becomes k d n=(s T s) -1 s T I, and thus reflectivity k d =||(s T s) -1 s T I||,
[0073] Example 1 of normal vector and reflectivity calculation method
[0074] Suppose the normal vector of a point P on the surface of the object is n, and n is a unit vector, that is, ||n||=1, the light source is a parallel light source or a point light source, and the direction vector s i is a normalized unit vector, and the grayscale of point P in different images is I=[I1 I2 I3 I4] T , satisfying the following equation:
[0075]
[0076] Among them, k d is the reflectivity.
[0077] Example 2 of Normal Vector and Reflectivity Calculation Method
[0078] The least squares method is used to calculate the normal vector and reflectivity, and the equation becomes k d n=(s T s) -1 s T I, and thus reflectivity k d =||(s T s) -1 s T I||,
[0079] In the step of calculating the divergence, curl, Gaussian curvature and mean curvature of the object to be measured, the normal vector of any point P on the surface of the object can be expressed as n = (p, q, -1) T , then the gradients in the x and y directions are p and q respectively, and the derivative of p in the x direction is recorded as p is derived in the y direction, denoted as The derivative of q in the x direction is recorded as The derivative of q in the y direction is recorded as
[0080] The calculation formula of divergence is expressed as The calculation formula of curl is expressed as The calculation formula of Gaussian curvature is expressed as The calculation formula of the mean curvature is expressed as
[0081] Embodiment 1
[0082] like Figure 1 This is a flow chart of a surface defect detection and quantification method based on photometric stereo vision proposed by the present invention, which is implemented in Python programming language. The main process of the method contained in the present invention includes shooting multi-light source images, calculating normal vectors, calculating divergence, curl, Gaussian curvature, mean curvature, normalization, image fusion, edge detection, defect detection, and quantifying defects.
[0083] Embodiment 2
[0084] The positions of the camera and the object being photographed are fixed, and the light source takes pictures at different angles, such as Figure 2 As shown, each light source has two angles, an illumination angle and a distribution angle. In the embodiment of the present invention, there are four light sources, and their illumination angles are 45°, 45°, 45°, 45°, and their distribution angles are 0°, 90°, 180°, and 270°, respectively. Each time a light source is turned on, an image is taken once. Four light sources are used to take four images in total, and four images are obtained. Figure 3 The image shown
[0085] Embodiment 3
[0086] The normal vector of any point P on the surface of an object can be expressed as n = (p, q, -1) T , then the gradients in the x and y directions are p and q respectively, and the derivative of p in the x direction is recorded as p is derived in the y direction, denoted as The derivative of q in the x direction is recorded as The derivative of q in the y direction is recorded as
[0087] Preferably, the calculation formulas for the divergence, curl, Gaussian curvature and mean curvature are respectively:
[0088] Divergence:
[0089] Curl:
[0090] Gaussian curvature:
[0091] Mean curvature:
[0092] Taking the mean curvature as an example, let the maximum value of the mean curvature be max and the minimum value be min, and let the curvature value c be i Normalized to the range [a, b], the calculation formula is:
[0093]
[0094] According to the above normalization formula, the divergence, curl, Gaussian curvature, and mean curvature are normalized to [0, 255] respectively to generate Figure 4 The divergence graph, curl graph, Gaussian curvature graph, and mean curvature graph are shown. It can be seen from the graph that the characteristics presented by the four graphs are different.
[0095] Embodiment 4
[0096] I c ,I d ,I gc ,I mc Construct levels of Gaussian pyramid;
[0097] I c ,I d ,I gc ,I mc Construct levels-1 Laplacian pyramid;
[0098] Will I c ,I d ,I gc ,I mc The same layers of the Laplacian pyramid are superimposed and fused in equal proportion to form a new Laplacian pyramid;
[0099] Will I c ,I d ,I gc ,I mc The last layer of the Gaussian pyramid, i.e., the levels-1 layer, is superimposed and fused in equal proportion. The fused image is used as the starting image and the new Laplacian pyramid is used to reconstruct the image layer by layer to obtain the final fused image I f .
[0100] In this embodiment, levels=4, according to Figure 5 Schematic diagram of construction I c ,I d ,I gc ,I mc 4-layer Gaussian pyramid and 3-layer Laplacian pyramid;
[0101] Will I c ,I d ,I gc ,I mc The same layers of the Laplace pyramid are superimposed and fused in equal proportion to form a new Laplace pyramid L f0 , L f1 , L f2 .
[0102] Will I c ,I d ,I gc ,I mc The last layer of the Gaussian pyramid, i.e., layer G3, is superimposed and fused in equal proportion, and the fused image is used as the starting image G f3 , and the new Laplace pyramid L f0 , L f1 , L f2 Reconstruct the image layer by layer, such as Figure 6 shown.
[0103] Embodiment 5
[0104] Will Figure 4 The 4 images in the image are merged into Figure 7 , Figure 4 and Figure 7 By comparison, Figure 7 The defect features in different types of images are fused. For example, in the locally enlarged areas A and B shown in the figure, the defect in area A is not shown in the divergence map, but the defect in area B is shown. However, the defect in area A is shown in the curl map, but the defect in area B is not shown. After image fusion, the defects in areas A and B are both shown.
[0105] Embodiment 6
[0106] The convolution kernel size of the median filter is ksize, which is generally an odd number greater than 1. The grayscale values of all pixels in the ksize×ksize neighborhood of the center pixel are sorted, and the value in the middle is taken as the grayscale value of the center pixel. The filtered image is recorded as I m ;
[0107] I f with I m Subtract and get the difference map: I diff =|I f -I m |;
[0108] Thresh is the grayscale threshold. If I diff If the pixel value in is greater than thresh, it is changed to maxval; otherwise, it is changed to 0 to obtain a binary image.
[0109] In this embodiment, the convolution kernel size of the median filter is set to ksize=35. Figure 4 Fusion Figure I m Filter to get I f , and then merge the graph I m with I f Subtract and get the difference map I diff; Grayscale threshold thresh = 10, maxval = 255, if I diff If the pixel value in is greater than thresh, it is changed to maxval; otherwise, it is changed to 0 to obtain a binary image.
[0110] Perform contour extraction on the binary image to obtain the contour area of the defect; set the area threshold t area and length threshold t length , remove the contour areas with smaller area and length; then use morphological operation to expand the remaining contour areas, so as to merge the contour areas with closer distance; finally, perform connected domain analysis to obtain candidate defects;
[0111] The defects in step eight may be point defects, including pits and bubbles;
[0112] For point defects, first calculate its minimum bounding box based on the candidate defect contour area, use the Sobel operator to obtain the gradient value of the minimum bounding box area, and then calculate the gradient mean m of the candidate defect contour area g , as a quantitative standard of depth.
[0113] Preferably, the defect in step eight may also be a linear defect;
[0114] For linear defects, first calculate its minimum bounding box based on the contour area of the candidate defect. The minimum bounding box area minus the candidate defect area is the non-candidate defect area. Calculate the grayscale mean μ of the non-candidate defect area. no Then the candidate defect area and non-candidate defect area are both μ no Calculate the respective grayscale variance, denoted as σ 2 , Will As a quantitative standard of depth;
[0115] In this embodiment, the area threshold t is set area =50 and length threshold t length =50, quantify the depth of point defects in candidate defects, m g =23, such as Figure 8 As shown, the depth of the linear defect in the candidate defect is quantified, r = 5, as Fig. 9 As shown, Figure 8 and Fig. 9 Medium dark boxes represent defects with less depth and no feel, while light boxes represent defects with greater depth and feel.
[0116] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A surface defect detection and quantification method based on photometric stereo vision, characterized in that: The following steps are involved: Step 1: The camera’s viewing angle remains unchanged, and the surface image of the object to be measured is illuminated by multiple light sources from different directions; Step 2: Calculate the surface normal vector of the object according to the direction vector of different light sources and the image grayscale; Step 3: Calculate the divergence, curl, Gaussian curvature and mean curvature of the object to be measured according to the normal vector; Step 4: Normalize the divergence, curl, Gaussian curvature, and mean curvature to grayscale values between 0 and 255 to obtain the divergence graph I. c 、Curl Graph I d , Gaussian curvature graph I gc , mean curvature map I mc ; Step 5: Diffuse the scatter plot I c 、Curl Graph I d , Gaussian curvature graph I gc , mean curvature map I mc Perform image fusion to obtain a fusion image I f ; Step 6: Detect the edge of the fusion image. First, use median filtering to remove the noise in the fusion image, and then subtract it from the fusion image to obtain a difference image. Binarize the difference image to obtain the bright edge. Step 7: Detect candidate defects; Step 8: Quantify the depth P of the candidate defect.
2. The surface defect detection and quantification method based on photometric stereo vision according to claim 1, characterized in that: The specific steps of step 2 are: Suppose the normal vector of a point P on the surface of the object is n, and n is a unit vector, that is, ||n||=1, the light source is a parallel light source or a point light source, and the direction vector s i is a normalized unit vector, N is the number of light sources, and the grayscale of point P in different images is I = [I1 I2 … I N ] T , satisfying the following equation: Among them, k d is the reflectivity; When N=3, the s matrix is invertible, and then we have: k d n=s -1 I, and thus reflectivity k d =||s -1 I||, When N>3, s is not a square matrix, and the least squares method is needed to calculate the normal vector and reflectivity, and the equation becomes k d n=(s T s) -1 s T I, and thus reflectivity k d =||(s T s) -1 s T I||, 3. The surface defect detection and quantification method based on photometric stereo vision according to claim 1, characterized in that: The specific steps of step three are: The normal vector of any point P on the surface of an object can be expressed as n = (p, q, -1) T , then the gradients in the x and y directions are p and q respectively, and the derivative of p in the x direction is recorded as p is derived in the y direction, denoted as The derivative of q in the x direction is recorded as The derivative of q in the y direction is recorded as 4. The surface defect detection and quantification method based on photometric stereo vision according to claim 3, characterized in that: The calculation formulas for the divergence, curl, Gaussian curvature and mean curvature are respectively: Divergence: Curl: Gaussian curvature: Mean curvature:
5. The surface defect detection and quantification method based on photometric stereo vision according to claim 1, characterized in that: The specific steps of step five are: I c ,I d ,I gc ,I mc Construct levels of Gaussian pyramid; I c ,I d ,I gc ,I mc Construct levels-1 Laplacian pyramid; Will I c ,I d ,I gc ,I mc The same layers of the Laplacian pyramid are superimposed and fused in equal proportion to form a new Laplacian pyramid; Will I c ,I d ,I gc ,I mc The last layer of the Gaussian pyramid, i.e., the levels-1 layer, is superimposed and fused in equal proportion. The fused image is used as the starting image and the new Laplacian pyramid is used to reconstruct the image layer by layer to obtain the final fused image I f .
6. The surface defect detection and quantification method based on photometric stereo vision according to claim 1, characterized in that: The specific steps of step six are: The convolution kernel size of the median filter is ksize, which is generally an odd number greater than 1. The grayscale values of all pixels in the ksize×ksize neighborhood of the center pixel are sorted, and the value in the middle is taken as the grayscale value of the center pixel. The filtered image is recorded as I m ; I f with I m Subtract and get the difference map: I diff =|I f -I m |; Thresh is the grayscale threshold. If I diff If the pixel value in is greater than thresh, it is changed to maxval; otherwise, it is changed to 0 to obtain a binary image.
7. The surface defect detection and quantification method based on photometric stereo vision according to claim 1, characterized in that: The specific steps of step seven are: Perform contour extraction on the binary image to obtain the contour area of the defect; set the area threshold t area and length threshold t length , remove the contour areas with smaller area and length; then use morphological operations to expand the remaining contour areas, so as to merge the contour areas with closer distances; finally, perform connected domain analysis to obtain candidate defects.
8. The surface defect detection and quantification method based on photometric stereo vision according to claim 1, characterized in that: The defects in step eight may be point defects, including pits and bubbles; For point defects, first calculate its minimum bounding box based on the candidate defect contour area, use the Sobel operator to obtain the gradient value of the minimum bounding box area, and then calculate the gradient mean m of the candidate defect contour area g , as a quantitative standard of depth.
9. The surface defect detection and quantification method based on photometric stereo vision according to claim 1, characterized in that: The defect in step eight may also be a linear defect; For linear defects, first calculate its minimum bounding box based on the contour area of the candidate defect. The minimum bounding box area minus the candidate defect area is the non-candidate defect area. Calculate the grayscale mean μ of the non-candidate defect area. no Then the candidate defect area and non-candidate defect area are both μ no Calculate the respective grayscale variance, denoted as σ 2 , Will As a quantitative standard of depth.
10. The surface defect detection and quantification method based on photometric stereo vision according to claim 1, characterized in that: In the step 1, the light source includes an irradiation angle and a distribution angle. The number of the light sources may be four, the irradiation angles are all 45°, and the distribution angles are 0°, 90°, 180° and 270° respectively.
Citation Information
Patent Citations
Object surface flaw detection and analysis method and device based on photometric stereo
CN113658155A
Defect detection method and device based on photometric stereo and deep learning algorithm
CN115656189A
Leather defect detection method, system and device based on photometric stereo
CN107607546A
Defect detection method and system based on photometric stereo
CN114998308A