Method and system for detecting appearance quality of substrate
By using LED lamps installed with inclined angles and HALCON machine vision algorithms in ceramic substrate detection, the problem of poor detection of oil-fouling defects is solved, and the accurate identification and detection of surface defects and oil-fouling of ceramic substrates is achieved.
Patent Information
- Application Number
- CN202411363158.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-27
AI Technical Summary
When detecting the appearance quality of ceramic substrates, the prior art fails to effectively use the inclined angle light source to fully detect oil-fouling defects, resulting in the impact of the detection effect.
Design a detection method, use LED lamps to install at an inclined angle of 45° to 75°, and adjust the light source intensity through position sensors, combine industrial cameras and HALCON machine vision algorithms to perform image preprocessing and image enhancement, and adaptively identify substrate surfaces defects and oil stains.
Accurate detection of surface defects and oil stains on ceramic substrates is achieved, ensuring imaging quality, not affected by light source position adjustment, reducing noise, and avoiding missed inspections.
Smart Images

Figure CN119198770A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ceramic substrate defect detection, and in particular to a method and system for detecting the appearance quality of a substrate. Background Art
[0002] After the ceramic substrate is processed, it is necessary to inspect its appearance quality. Defects such as broken edges, burrs, defects, scratches, pollution, and cracks on the surface of the substrate need to be detected to prevent them from being put into storage. Customers have high requirements for cracks in the substrate. During use, they will expose tiny cracks after surface treatment processes such as pickling and alkali washing. We call them "hidden cracks". Ceramic substrates are insulating materials. If hidden cracks appear, they will cause breakdown under a certain voltage and damage the electronic components fixed on the substrate, which is not allowed by customers.
[0003] At present, ceramic substrate inspection is done by manual visual and mechanical inspection. Some tiny surface defects are difficult to detect with conventional visual observation methods. They must be photographed with a camera with a certain magnification, and then identified by a computer through a comparison program through mechanical inspection. For example, the "A Ceramic Substrate Surface Inspection Projector" proposed in the published patent document (CN215768193U) proposes a method for observing substrate surface defects based on vision.
[0004] From the installation structure of the image acquisition device 4 in "A Ceramic Substrate Surface Detection Projector", it can be seen that this method directly acquires the substrate surface image at a vertical angle, and there are still the following technical problems to be solved: obvious defects such as broken edges, burrs, defects, scratches, etc. can generally be directly detected by photographing and comparing, but some oil-related defects must be detected by observing the substrate from the opposite direction of the light source after the LED light source is irradiated at a certain tilt angle. After the LED light source is tilted, the light intensity irradiated on the back-illuminated object will change to a certain extent, which will have a certain impact on the detection effect. For this reason, it is necessary to design an LED light with a certain tilt angle and the system that can adaptively adjust the light source intensity to detect oil-related defects. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes a method and system for detecting the appearance quality of a substrate, which is used to solve the technical problem that the prior art only considers the detection of obvious defects and does not design an inclined angle light source to fully detect oil stains.
[0006] To achieve the above object, the present invention provides a method for detecting the appearance quality of a substrate, comprising the following steps:
[0007] S1: The illumination of the substrate is preset to 70lux-100lux, and the power input to the LED lamp is adjusted according to the parameters of the LED lamp, the installation position of the LED lamp fed back by the position sensor, and the substrate area;
[0008] S2: The industrial camera is installed at a position symmetrical to the installation position of the LED lamp, with the projection of the central axis of the substrate onto the installation plane of the LED lamp as the symmetry line;
[0009] S3: collecting substrate images and preprocessing the substrate images based on photometric stereo;
[0010] S4: Based on the HALCON machine vision algorithm, image enhancement algorithms for substrate defect parts and substrate stain parts are designed respectively to detect the pre-processed substrate image and determine the substrate surface defects and oil stains;
[0011] In order to ensure the imaging quality of industrial cameras, the illumination of the substrate is preset, and the power of the LED lamp is adjusted according to this illumination to make the lighting environment reach an appropriate state.
[0012] Further: The specific method of S1 is as follows:
[0013] The installation position of the position sensor is consistent with the installation position of the LED lamp;
[0014] There is an inclination angle between the LED lamp installation position and the substrate installation position, specifically: in a spatial coordinate system (x, y, z) with the center of the substrate as the origin and the substrate plane as the (x, y) two-dimensional plane, the inclination angle between the center coordinate of the LED lamp installation position and the center coordinate of the substrate is 45° to 75°;
[0015] The LED lamp parameters include: the number of LED lamps N, the space utilization coefficient CU, the maintenance coefficient K and the luminous efficiency η;
[0016] The adjustment formula of the power of the LED lamp is as follows:
[0017]
[0018] Wherein, E is the preset illumination of the substrate, which is 70lux-100lux;
[0019] A is the substrate area;
[0020] θ is the inclination angle between the center coordinate of the LED lamp installation position and the center coordinate of the substrate, which is specifically observed by the position sensor.
[0021] Further: the specific method of S3 is:
[0022] Collect the substrate image, determine the installation position of the industrial camera, and obtain the direction unit vectors (L1~L4) from the four vertices of the substrate image to the industrial camera and the unit normal vectors (N1~N4) corresponding to the four vertices T ;
[0023] Construct a pixel matrix to obtain the gradients of the four vertices in the x and y directions respectively, amplify the pixels of the substrate image according to the mean value of the gradients of the four vertices, and perform a difference process with the pixel value of the substrate image to obtain a low-noise acquisition image, namely, a difference image;
[0024] Combined with the ostu maximum inter-class variance method, the difference image is binarized.
[0025] Further: the specific method for obtaining the gradients of the four vertices in the x and y directions is:
[0026] The direction unit vectors (L1~L4) of the four vertices to the industrial camera and the unit normal vectors (N1~N4) corresponding to the four vertices T Substitute the pixel matrix into the pixel matrix according to the one-to-one correspondence rule, and the pixel matrix is as follows:
[0027]
[0028] Wherein, k is 1 to 4, indicating the numbers of the four vertices on the substrate image;
[0029] L xk , L yk , L zk Represents the direction unit vector L k , k∈[1,4] is the unit vector in the x, y, z directions;
[0030] N xk 、N yk 、N zk Represents the unit normal vector N k , k∈[1,4] is the unit normal vector in the x, y, z directions;
[0031] From this, we can get the unit normal vectors (N1~N4) corresponding to the four vertices T , which is specifically shown by the following formula:
[0032]
[0033] Where ξ is the reflectivity of the substrate surface, ranging from 92% to 98%
[0034] I is the intensity of the light source reflected from the substrate surface, as shown in the following formula:
[0035] I=I0 cosθ V ;
[0036] Among them, I0 is the light source intensity, that is, the light intensity of the LED lamp;
[0037] θ is the inclination angle between the center coordinate of the LED lamp installation position and the center coordinate of the substrate;
[0038] V is the direction vector of the light from the LED lamp incident on the center of the substrate;
[0039] Finally, partial derivatives are taken for the four vertices to obtain the gradients X and Y of the four vertices in the x and y directions respectively.
[0040]
[0041] Further: The specific method of the ostu maximum inter-class variance method is:
[0042] Adaptively select the threshold t, set the gray value of the difference image with the threshold t as the boundary, set the part greater than t as the background class of the difference image; set the part less than or equal to t as the target class; combine the gray level, number of pixels and gray probability of the background class and the target class to calculate the background mean and target mean corresponding to the background class and the target class respectively; solve the inter-class variance from the background mean and the target mean;
[0043] The maximum value of the inter-class variance is taken as the maximum separation between the target class and the background class, which is the separation in the HALCON machine vision algorithm.
[0044] Further: S4 includes:
[0045] Image enhancement, specifically: enhancement of the defective part of the substrate and enhancement of the part with stains on the substrate;
[0046] For the defects of the substrate: a method of performing two mean filters followed by difference is designed to extract the defects. The pre-processed substrate image is subjected to mean filtering using a small template and then a large template to suppress noise. The processed image is then differentiated to enhance the contrast between the scratch area and other areas.
[0047] The small template is designed to be 3*3 pixels in size, and the large template is designed to be 250*250 pixels in size;
[0048] The mean filtering process requires processing the original pixels of the preprocessed substrate image, specifically: replacing the original pixels with the mean of the currently selected template;
[0049] For the part with stains on the substrate: median filtering is used to reduce isolated noise and identify the stain area by combining features such as connected domains; median filtering is to slide a sliding window with an odd number of points on the image, sort the grayscale values in the window and assign its median to the center point; the sliding window is a circular window with a radius of 10*10 pixels;
[0050] Among them, since the substrate defect is a more obvious damage, it is brighter than other areas and has a larger grayscale value, but there is more noise in the image and the grayscale value is also large, which forms interference. Therefore, in order to suppress the influence of noise, two mean filters are designed; and the stain area is relatively dark in the image and has a relatively low grayscale value, so the detection method is different from that of the defective area, and there are more isolated noise points in the stain image, so median filtering is used.
[0051] The present invention also provides a system for detecting the appearance quality of a substrate, comprising: a terminal device;
[0052] The terminal device comprises: a memory, a processor, and a program stored in the memory and executable on the processor;
[0053] The terminal device is electrically connected to a PLC programmable logic controller and an industrial camera;
[0054] The PLC programmable logic controller is electrically connected to the LED lamp to adjust the brightness of the LED lamp;
[0055] When the processor executes the program, any of the above methods and steps are implemented.
[0056] The present invention has the following beneficial effects:
[0057] 1. The power of LED lamps can be adjusted adaptively so that the illumination of the substrate will not be affected by the adjustment of the position of the LED lamps, ensuring that the imaging quality of the industrial camera is not affected.
[0058] 2. The collected substrate image is first processed based on photometric stereo to reduce its noise, and the advantages of bright and dark field images are combined to generate an image with low noise and rich image details.
[0059] 3. Design HALCON machine vision algorithms for substrate surface defects and oil stains respectively to avoid missing any of them during the analysis process. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of the present invention and the technical solutions in the prior art, the drawings required for use in the embodiments and the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some implementation methods recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0061] Figure 1 is a system flow chart of the present invention;
[0062] Figure 2 It is a system schematic diagram of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0064] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can be applied to other similar scenarios based on these drawings without any creative work.
[0065] In addition, it can be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in this application, some design, manufacturing or production changes based on the technical contents disclosed in this application are just conventional technical means and should not be understood as the contents disclosed in this application are insufficient.
[0066] Unless otherwise specified, all embodiments and optional embodiments of the present application can be combined with each other to form a new technical solution.
[0067] See also Figure 1 , the system flow chart of the present invention comprises the following steps:
[0068] S1: The illumination of the substrate is preset to 70lux-100lux, and the power input to the LED lamp is adjusted according to the parameters of the LED lamp, the installation position of the LED lamp fed back by the position sensor, and the substrate area;
[0069] S2: The industrial camera is installed at a position symmetrical to the installation position of the LED lamp, with the projection of the central axis of the substrate onto the installation plane of the LED lamp as the symmetry line;
[0070] S3: collecting substrate images and preprocessing the substrate images based on photometric stereo;
[0071] S4: Based on the HALCON machine vision algorithm, image enhancement algorithms are designed for the defective part of the substrate and the stain part of the substrate respectively, which are used to detect the pre-processed substrate image and determine the surface defects and oil stains of the substrate.
[0072] Specifically:
[0073] In S1, to ensure the quality of imaging, the illumination received by the substrate is set to 70lux-100lux in the program. Since the LED lamp needs to be set to a tilted state, to ensure that the illumination received by the substrate is within the set range, the illumination intensity (power) of the LED lamp needs to be adjusted accordingly according to the installation angle, and is adjusted according to the following rules: the installation position of the position sensor is consistent with the installation position of the LED lamp, and a spatial coordinate system (x, y, z) is established with the center of the substrate as the origin and the substrate plane as the (x, y) two-dimensional plane. The tilt angle between the center coordinate of the LED lamp installation position and the center coordinate of the substrate is 45° to 75°;
[0074] LED lamp parameters include: number of LED lamps N, space utilization coefficient CU, maintenance coefficient K and luminous efficiency η;
[0075] The power adjustment formula of LED lamps is as follows:
[0076]
[0077] Wherein, E is the preset illumination of the substrate, which is 70lux-100lux;
[0078] A is the substrate area;
[0079] θ is the inclination angle between the center coordinate of the LED lamp installation position and the center coordinate of the substrate, which is observed by the position sensor.
[0080] In S2, in order to ensure the quality of imaging, the installation position of the industrial camera must be symmetrical with the position of the LED lamp (light source).
[0081] In S3, the position sensor determines the installation position of the industrial camera, and the direction unit vectors (L1~L4) of the four vertices of the collected substrate image to the industrial camera and the unit normal vectors (N1~N4) corresponding to the four vertices are calculated. T According to the one-to-one correspondence rule, the pixel matrix is respectively brought in, and the gradients of the four vertices in the x and y directions are respectively obtained. The pixels of the substrate image are amplified according to the average value of the gradients of the four vertices, and the pixel values of the substrate image are subtracted to obtain a low-noise acquisition image, namely, a difference image;
[0082] Further: The pixel matrix is as follows:
[0083]
[0084] Wherein, k is 1 to 4, indicating the numbers of the four vertices on the substrate image;
[0085] L xk , L yk , L zk Represents the direction unit vector L k , k∈[1,4] is the unit vector in the x, y, z directions;
[0086] N xk 、N yk 、N zk Represents the unit normal vector N k , k∈[1,4] is the unit normal vector in the x, y, z directions;
[0087] From this, we can get the unit normal vectors (N1~N4) corresponding to the four vertices T , which is specifically shown by the following formula:
[0088]
[0089] Where ξ is the reflectivity of the substrate surface, ranging from 92% to 98%
[0090] I is the intensity of the light source reflected from the substrate surface, as shown in the following formula:
[0091] I=I0 cosθ V ;
[0092] Wherein, I0 is the light source intensity, i.e., the light intensity of the LED lamp, which is obtained by looking up the LED lamp power P determined in S1;
[0093] θ is the inclination angle between the center coordinate of the LED lamp installation position and the center coordinate of the substrate;
[0094] V is the direction vector of the light from the LED lamp incident on the center of the substrate;
[0095] Finally, partial derivatives are taken for the four vertices to obtain the gradients X and Y of the four vertices in the x and y directions respectively.
[0096]
[0097] Then, the difference image is binarized by combining the ostu maximum inter-class variance method; the binarization difference image process adopts the traditional HALCON machine vision algorithm. In the traditional HALCON machine vision algorithm, the method selected for the specified threshold step is the ostu maximum inter-class variance method, and the rule is: adaptively select the threshold t, and use the grayscale value of the difference image as the boundary, and the part greater than t is set as the background class of the difference image; the part less than or equal to t is set as the target class; combining the grayscale, number of pixels and grayscale probability of the background class and the target class, respectively calculate the background mean and target mean corresponding to the background class and the target class; solve the inter-class variance by the background mean and the target mean; take the maximum value of the inter-class variance as the maximum separation degree of the target class and the background class as the separation degree in the HALCON machine vision algorithm.
[0098] The preprocessed substrate images are subjected to substrate defect analysis and substrate stain analysis, respectively. For this purpose, two different image enhancement rules are designed:
[0099] 1. Regarding the defective part of the substrate: Since the defect of the substrate is a more obvious damage, it is brighter than other areas and has a larger grayscale value. However, there is more noise in the image and the grayscale value is also large, which forms interference. Therefore, in order to suppress the influence of noise, a method of extracting defects by performing two mean filtering and then performing difference is designed. The pre-processed substrate image is subjected to mean filtering using a small template and a large template in turn to suppress noise, and then the processed image is differentiated to enhance the contrast between the scratch area and other areas; the small template is designed to be 3*3 pixels in size, and the large template is designed to be 250*250 pixels in size; the mean filtering process requires processing the original pixels of the pre-processed substrate image, specifically: the original pixels are replaced by the mean of the currently selected template;
[0100] 2. Regarding the stains on the substrate: Since the stain area is relatively dark in the image and has a relatively low grayscale value, the detection method is different from that of the defect area. In addition, there are many isolated noise points in the stain image, so median filtering is used to reduce isolated noise and combine features such as connected domains to identify the stain area. Median filtering uses a sliding window with an odd number of points to slide on the image, sort the grayscale values in the window and assign its median to the center point. The sliding window is a circular window with a radius of 10*10 pixels.
[0101] After the two different enhancements mentioned above, the HALCON machine vision algorithm directly observes and determines whether there are defects or stains.
[0102] The advantages of the present invention are as follows: a tilted light source is designed to detect conventional defects and oil stains at the same time, and the light source is designed to be an adjustable light source to ensure imaging quality; the collected substrate image is first processed based on photometric stereo to reduce its noise, and the advantages of bright and dark field images are combined to generate an image with low noise and rich image details; HALCON machine vision algorithms are designed for substrate surface defects and oil stains respectively to avoid missing any of them during the analysis process.
[0103] The above is a very detailed description of one or more embodiments of the present invention, but the content is only a specific example of the present invention and cannot be considered to limit the scope of application of the present invention. Any other methods and changes proposed based on the content of the present invention should fall within the scope of patent protection of the present invention.
Claims
1. A method for detecting the appearance quality of a substrate, characterized in that: The steps include: S1: The illumination of the substrate is preset to 70lux-100lux, and the power input to the LED lamp is adjusted according to the parameters of the LED lamp, the installation position of the LED lamp fed back by the position sensor, and the substrate area; S2: The industrial camera is installed at a position symmetrical to the installation position of the LED lamp, with the projection of the central axis of the substrate onto the installation plane of the LED lamp as the symmetry line; S3: collecting substrate images and preprocessing the substrate images based on photometric stereo; S4: Based on the HALCON machine vision algorithm, image enhancement algorithms are designed for the defective part of the substrate and the stain part of the substrate respectively, which are used to detect the pre-processed substrate image and determine the surface defects and oil stains of the substrate.
2. A method for detecting the appearance quality of a substrate according to claim 1, characterized in that: The specific method of S1 is as follows: The installation position of the position sensor is consistent with the installation position of the LED lamp; There is an inclination angle between the LED lamp installation position and the substrate installation position, specifically: in a spatial coordinate system (x, y, z) with the center of the substrate as the origin and the substrate plane as the (x, y) two-dimensional plane, the inclination angle between the center coordinate of the LED lamp installation position and the center coordinate of the substrate is 45° to 75°; The LED lamp parameters include: the number of LED lamps N, the space utilization coefficient CU, the maintenance coefficient K and the luminous efficiency η; The adjustment formula of the power of the LED lamp is as follows: Wherein, E is the preset illumination of the substrate, which is 70lux-100lux; A is the substrate area; θ is the inclination angle between the center coordinate of the LED lamp installation position and the center coordinate of the substrate, which is specifically observed by the position sensor.
3. A method for detecting the appearance quality of a substrate according to claim 1, characterized in that: The specific method of S3 is: Collect the substrate image, determine the installation position of the industrial camera, and obtain the direction unit vectors (L1~L4) from the four vertices of the substrate image to the industrial camera and the unit normal vectors (N1~N4) corresponding to the four vertices T ; Construct a pixel matrix to obtain the gradients of the four vertices in the x and y directions respectively, amplify the pixels of the substrate image according to the mean value of the gradients of the four vertices, and perform a difference process with the pixel value of the substrate image to obtain a low-noise acquisition image, namely, a difference image; Combined with the ostu maximum inter-class variance method, the difference image is binarized.
4. A method for detecting the appearance quality of a substrate according to claim 3, characterized in that: The specific method for obtaining the gradients of the four vertices in the x and y directions is: The direction unit vectors (L1~L4) of the four vertices to the industrial camera and the unit normal vectors (N1~N4) corresponding to the four vertices T Substitute the pixel matrix into the pixel matrix according to the one-to-one correspondence rule, and the pixel matrix is as follows: Wherein, k is 1 to 4, indicating the numbers of the four vertices on the substrate image; L xk , L yk , L zk Represents the direction unit vector L k , k∈[1,4] is the unit vector in the x, y, z directions; N xk 、N yk 、N zk Represents the unit normal vector N k , k∈[1,4] is the unit normal vector in the x, y, z directions; From this, we can get the unit normal vectors (N1~N4) corresponding to the four vertices T , which is specifically shown by the following formula: Where ξ is the reflectivity of the substrate surface, ranging from 92% to 98% I is the intensity of the light source reflected from the substrate surface, as shown in the following formula: I=I0 cosθ V ; Among them, I0 is the light source intensity, that is, the light intensity of the LED lamp; θ is the inclination angle between the center coordinate of the LED lamp installation position and the center coordinate of the substrate; V is the direction vector of the light from the LED lamp incident on the center of the substrate; Finally, partial derivatives are taken for the four vertices to obtain the gradients X and Y of the four vertices in the x and y directions respectively.
5. The method for detecting the appearance quality of a substrate according to claim 3, characterized in that: The specific method of the ostu maximum inter-class variance method is: Adaptively select the threshold t, set the gray value of the difference image with the threshold t as the boundary, set the part greater than t as the background class of the difference image; set the part less than or equal to t as the target class; combine the gray level, number of pixels and gray probability of the background class and the target class to calculate the background mean and target mean corresponding to the background class and the target class respectively; solve the inter-class variance from the background mean and the target mean; The maximum value of the inter-class variance is taken as the maximum separation between the target class and the background class, which is the separation in the HALCON machine vision algorithm.
6. The method for detecting the appearance quality of a substrate according to claim 1, characterized in that: The S4, the image enhancement algorithm, specifically includes: enhancement for defective parts of the substrate and enhancement for stains on the substrate; For the defects of the substrate: a method of performing two mean filters followed by difference is designed to extract the defects. The pre-processed substrate image is subjected to mean filtering using a small template and then a large template to suppress noise. The processed image is then differentiated to enhance the contrast between the scratch area and other areas. The small template is designed to be 3*3 pixels in size, and the large template is designed to be 250*250 pixels in size; The mean filtering process requires processing the original pixels of the preprocessed substrate image, specifically: replacing the original pixels with the mean of the currently selected template; For the part with substrate stains: use median filtering to reduce isolated noise and combine features such as connected domains to identify the stain area; Median filtering uses a sliding window with an odd number of points to slide on the image, sort the grayscale values in the window and assign its median to the center point; The sliding window is a circular window with a radius of 10*10 pixels.
7. A system for detecting the appearance quality of a substrate, characterized in that: include: A terminal device; The terminal device comprises: a memory, a processor, and a program stored in the memory and executable on the processor; The terminal device is electrically connected to a PLC programmable logic controller and an industrial camera; The PLC programmable logic controller is electrically connected to the LED lamp to adjust the brightness of the LED lamp; When the processor executes the program, the method and steps described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Illumination adjusting method, lighting equipment and computer readable storage medium
CN114698202A
Ceramic substrate surface detection projector
CN215768193U
