Rough surface image processing method and automatic optical detection system comprising rough surface image processing method
Through iterative mean filtering and point cloud aggregation density determination technology, the problem of high false detection rate in rough surface image processing is solved, accurate detection of rough surface defects is achieved, the false detection rate is reduced and the detection accuracy is improved.
Patent Information
- Application Number
- CN202311359583.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-04-26
- Filing Date
- 2023-10-19
- Publication Date
- 2024-10-29
AI Technical Summary
When the object to be tested has a rough surface, traditional image processing methods are prone to high false detection rates, and scaling the image to remove the influence of the rough surface may cause subtle defects to be missed.
Iterative mean filtering is used to randomly construct point clouds and iteratively filter out the diffuse point clouds. The defect candidate locations are determined by point cloud aggregation density, and gradient information is combined for defect detection.
It effectively reduces the false detection rate of defects and can accurately detect deep and small, shallow and large defects on rough surfaces.
Smart Images

Figure CN118864346A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an image processing method suitable for detecting a rough surface and an automatic optical detection system comprising the same. Background Art
[0002] In traditional image detection algorithms, in order to detect defects in the image of the sample to be tested, the defects in the image are generally displayed by controlling the type of ambient light source, or the image is converted to grayscale, and the original image is subtracted from the master image (or design file) and the image defects are obtained by binarization. Or the above two methods are performed together, and the defect features are enhanced by the ambient light source, and then compared with the master image to detect the defects.
[0003] However, when the object to be tested has a rough surface (such as large surface particles or wafer surface), the detection result is easily affected by the surrounding rough surface and causes over-detection, which greatly increases the false detection rate. In the past, the mainstream image processing method for this kind of problem was to scale the image to remove the influence of the rough surface on defect detection, but this kind of resolution approach may remove minor defects at the same time, which in turn increases the missed detection rate. Summary of the invention
[0004] The main purpose of the present invention is to provide a rough surface image processing method, comprising the following steps: establishing gradient information of an image to be tested; iterating a mean filter on the image to be tested based on the gradient information; randomly constructing multiple point clouds on the image to be tested; repeatedly iterating the point clouds and filtering out diffuse point clouds; and selecting a defect candidate position. When the aggregation density of the point cloud set at the defect candidate position exceeds a preset value, the defect candidate position is determined to be a defect.
[0005] Another object of the present invention is to provide an automatic optical inspection system, comprising a detection platform, at least one image capture device and a detection device. The detection platform is used to set a sample to be tested. At least one image capture device is set on one side of the detection platform and is used to photograph the sample to be tested on the detection platform. The detection device is connected to the at least one image capture device, and after the at least one image capture device obtains the image to be tested of the sample to be tested, the method as described above is executed to complete defect detection.
[0006] Therefore, the present invention can effectively solve the problem of over-detection when the sample to be tested has a rough surface texture, and reduce the false detection rate of defects. The present invention can obtain deep and small, shallow and large defects, so that such defects can be effectively found under the rough surface. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 It is a block diagram of the automatic optical inspection system of the present invention.
[0008] Figure 2 A schematic flow chart of the rough surface image processing method of the present invention.
[0009] Figure 3 It is a schematic diagram of the image to be tested in the present invention.
[0010] Figure 4 Schematic diagram of the gradient mask in the present invention.
[0011] Figure 5 Schematic diagram of image processing of the image to be tested in the present invention (I).
[0012] Figure 6 It is a schematic diagram of the process of the iterative point cloud method in the present invention.
[0013] Figure 7 Schematic diagram (II) of image processing of the image to be tested in the present invention.
[0014] Figure 8 Schematic diagram (III) of image processing of the image to be tested in the present invention.
[0015] The following are marked in the figure:
[0016] 100 Automatic Optical Inspection System
[0017] 10. Detection Platform
[0018] 20 Image capture device
[0019] 30 Auxiliary light source device
[0020] 40 Detection device
[0021] 41 Processor
[0022] 42 Storage Units
[0023] WP Samples to be tested
[0024] GF Test image
[0025] DC Point Cloud
[0026] DD Diffusion Point Cloud
[0027] DF defect candidate location DETAILED DESCRIPTION
[0028] The detailed description and technical content of the present invention are described as follows with reference to the accompanying drawings. The "one side" mentioned in the present invention can be the upper side, lower side, left side, right side, front side, rear side of the corresponding object, or be arranged at any adjacent position of the object, or be directly or indirectly connected to the object, etc., which is not limited in the present invention.
[0029] The following is a description of one embodiment of the present invention. For the hardware device of the present invention, please refer to Figure 1 , which is a block diagram of the automatic optical inspection system of the present invention, as shown in the figure: This embodiment discloses an automatic optical inspection system 100, including a detection platform 10, an image capture device 20 arranged corresponding to the detection platform 10, an auxiliary light source device 30 arranged corresponding to the detection platform 10, and a detection device 40 electrically connected or coupled to the image capture device 20 for providing auxiliary lighting for the sample WP to be tested.
[0030] The detection platform 10 is used to set the sample WP to be tested. In one embodiment, the detection platform 10 can be a simple setting platform for placing the sample WP to be tested for the image capture device 20 to shoot; in another embodiment, the detection platform 10 can be a vacuum adsorption platform for adsorbing the sample WP to be tested and leveling the sample WP to be tested, so that the image capture device 20 can shoot the leveled sample WP to be tested; in another embodiment, the detection platform 10 can be, for example, but not limited to, a linear stage, a conveyor belt, or a transfer device, by moving the sample WP to be tested into the shooting range of the image capture device 20 and shooting the sample WP to be tested. The changes of the above embodiments are not within the scope of the present invention.
[0031] The image capture device 20 is disposed on one side of the detection platform 10, and is used to photograph the sample WP to be tested on the detection platform 10 to obtain the image to be tested. In one embodiment, the image capture device 20 may be, for example, but not limited to, an area scan camera (Area Scan Camera) or a line scan camera (Line Scan Camera), which is not limited in the present invention. The sample WP to be tested may be any object, such as a panel, a circuit board or any workpiece, which is not limited in the present invention. In a preferred embodiment, the sample to be tested has a highly repeatable rough surface, such as wood texture, stone texture, water wave texture, leather texture, cloth texture, linen texture, scale texture, bark texture, or other similar workpieces with similar textures, which are not limited in the present invention.
[0032] The auxiliary light source device 30 is disposed on any side of the detection platform 10 to provide auxiliary lighting for the sample WP to be tested. In one embodiment, the auxiliary light source device 30 may be, for example, but not limited to providing a backlight source, an ambient light source, a ring light source, a side light source, a coaxial light source, or a parallel light source, etc., which are not limited in the present invention. Based on the spectrum difference of light, the auxiliary light source device 30 may be, for example, but not limited to, a white light source, a red light source, a green light source, a blue light source, an excitation light source, or other lighting light sources, which are not limited in the present invention.
[0033] The detection device 40 is connected or coupled to the image capture device 20, and after obtaining the image to be tested of the sample WP to be tested, the image to be tested is subjected to defect detection. In one embodiment, the detection device 40 is directly connected to the image capture device 20, and after the image capture device 20 photographs the sample WP to be tested and performs preprocessing, the image to be tested is directly transmitted to the detection device 40 via a physical line or wirelessly; in another embodiment, the image capture device 20 can be connected to a centralized image storage device (such as a server for storing images), and the detection device 40 is then connected to the centralized image storage device to access the image to be tested and then perform defect analysis, and the variations of the embodiments are not limited in the present invention.
[0034] In one embodiment, the detection device 40 includes a processor 41 and a storage unit 42 connected to the processor 41. The processor 41 can be used to load the storage unit 42 to execute the program stored in the storage unit 42. In another embodiment, the processor 41 and the storage unit 42 can together constitute a computer or processor, such as a personal computer, a workstation, a host computer or other types of computers or processors, and their types are not limited here. In one embodiment, the processor 41 can be coupled to the storage unit 42. The processor 41 is, for example, a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessors (Microprocessor), digital signal processors (Digital Signal Processor, DSP), programmable controllers, application-specific integrated circuits (Application Specific Integrated Circuits, ASIC), programmable logic devices (Programmable Logic Device, PLD) or other similar devices or combinations of these devices.
[0035] For detailed defect detection process, please refer to the following Figure 2 , which is a flow chart of the rough surface image processing method of the present invention. Regarding the steps of image processing, for the sake of clarity, it will be supplemented by Figures 3 to 5 The following are a schematic diagram of the image to be tested, a schematic diagram of the gradient mask, and a schematic diagram of image processing of the image to be tested (I). As shown in the figure: the rough surface image processing method disclosed in this embodiment mainly includes the following steps.
[0036] Step S01: Establish the gradient information of the image to be tested. Figure 3As shown, the gradient information refers to the grayscale gradient of the image GF to be tested. The grayscale gradient refers to the degree of change of the pixel value in a grayscale image. In one embodiment, the detection device 40 can use different gradient masks to establish the gradient information of the image GF to be tested. In one embodiment, two masks in the horizontal x direction and the vertical y direction are used to establish the gradient information. The mask is as shown in FIG. Figure 4 As shown, Figure 4 Gx in (a) is the horizontal gradient mask, Figure 4 Gy in (b) is the vertical gradient mask.
[0037] Next, step S02: the detection device iterates the mean filter on the image to be tested according to the gradient information. The gradient information is corrected by iterating the mean filter, so that the high-intensity gradient in the image GF to be tested is diffused. The "mean filter" is used to take the average value of the pixels around each pixel to replace the original pixel value, so that the gradient is diffused and the gradient in the image is further smoothed. The number of iterations of the mean filter depends on the state of the individual image (such as pixel accuracy, detail complexity, etc.), which is not limited in the present invention.
[0038] Next, step S03: randomly construct multiple point clouds on the image to be tested. The starting positions of the point clouds DC can be equidistantly arranged on the image to be tested GF (e.g. Figure 5 As shown), it can be configured according to the characteristics of the image GF to be tested (for example, it is preferentially set in the high gradient area in the image GF to be tested), or it can be configured uniformly according to the characteristics of the workpiece by an engineer or a computer, or in any other way, which is not limited in the present invention. The construction density of the point cloud DC mainly depends on the computing power of the system, and the distribution density of the point cloud DC is determined according to the computing performance; when the computing power is sufficient, in one embodiment, the point cloud DC is constructed on all the pixel coordinates of the image GF to be tested, that is, each pixel of the image GF to be tested corresponds to a point cloud DC, thereby improving the fineness of the detection.
[0039] Next, step S04: repeat the iteration of the point cloud. Specifically, after repeating the iteration of each point cloud DC, most of the point cloud DC will inertially move to the relatively low-potential gradient area in the image GF to be tested according to the speed and acceleration of the gradient information, so that most of the point cloud DC gather in the area that may be a defect (i.e., the defect candidate area).
[0040] Please also read Figure 6, is a flow chart of the iterative point cloud method of the present invention. As shown in the figure: in step S04, the method of "iterative point cloud" mainly includes the following steps: using the gradient information corresponding to each point cloud DC to calculate the speed, acceleration and tangent speed (step S41); using the speed, acceleration and tangent speed to update the position of each point cloud DC (step S42); and repeatedly executing the above method until the preset condition is met (step S43).
[0041] Specifically, assuming that each point cloud DC flows to the low-potential gradient area, in addition to velocity and acceleration, the vortex force generated in the tangent direction of the gradient vector must also be considered. Figures 7 and 8 The following are the image processing schematic diagram (I) and the image processing schematic diagram (II) of the image to be tested. First, Figure 7 As shown, each point cloud DC is updated and moved to the defect candidate position according to the following formula:
[0042] X(t+1)=X(t)+V(X(t))T+WT;
[0043] Among them, X(t) is the position of each point cloud DC at time t, X(t+1) is the position of each point cloud DC at time t+1, V(X(t)) is the velocity value of position X(t), W is the tangent velocity value, and T is the control parameter.
[0044] Among them, the formula for the velocity value V(X(t)) is:
[0045] V(X(t))=V0(X(t))+a(X(t))T;
[0046] Wherein, V0(X(t)) is the initial velocity of each point cloud DC moving to X(t), and A(X(t)) is the acceleration of each point cloud DC moving to X(t).
[0047] Among them, the tangent velocity value W is the normal vector of the velocity vector, that is, the inner product of the tangent velocity vector and the velocity vector is 0, and the velocity vector is The tangent velocity vector is expressed as If , the tangent velocity vector and velocity vector can be expressed as follows:
[0048]
[0049] Based on the above formula, the velocity vector Get the tangent velocity vector And the tangent velocity vector Get the tangential velocity value W.
[0050] Through the above method, after repeated iteration of point cloud DC, most point cloud DC will gradually move to the defect candidate position DF (such as Figure 8 As shown). In step S33, the "preset condition" that determines the number of iterations mainly depends on whether the point cloud DC can converge on the defect candidate position DF. In one embodiment, the user can pre-set the number of iterations based on test results or experience, so that when the number of iterations of the point cloud DC reaches the preset number of iterations, the iteration is stopped. Specifically, the user can first preset a higher number of iterations (for example, ten thousand times), and observe that the point cloud DC generally completes convergence after several iterations. After multiple tests (for example, multiple images GF of similar workpieces to be tested), a reasonable number of iterations can be obtained, and the reasonable number of iterations can be set as the preset condition; in another embodiment, the preset condition can be set, for example, to detect that the point cloud DC no longer moves after iteration or continues to surround a specific area, that is, the iteration process is stopped.
[0051] Next, step S05: filter out diffuse point clouds. The "diffuse point cloud DD" refers to a point cloud DC that is not clustered at a position with high gradient intensity. For example, a search radius can be set on the selected point cloud DC. When there is no point cloud from all directions within the search radius, it is determined to be a diffuse point cloud DD. The point cloud from all directions is defined as the direction of the initial position and the final iterative position, which is divided into four directions, which can be up, down, left, and right, but not limited to this. If the point cloud DC clusters all come from one direction, it will be identified as a diffuse point cloud DD, or when the number of other point cloud DCs around it is lower than the threshold, it will be determined to be a diffuse point cloud DC.
[0052] Finally, step S06: if the clustering density of the point cloud set at the defect candidate position exceeds the preset value, it is determined as a defect. Specifically, the density of the point cloud DC can be quantified to confirm the clustering density of the point cloud DC by comparing the quantified value with the threshold. In one embodiment, the clustering density of the point cloud DC can be evaluated by the ratio of the area of the point cloud DC set and the number it covers. In another embodiment, a search radius can be defined in the selected point cloud DC, and whether there is another point cloud DC in the search radius can be found, and other point cloud DCs can be found in the other point cloud DC through the search radius, and finally the point cloud DCs that can be found are calculated, and then the clustering density is evaluated by the number of point cloud DCs obtained. If the detected clustering density is greater than the preset value, the area covered by the adjacent point cloud DC set is determined to be a defect area.
[0053] In summary, the present invention can effectively solve the problem of over-detection when the sample to be tested has a rough surface texture, and reduce the false detection rate of defects. The present invention can obtain deep and small, shallow and large defects, so that such defects can be effectively found under the rough surface.
[0054] The present invention has been described in detail above. The above is only one preferred embodiment of the present invention and should not be used to limit the scope of the present invention. That is, all equivalent changes and modifications made according to the scope of the patent application of the present invention should still fall within the scope of the patent of the present invention.
Claims
1. A rough surface image processing method, characterized in that: The following steps are involved: Establish A gradient information of a test image; Iteratively applying a mean filter to the image to be tested according to the gradient information; Randomly constructing a plurality of point clouds on the image to be tested; Repeating the iteration of the plurality of point clouds and filtering out the diffuse point clouds; as well as A defect candidate position is selected, and when the aggregation density of the plurality of point cloud sets at the defect candidate position exceeds a preset value, the defect candidate position is determined to be a defect.
2. The rough surface image processing method according to claim 1, characterized in that: The gradient information of the image to be tested is established by using a gradient mask.
3. The rough surface image processing method according to claim 1, characterized in that: The plurality of point clouds are respectively constructed on all pixel coordinates of the image to be measured.
4. The rough surface image processing method according to claim 1, characterized in that: The method of repeatedly iterating a plurality of said point clouds comprises: Calculate a velocity, an acceleration and all linear velocities using the gradient information corresponding to each of the point clouds; updating the position of the point cloud using the velocity, the acceleration, and the tangential velocity; and The above steps are repeated until a preset condition is met.
5. The rough surface image processing method according to claim 4, characterized in that: The preset condition includes reaching a preset number of iterations or the point cloud converging on the defect candidate position.
6. The rough surface image processing method according to claim 1, characterized in that: Each of the point clouds is updated and moved to the defect candidate position according to the following formula: X(t+1)=X(t)+V(X(t))T+WT; Wherein, X(t) is the position of the point cloud at time t, X(t+1) is the position of the point cloud at time t+1, V(X(t)) is the velocity value of position X(t), W is the tangent velocity value, and T is the control parameter.
7. The rough surface image processing method according to claim 6, characterized in that: The formula of the speed value V(X(t)) is: V(X(t))=V0(X(t))+A(X(t))T; Wherein, V0(X(t)) is the initial velocity of the point cloud moving to X(t), and A(X(t)) is the acceleration of the point cloud moving to X(t).
8. The rough surface image processing method according to claim 6, characterized in that: The tangent velocity value W is obtained from the normal vector of the velocity vector.
9. An automatic optical inspection system, characterized in that: Include; A testing platform, used to set a sample to be tested; At least one image capture device, disposed on one side of the detection platform, for photographing the sample to be detected on the detection platform; as well as A detection device is connected to the at least one image capture device, and after the at least one image capture device obtains an image of the sample to be tested, the method according to any one of claims 1 to 8 is executed to complete defect detection.
10. The automatic optical inspection system according to claim 9, characterized in that: It also includes an auxiliary light source device arranged on any side of the detection platform, which is used to provide auxiliary lighting for the sample to be tested.
Citation Information
Cited By
Valve plate polishing and grinding surface recognition and detection method and system based on machine vision
CN119704046A
