Graphite sheet assembly appearance defect detection method based on photometric stereo algorithm
Through the combination of photometric stereo algorithm and deep learning network, using four strip light sources and image processing technology, we successfully solved the problem of identifying micro-concave and convex defects in graphite sheet components, significantly improved the detection accuracy, and reduced the missed and over-inspection rates.
Patent Information
- Application Number
- CN202410997492.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-29
AI Technical Summary
Existing technology cannot effectively detect minute uneven defects in graphite sheet components. In particular, it is difficult to identify concave and convex points, which affects the assembly quality.
An inspection method based on photometric stereo algorithm is adopted, through a combination of line scan camera and area array camera, using deep learning network and four strip light sources to calculate the normal vector of each pixel, distinguish concave and convex point defects, and combine with image processing technology Carry out concave and convex attribute discrimination.
Significantly reduced the number of missed inspections and over-inspections, and improved the accuracy of detection. The gray scale of concave attribute appearance defects is darker, and the gray scale of convex attribute appearance defects is lighter. Compared with traditional methods, the number of missed inspections is reduced by 98%, and the number of over-inspections is reduced. 72%.
Smart Images

Figure CN118858293A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an automatic detection area, and in particular to a method for detecting appearance defects of a graphite sheet assembly based on a photometric stereo algorithm. Background Art
[0002] As a heat dissipation component of electronic products (IPAD, etc.), graphite sheets require high surface accuracy, but the molding process may be accompanied by defects such as deformation, scratches, indentations, wrinkles, concave spots, convex spots, bubbles, and dirt. Due to the requirements of the assembly process, the tolerance of concave spots and convex spots on the graphite sheet is different for concave and convex defects. The tolerance of concave spots is higher than that of convex spots. Concave spots will hinder the assembly of workpieces with other workpieces, which requires that the imaging of concave spots and convex spots should be different. However, the traditional photometric stereo imaging technology is generally used in the market. The light source is a single point light source. At the same time, the surface of the product to be inspected meets the Lambertian reflection characteristics. The traditional stereo imaging technology cannot detect various tiny defects of graphite sheet components, especially it is difficult to distinguish concave and convex properties. Therefore, in order to meet the needs of distinguishing various defects of graphite sheet components, especially the identification of concave and convex defects, it is a technical problem that needs to be solved urgently to propose an improved photometric stereo imaging technology for visual inspection of defects in graphite sheet components. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a method for detecting appearance defects of graphite sheet components based on a photometric stereo algorithm, which is used to detect various defects of graphite sheet components, especially to distinguish the types of concave and convex point defects.
[0004] The technical solution of the present invention is: a method for detecting appearance defects of a graphite sheet assembly based on a photometric stereo algorithm, wherein the graphite sheet assembly includes a graphite sheet area and a nickel sheet area, and comprises the following steps:
[0005] a) Use line scan camera A to take an oblique shot of the workpiece surface of the graphite sheet assembly at station S1, and use line scan camera B to take a vertical shot of the workpiece surface of the graphite sheet assembly at station S2. Obtain the deformation, scratches, indentations, wrinkles, concave points, convex points and other defects of the graphite sheet area from the line scan image taken by line scan camera A, and obtain the bubbles, scratches, indentations, wrinkles, concave points, convex points, dirt and other defects on the nickel sheet area from the line scan image taken by line scan camera B. Use the deep learning network to determine whether the graphite sheet assembly is an OK product or a NG product, and record the concave point and convex point defects of the NG product as defects to be determined;
[0006] b) Use color line scan camera C to shoot vertically at station S3, and obtain two pictures with different exposures through time-sharing stroboscopic exposure to detect defects such as hair in the nickel sheet area, glue overflow in the nickel sheet area, and damage in the graphite sheet area;
[0007] c) At the S4 station, a telecentric lens is used to approximate the area array camera D of the orthographic projection model, and a four-dimensional strip light source is used as the light source. The four-dimensional strip light sources are distributed at the same height and 90 degrees apart. The four-dimensional strip light sources are turned on in sequence, and four images are taken respectively using the four-dimensional strip light sources. The normal vector of each pixel point in each image is calculated, and the normal vector of each pixel point is combined to obtain the normal vector of the entire image, and the concave point and convex point defect types in step a) are detected using the photometric stereo imaging method;
[0008] d) The unloading module transports OK products and NG products to different flow lines according to the output results.
[0009] Further, step a) includes the following steps:
[0010] a1) Use the preprocessing algorithm to perform Gaussian filtering and denoising on the line scan images obtained by the line scan cameras A and B respectively, use the edge extraction algorithm to obtain the accurate outer edge of the nickel sheet, use the intersection of the two outer edges of the product as the origin, and establish the workpiece coordinate system of the product with the width direction as the X-axis. Set the detection ROI area in the workpiece coordinate system, distinguish the nickel sheet area and the graphite sheet area, and send the nickel sheet area and the graphite sheet area to the deep learning network;
[0011] a2) Deep learning includes two-level learning networks. The first-level learning network (semantic segmentation model Deeplabv3+) traverses all defects of several small images sent from the graphite sheet area and the nickel sheet area, and divides them into graphite sheet area defects and nickel sheet area defects according to different detection objects;
[0012] If the first-level learning network outputs OK, the corresponding graphite sheet component is considered a qualified product. If the first-level learning network outputs NG, a preliminary screening is performed based on the length, width, area and other parameters of the defects output by the first-level learning network. For defects that do not meet the conditions, the corresponding graphite sheet components are still considered qualified products.
[0013] For defective images that meet the conditions, they are sent to the secondary learning network for re-inspection (classification model ResNet50). If the secondary learning network outputs OK, the corresponding graphite sheet component is considered a qualified product; the NG images output by the secondary learning network are analyzed, and quality screening is performed based on the defect location and number. If the defects exceed the pre-set conditions, the corresponding graphite sheet component is determined to be a final NG product;
[0014] a3) Analyze the results in step a2) and merge the areas labeled as concave defects and convex defects into the same type of areas as defects to be determined. At the same time, determine the coordinate values, area, and size information of the concave defects and convex defects in the workpiece coordinate system.
[0015] Further, step b) includes the following steps:
[0016] b1) Use preprocessing algorithm to perform high dynamic image fusion on color line scan images;
[0017] b2) Use edge extraction algorithm to obtain accurate edges of the outer edges of the nickel sheet. Use the intersection of the two edges as the origin and the width direction as the X-axis to establish a workpiece coordinate system for the nickel sheet area of the product. Set the detection ROI area in the workpiece coordinate system to distinguish the nickel sheet area from the graphite sheet area covering it. Finally, send it to the deep learning network.
[0018] b3) The deep learning network adopts a two-level learning network structure. The first-level learning network uses a segmentation network to detect defects such as hair in the nickel sheet area, glue overflow in the nickel sheet area, and damage in the graphite sheet area. For the NG products output by the first-level learning network, preliminary filtering is performed based on the length, width and area of the defects to eliminate some obvious false detection defects. The second-level learning network uses a classification network. For the defects to be judged that meet the set defect conditions, further screening is performed based on the defect location and number, and the defects that do not meet the conditions are judged as the final NG products.
[0019] Furthermore, in step c), the normal vector of each pixel in each image is calculated, and the normal vector of each pixel is combined to obtain the normal vector of the entire image, including:
[0020] c1), calculating the light source directions of the four strip light sources, and reading the direction vectors of the four strip light sources obtained in the light source direction calculation link;
[0021] c2) Read the image collected corresponding to each light source and record the length and width of the image;
[0022] c3), normalize the light source intensity of each image;
[0023] c4) Get the normalized matrix of the image;
[0024] c5) traverse the row and column coordinates of the image and calculate the corresponding normal vector for each pixel coordinate;
[0025] c6) Normalize the normal vector of each pixel to obtain the unit normal vector of each pixel in the four images;
[0026] c7) Combine the unit normal vectors of all image coordinate points to obtain the normal vector of the entire image;
[0027] Furthermore, in step c1), the vectors of the directions of the four strip light sources are read, and the vector composed of the four light source directions obtained in the light source direction calculation link is read, including:
[0028] c1-1), analyzing the image of the plastic ball with higher reflectivity by image processing technology, and determining the direction L of each light source in the photometric stereoscopic imaging;
[0029] c1-2) Turn on the four strip light sources in sequence, obtain the light source direction of each strip light source according to the above method, and put the light source direction of each strip light source in the vector representing the light source direction for subsequent operations.
[0030] Furthermore, in step c1-1), the image of the plastic ball with a higher reflectivity is analyzed by image processing technology to determine the direction of each strip light source in the photometric stereoscopic imaging, including the steps of:
[0031] c1-1-1), in the imaging environment setting stage, the environmental interference is removed as much as possible. After acquiring the image, the Gaussian filter is used to remove the noise, the grayscale mean of the whole image is calculated, and an appropriate offset is added as the threshold. In the present invention, the offset is set to +30. After the highlight area is obtained, the morphological opening operation is used to remove the interference of the highlight area, and the target area is obtained by screening according to the maximum area. Finally, its circumscribed circle is calculated, and the center of the circumscribed circle of the target area is set as the coordinates of the highlight point (P x , P y ), and calculate the center of the circumscribed circle of the plastic ball as the coordinates of the sphere center (C x , C y ), the method is the same as that of obtaining the center coordinates of the circumscribed circle of the target area;
[0032] c1-1-2) Calculate the normal vector N of the sphere surface, N = N (N x , N y , N z )=(P x -C x , P y -C y , ), where r is the radius of the sphere;
[0033] c1-1-3) Set the unit vector R of the light source reflection direction to (0, 0, 1), then the expression of the light source direction L is:
[0034] Where |N| is the scalar value of the normal vector N on the sphere surface.
[0035] Furthermore, in step c6), the normal vector of each pixel is normalized to obtain the unit normal vector of each pixel in the four images, including: calculating the reflectivity P of the surface point of the object ij ,
[0036] P ij =ρ i (N i *L j )j , where P ij Represents the grayscale value of the pixel at the i-th point on the image irradiated by light source j, which can be obtained on the image; N i is the surface unit normal vector of the i-th point; i represents the reflectivity of the i-th point; L j represents the unit vector in the direction of the j-th light source, obtained in step c1); l j Indicates the intensity of the jth light source. If the relative positions of the camera and the light source remain unchanged, this value can be set to 1.
[0037] Furthermore, when the number of light sources is 4, the four strip-shaped light sources are distributed at the same height and at 90-degree intervals, and the light source direction matrix L = [L 1 ,L 2 ,L 3 ,L 4 ] T , the vector composed of the pixel grayscale values of the i-th point on the corresponding four images is P i =[P i1 ,P i2 ,P i3 ,P i4 ] T ,but
[0038] ρ i =|(L T *L) -1 *L T *P i |
[0039]
[0040] Furthermore, in step c), the concave and convex defects in step a) are detected by using photometric stereo imaging, and the method further includes:
[0041] c8) According to the position of the defect to be determined output by the S1 station, the defect coordinates are mapped to the image of the area array camera through the matrix transformation between the line scan cameras A, B and the area array camera D.
[0042]
[0043] Where (c, r) is the coordinate of the defect in the line scan camera image, (c', r') is the coordinate of the defect in the area array camera, c_sh ift and r_sh ift are the offsets in the column and row directions respectively, θ is the rotation angle, and s is the ratio of the single pixel accuracy of the line scan camera image to the area array camera image;
[0044] Set a local ROI area according to the defect location, analyze the gradient field within the area, and use Gaussian filtering to detect the gradient change difference;
[0045] c9. Based on the defect analysis in step c8, a fixed threshold segmentation is used. The threshold is set to the average grayscale value of the local area. The abnormal areas that are too bright or too dark are extracted. The grayscale value presented by concave defects is significantly lower than the average grayscale value of the area, while the grayscale value presented by convex defects is significantly higher than the average grayscale value of the area. For adjacent defective areas, since one defect is cut into multiple areas distributed on different pictures after cutting, the principle of merging the detection ROI first and then performing subsequent detection is adopted for processing, so as to determine the defect type of concave or convex points.
[0046] The beneficial technical effects of the present invention are:
[0047] The method for detecting appearance defects of iPad graphite sheet assembly products of the present invention has been used in batches. After mass production testing, the grayscale features of defects on the picture can be directly obtained by the photometric stereo method. After image processing, the concave and convex properties of the appearance defects in the height direction can be distinguished. The grayscale of the concave appearance defects is darker, and the grayscale of the convex appearance defects is brighter. The number of missed detections is reduced by 98% compared with the traditional detection method, and the number of passed detections is reduced by 72%. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a schematic diagram of the workstation layout;
[0049] Figure 2 This is a diagram showing the calculation of the light source direction. Figure 1 ;
[0050] Figure 3 This is a solution for the light source direction. Figure 2 ;
[0051] Figure 4 It is a schematic diagram of solving the normal vector;
[0052] Figure 5 It is the normal vector calculation flow chart;
[0053] Figure 6 These are the images taken under four strip light sources respectively;
[0054] Figure 7 It is a synthetic image using the photometric stereo algorithm. DETAILED DESCRIPTION
[0055] In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples. The following examples are used to illustrate the present invention but are not used to limit the scope of the present invention.
[0056] See also Figure 1-7This specific embodiment discloses a method for detecting appearance defects of a graphite sheet assembly based on a photometric stereo algorithm. The graphite sheet assembly includes a graphite sheet area and a nickel sheet area, and includes the following steps:
[0057] a) Use line scan camera A to shoot the workpiece surface of graphite sheet assembly at an oblique angle at station S1, and use line scan camera B to shoot the workpiece surface of graphite sheet assembly at a vertical angle at station S2. Obtain the deformation, scratches, indentations, wrinkles, concave points, convex points and other defects of graphite sheet area from the line scan image taken by line scan camera A, and obtain the bubbles, scratches, indentations, wrinkles, concave points, convex points, dirt and other defects on the nickel sheet area from the line scan image taken by line scan camera B. Use deep learning network to determine whether graphite sheet assembly is OK or NG, and record the concave points and convex points defects of NG products as defects to be determined; Among them, the oblique angle shooting of line scan camera A at station S1 can more accurately capture the deformation of graphite sheet area;
[0058] b) Use color line scan camera C to shoot vertically at station S3, and obtain two pictures with different exposures through time-sharing stroboscopic exposure to detect defects such as hair in the nickel sheet area, glue overflow in the nickel sheet area, and damage in the graphite sheet area;
[0059] c) At the S4 station, a telecentric lens is used to approximate the area array camera D of the orthographic projection model, and a four-dimensional strip light source is used as the light source. The four-dimensional strip light sources are distributed at the same height and 90 degrees apart. The four-dimensional strip light sources are turned on in sequence, and four images are taken respectively using the four-dimensional strip light sources. The normal vector of each pixel point in each image is calculated, and the normal vector of each pixel point is combined to obtain the normal vector of the entire image, and the concave point and convex point defect types in step a) are detected using the photometric stereo imaging method;
[0060] d) The unloading module transports OK products and NG products to different flow lines according to the output results.
[0061] More specifically, step a) further comprises:
[0062] a1) Use the preprocessing algorithm to perform Gaussian filtering and denoising on the line scan images obtained by the line scan cameras A and B respectively, use the edge extraction algorithm to obtain the accurate outer edge of the nickel sheet, use the intersection of the two outer edges of the product as the origin, and establish the workpiece coordinate system of the product with the width direction as the X-axis. Set the detection ROI area in the workpiece coordinate system, distinguish the nickel sheet area and the graphite sheet area, and send the nickel sheet area and the graphite sheet area to the deep learning network;
[0063] a2) Deep learning includes two-level learning networks. The first-level learning network (semantic segmentation model Deeplabv3+) traverses all defects of several small images sent from the graphite sheet area and the nickel sheet area, and divides them into graphite sheet area defects and nickel sheet area defects according to different detection objects;
[0064] If the first-level learning network outputs OK, the corresponding graphite sheet component is considered a qualified product. If the first-level learning network outputs NG, a preliminary screening is performed based on the length, width, area and other parameters of the defects output by the first-level learning network. For defects that do not meet the conditions, the corresponding graphite sheet components are still considered qualified products.
[0065] For defective images that meet the conditions, they are sent to the secondary learning network for re-inspection (classification model ResNet50). If the secondary learning network outputs OK, the corresponding graphite sheet component is considered a qualified product; the NG images output by the secondary learning network are analyzed, and quality screening is performed based on the defect location and number. If the defects exceed the pre-set conditions, the corresponding graphite sheet component is determined to be a final NG product;
[0066] a3) Analyze the results in step a2) and merge the areas labeled as concave defects and convex defects into the same type of areas as defects to be determined. At the same time, determine the coordinate values, area, and size information of the concave defects and convex defects in the workpiece coordinate system.
[0067] In this specific embodiment, in step a), the S1 and S2 stations (line scan camera A and line scan camera B stations) optimize the detection method of the original graphite sheet defects, that is, in the detection system of pre-processing algorithm + deep learning algorithm (detect all defects) + defect feature analysis post-processing, the point defects detected by the deep learning algorithm are classified and recorded as a defect to be determined, and in the post-processing link, the coordinates of the concave-convex defects to be determined are converted into actual coordinates through the workpiece coordinate system and saved, in preparation for the subsequent coordinate alignment.
[0068] More specifically, the determination method of step b) is the same as step a), and specifically includes:
[0069] b1) Use preprocessing algorithm to perform high dynamic image fusion on color line scan images;
[0070] b2) Use the edge extraction algorithm to obtain the accurate edge of the outer edge of the nickel sheet. Use the intersection of the two edges as the origin and the width direction as the X-axis to establish a workpiece coordinate system for the nickel sheet area of the product. Set the detection ROI area in the workpiece coordinate system to distinguish the nickel sheet area from the graphite sheet area covering it; finally, send it to the deep learning network.
[0071] b3) The deep learning algorithm adopts a two-level learning network structure. The first-level learning network uses a segmentation network (semantic segmentation model Deeplabv3+) to detect defects such as hair in the nickel sheet area, glue overflow in the nickel sheet area, and damage in the graphite sheet area. For the NG products output by the segmentation network, preliminary filtering is performed based on the length, width and area of the defects to eliminate some obvious false detection defects. The second level uses a classification network (classification model ResNet50). For the defects to be judged that meet the set defect conditions (that is, the output NG products of the previous level), further screening is performed based on the defect location and number, and the defects that do not meet the conditions are judged as the final NG products.
[0072] More specifically, in step c), the normal vector of each pixel in each image is calculated, and the normal vector of each pixel is combined to obtain the normal vector of the entire image, including:
[0073] c1), calculating the light source directions of the four strip light sources, and reading the direction vectors of the four strip light sources obtained in the light source direction calculation link;
[0074] c2) Read the image collected corresponding to each light source and record the length and width of the image;
[0075] c3), normalize the light source intensity of each image;
[0076] c4) Get the normalized matrix of the image;
[0077] c5) traverse the row and column coordinates of the image and calculate the corresponding normal vector for each pixel coordinate;
[0078] c6) Normalize the normal vector of each pixel to obtain the unit normal vector of each pixel in the four images;
[0079] c7) Combine the unit normal vectors of all image coordinate points to obtain the normal vector of the entire image;
[0080] In this specific embodiment, in step c1), the vectors of the directions of the four strip light sources are read, and the vector composed of the four light source directions obtained in the light source direction calculation link is read, including:
[0081] c1-1) Analyze the image of the plastic ball with high reflectivity through image processing technology to determine the direction of each light source in the photometric stereo imaging. The specific calculation process is as follows:
[0082] As attached Figure 2 As shown, the area array camera D uses a telecentric lens to simulate the orthographic projection model. The light source shines on the reflective plastic ball. The direction of the center point of the brightest area can be regarded as the light source direction L.
[0083] Step c1-1-1), in the imaging environment setting stage, remove environmental interference as much as possible. After acquiring the image, use Gaussian filtering to remove noise, calculate the grayscale mean of the entire image, add an appropriate offset as the threshold, and in the present invention, set the offset to +30. After obtaining the highlight area, perform morphological opening operation to remove interference from the highlight area, select the target area according to the maximum area, and finally calculate its circumscribed circle. The center of the circumscribed circle of the target area is set as the highlight point coordinate (P x , P y ), and calculate the center of the circumscribed circle of the plastic ball as the coordinates of the sphere center (C x , C y ), the method is the same as that of obtaining the center coordinates of the circumscribed circle of the target area;
[0084] Step c1-1-2), calculate the spherical surface normal vector N:
[0085] N=N(N x , N y , N z )=(P x -C x , P y -C y , ), where r is the radius of the plastic ball;
[0086] Step c1-1-3), set the unit vector R of the reflection direction of the light source L to (0, 0, 1), then the expression of the light source direction L is:
[0087]
[0088] Where |N| is the scalar value of the normal vector N on the sphere surface.
[0089] The calculation process of formula 1 in this embodiment is as follows: Figure 3 It can be seen that
[0090] R+L=N=2S
[0091] L = 2S-R, where S is the projection of R on N,
[0092] According to the transformation of the coordinate system, based on the fact that S is the projection of R on N, the vector projection calculation formula can be obtained:
[0093]
[0094] Substituting the expression L = 2S-R, we can get:
[0095]
[0096] Step c1-2), turn on the four strip light sources in sequence, obtain the light source direction of each strip light source according to the above method, and put the light source direction of each strip light source in the vector representing the light source direction for subsequent operations.
[0097] In this specific embodiment, in step c6), the normal vector of each pixel is normalized to obtain the unit normal vector of each pixel in the four images, including: calculating the reflectivity P of the surface point of the object ij ,
[0098] P ij =ρ i (N i *L j ) j Formula 2
[0099] Formula 2 reflects the relationship between the pixel value, the light source, and the surface normal vector of the object, where P ij Represents the grayscale value of the pixel at the i-th point on the image irradiated by light source j, which can be obtained on the image; N i is the surface unit normal vector of the i-th point; i represents the reflectivity of the i-th point; L j represents the unit vector in the direction of the j-th light source, obtained in step c1); l j Indicates the intensity of the jth light source. If the relative positions of the camera and the light source remain unchanged, this value can be set to 1.
[0100] In this specific embodiment, N and ρ can be solved by illuminating the i-th point with at least three light sources. When the number of light sources is 3, let the light source direction matrix L = [L 1 ,L 2 ,L 3 ] T , the vector composed of the pixel values on the corresponding three images is P i ,
[0101] Then i =|L -1 *P i |
[0102] Thus we get
[0103] Similarly, when the number of light sources is 4, the four strip-shaped light sources are distributed at the same height and 90 degrees apart, and the light source direction matrix L = [L 1 ,L 2 ,L 3 ,L 4 ] T , the vector composed of the pixel grayscale values of the i-th point on the corresponding four images is P i =[P i1 ,Pi2 ,P i3 ,P i4 ] T , then formula 2 becomes an overdetermined system of equations, and the least squares solution to this overdetermined system of equations is:
[0104] ρ i =|(L T *L) -1 *L T *P i |Formula 3
[0105]
[0106] More specifically, in step c), using photometric stereo imaging to detect the concave and convex defects in step a) also includes:
[0107] c8) According to the position of the defect to be determined output by the S1 station, the defect coordinates are mapped to the image of the area array camera through the matrix transformation between the line scan cameras A, B and the area array camera D.
[0108]
[0109] Where (c, r) is the coordinate of the defect in the line scan camera image, (c', r') is the coordinate of the defect in the area array camera, c_sh ift and r_sh ift are the offsets in the column and row directions respectively, θ is the rotation angle, and s is the ratio of the single pixel accuracy of the line scan camera image to the area array camera image;
[0110] Set a local ROI area according to the defect location, analyze the gradient field within the area, and use Gaussian filtering to detect the gradient change difference;
[0111] c9. Based on the defect analysis in step c8, a fixed threshold segmentation is used. The threshold is set to the average grayscale value of the local area. The abnormal areas that are too bright or too dark are extracted. The grayscale value presented by concave defects is significantly lower than the average grayscale value of the area, while the grayscale value presented by convex defects is significantly higher than the average grayscale value of the area. For adjacent defective areas, since one defect is cut into multiple areas distributed on different pictures after cutting, the principle of merging the detection ROI first and then performing subsequent detection is adopted for processing, so as to determine the defect type of concave or convex points.
[0112] In this specific embodiment, Figure 6 As shown in the figure, they are the imaging effects of turning on each light in turn under four strip lights. The normal vector of each pixel is calculated by using four images, and the normal vector of the whole image is combined to represent the gradient field of the product surface at the current position. The appropriate Sigma (smoothing coefficient) is set and its Gaussian curvature is calculated. According to the difference in surface gradient changes, the defect area can be more clearly reflected in the result map, as shown in the figure. Figure 7 shown.
[0113] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the technical principles of the present invention, and these improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A method for detecting appearance defects of a graphite sheet assembly based on a photometric stereo algorithm, wherein the graphite sheet assembly includes a graphite sheet area and a nickel sheet area, and wherein: The following steps are involved: a) Use line scan camera A to take an oblique shot of the workpiece surface of the graphite sheet assembly at station S1, and use line scan camera B to take a vertical shot of the workpiece surface of the graphite sheet assembly at station S2. Obtain the deformation, scratches, indentations, wrinkles, concave points, convex points and other defects of the graphite sheet area from the line scan image taken by line scan camera A, and obtain the bubbles, scratches, indentations, wrinkles, concave points, convex points, dirt and other defects on the nickel sheet area from the line scan image taken by line scan camera B. Use the deep learning network to determine whether the graphite sheet assembly is an OK product or a NG product, and record the concave point and convex point defects of the NG product as defects to be determined; b) Use color line scan camera C to shoot vertically at station S3, and obtain two pictures with different exposures through time-sharing stroboscopic exposure to detect defects such as hair in the nickel sheet area, glue overflow in the nickel sheet area, and damage in the graphite sheet area; c) At the S4 station, a telecentric lens is used to approximate the area array camera D of the orthographic projection model, and a four-dimensional strip light source is used as the light source. The four-dimensional strip light sources are distributed at the same height and 90 degrees apart. The four-dimensional strip light sources are turned on in sequence, and four images are taken respectively using the four-dimensional strip light sources. The normal vector of each pixel point in each image is calculated, and the normal vector of each pixel point is combined to obtain the normal vector of the entire image, and the concave point and convex point defect types in step a) are detected using the photometric stereo imaging method; d) The unloading module transports OK products and NG products to different flow lines according to the output results.
2. The method for detecting appearance defects of graphite sheet components based on photometric stereo algorithm according to claim 1, characterized in that: Step a) comprises the following steps: a1) Use the preprocessing algorithm to perform Gaussian filtering and denoising on the line scan images obtained by the line scan cameras A and B respectively, use the edge extraction algorithm to obtain the accurate outer edge of the nickel sheet, use the intersection of the two outer edges of the product as the origin, and establish the workpiece coordinate system of the product with the width direction as the X-axis. Set the detection ROI area in the workpiece coordinate system, distinguish the nickel sheet area and the graphite sheet area, and send the nickel sheet area and the graphite sheet area to the deep learning network; a2) Deep learning includes a two-level learning network. The first-level learning network traverses all defects of several small images sent from the graphite sheet area and the nickel sheet area, and divides them into graphite sheet area defects and nickel sheet area defects according to different detection objects; If the first-level learning network outputs OK, the corresponding graphite sheet component is considered a qualified product. If the first-level learning network outputs NG, a preliminary screening is performed based on the length, width, area and other parameters of the defects output by the first-level learning network. For defects that do not meet the conditions, the corresponding graphite sheet components are still considered qualified products. For defective images that meet the conditions, they are sent to the secondary learning network for re-inspection. If the secondary learning network outputs OK, the corresponding graphite sheet component is considered a qualified product; the NG images output by the secondary learning network are analyzed, and quality screening is performed based on the defect location and number. If the defects exceed the pre-set conditions, the corresponding graphite sheet component is determined to be a final NG product; a3) Analyze the results in step a2) and merge the areas labeled as concave defects and convex defects into the same type of areas as defects to be determined. At the same time, determine the coordinate values, area, and size information of the concave defects and convex defects in the workpiece coordinate system.
3. The method for detecting appearance defects of graphite sheet components based on photometric stereo algorithm according to claim 2, characterized in that: Step b) comprises the following steps: b1) Use preprocessing algorithm to perform high dynamic image fusion on color line scan images; b2) Use edge extraction algorithm to obtain accurate edges of the outer edges of the nickel sheet. Use the intersection of the two edges as the origin and the width direction as the X-axis to establish a workpiece coordinate system for the nickel sheet area of the product. Set the detection ROI area in the workpiece coordinate system to distinguish the nickel sheet area from the graphite sheet area covering it. Finally, send it to the deep learning network. b3) The deep learning network adopts a two-level learning network structure. The first-level learning network uses a segmentation network to detect defects such as hair in the nickel sheet area, glue overflow in the nickel sheet area, and damage in the graphite sheet area. For the NG products output by the first-level learning network, preliminary filtering is performed based on the length, width and area of the defects to eliminate some obvious false detection defects. The second-level learning network uses a classification network. For the defects to be judged that meet the set defect conditions, further screening is performed based on the defect location and number, and the defects that do not meet the conditions are judged as the final NG products.
4. The method for detecting appearance defects of graphite sheet components based on photometric stereo algorithm according to claim 3 is characterized in that: In step c), the normal vector of each pixel in each image is calculated, and the normal vector of each pixel is combined to obtain the normal vector of the entire image, including: c1), calculating the light source directions of the four strip light sources, and reading the direction vectors of the four strip light sources obtained in the light source direction calculation link; c2) Read the image collected corresponding to each light source and record the length and width of the image; c3), normalize the light source intensity of each image; c4) Get the normalized matrix of the image; c5) traverse the row and column coordinates of the image and calculate the corresponding normal vector for each pixel coordinate; c6) Normalize the normal vector of each pixel to obtain the unit normal vector of each pixel in the four images; c7) Combine the unit normal vectors of all image coordinate points to obtain the normal vector of the entire image.
5. The method for detecting appearance defects of graphite sheet components based on photometric stereo algorithm according to claim 4 is characterized in that: In step c1), the vectors of the directions of the four strip light sources are read, and the vector composed of the four light source directions obtained in the light source direction calculation link is read, including the steps of: c1-1), analyzing the image of the plastic ball with higher reflectivity by image processing technology, and determining the direction L of each light source in the photometric stereoscopic imaging; c1-2) Turn on the four strip light sources in sequence, obtain the light source direction of each strip light source according to the above method, and put the light source direction of each strip light source in the vector representing the light source direction for subsequent operations.
6. The method for detecting appearance defects of graphite sheet components based on photometric stereo algorithm according to claim 5, characterized in that: In step c1-1), the image of the plastic ball with a higher reflectivity is analyzed by image processing technology to determine the direction L of each strip light source in the photometric stereoscopic imaging, including the steps of: c1-1-1) In the imaging environment setting stage, the environmental interference is removed as much as possible. After acquiring the image, the Gaussian filter is used to remove the noise. The grayscale mean of the whole image is calculated, and an appropriate offset is added as the threshold. After obtaining the highlight area, the morphological opening operation is used to remove the interference of the highlight area. The target area is obtained by screening according to the maximum area, and finally its circumscribed circle is calculated. The center of the circumscribed circle of the target area is set as the coordinates of the highlight point (P x , P y ), and use the same method to calculate the center of the circumscribed circle of the plastic ball, which is the coordinate of the sphere center (C x , C y ); c1-1-2) Calculate the normal vector N of the sphere surface, Where r is the radius of the sphere; c1-1-3) Set the unit vector R of the light source reflection direction to (0, 0, 1), then the expression of the light source direction L is: Where |N| is the scalar value of the normal vector N on the sphere surface.
7. The method for detecting appearance defects of graphite sheet components based on photometric stereo algorithm according to claim 4, characterized in that: In step c6), the normal vector of each pixel is normalized to obtain the unit normal vector of each pixel in the four images, including: calculating the reflectivity P of the surface point of the object ij , P ij =ρ i (N i *L j )l j , Where P ij Represents the grayscale value of the pixel at the i-th point on the image irradiated by light source j, which can be obtained on the image; N i ρ is the surface unit normal vector of the i-th point; i represents the reflectivity of the i-th point; L j represents the unit vector in the direction of the j-th light source, obtained in step c1); l j Indicates the intensity of the jth light source. When the relative positions of the camera and the light source remain unchanged, the value is set to 1.
8. The method for detecting appearance defects of graphite sheet components based on photometric stereo algorithm according to claim 7, characterized in that: When the number of light sources is 4, let the light source direction matrix L = [L1, L2, L3, L4] T , the vector composed of the pixel grayscale values of the i-th point on the corresponding four images is P i =[P i1 ,P i2 ,P i3 ,P i4 ] T ,but ρ i =|(L T *L) -1 *L T *P i |, 9. The method for detecting appearance defects of graphite sheet components based on photometric stereo algorithm according to claim 1, characterized in that: In step c), the concave and convex defects in step a) are detected by using photometric stereo imaging, and the steps include: c8) According to the position of the defect to be determined output by the S1 station, the defect coordinates are mapped to the image of the area array camera through the matrix transformation between the line scan cameras A, B and the area array camera D. Where (c, r) is the coordinate of the defect in the line scan camera image, (c', r') is the coordinate of the defect in the area array camera, c_shift and r_shift are the offsets in the column direction and row direction respectively, θ is the rotation angle, and s is the ratio of the single pixel accuracy of the line scan camera image and the area array camera image; a local ROI area is set according to the defect position, the gradient field is analyzed in this area, and the difference in gradient changes is detected by Gaussian filtering; c9) Based on the defect analysis in step c8, a fixed threshold is used for segmentation. The threshold is set as the average grayscale value of the local area, and abnormal areas that are too bright or too dark are extracted to determine the defect type of concave or convex points.
10. The method for detecting appearance defects of graphite sheet components based on photometric stereo algorithm according to claim 6, characterized in that: The offset is set to +30.
Citation Information
Cited By
Corrugated paper quality detection method based on indentation, medium and equipment
CN119164960A
Detection method and system for detecting tire defects
CN122335677A
