CN-122016866-A - Circuit board production detection method, system and medium based on machine vision
Abstract
The invention relates to the technical field of machine vision, in particular to a circuit board production detection method, a system and a medium based on machine vision. The method comprises the steps of shooting a multi-angle image of a circuit board to be detected by using a preset shooting lens, determining a board surface reflection area according to the gray gradient difference condition of the multi-angle image, identifying a reflection interference area and a corresponding polarization direction based on the gray distribution condition of the board surface reflection area, adjusting the angle of a polarization filter at the front end of the shooting lens according to the polarization direction to acquire a full image of the circuit board again, optimizing the corresponding board surface reflection area in the multi-angle image by using the full image of the circuit board to obtain a multi-angle optimized image, performing color layering on the multi-angle optimized image to determine surface feature points of the circuit board, comparing the surface feature points of the circuit board by using a standard circuit board feature library, and generating a circuit board detection report. The invention is beneficial to improving the detection efficiency and the automation level and reducing the occurrence of false detection and missed detection.
Inventors
- JIN TAIYONG
- DENG FAMING
- LIU ZHAOPING
- CHEN YUFEN
Assignees
- 深圳凯鸿欣电子科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260108
Claims (10)
- 1. The machine vision-based circuit board production detection method is characterized by comprising the following steps of: step S1, shooting a multi-angle image of a circuit board to be detected by using a preset shooting lens, and determining a board surface reflection area according to the gray gradient difference condition of the multi-angle image; Step S2, based on the gray level distribution condition of the plate surface reflection area, identifying the reflection interference area and the corresponding polarization direction, and adjusting the angle of a polarization filter at the front end of the shooting lens according to the polarization direction so as to re-acquire the full image of the circuit board; Step S3, optimizing a corresponding plate surface reflection area in the multi-angle image by using the full image of the circuit board to obtain a multi-angle optimized image; S4, performing color layering on the multi-angle optimized image, and determining characteristic points of the surface of the circuit board according to a color layering result; And S5, comparing the surface characteristic points of the circuit board by using a preset standard circuit board characteristic library, and generating a circuit board detection report according to the comparison result.
- 2. The machine vision-based circuit board production inspection method according to claim 1, wherein the step S1 of capturing a multi-angle image of the circuit board to be inspected comprises: In response to detecting that the circuit board to be detected enters a preset detection station, acquiring images of the circuit board to be detected through industrial cameras fixed above and laterally of the detection station to obtain multi-angle images of the circuit board to be detected; the industrial camera is provided with an imaging shooting lens, and a polarized filter is arranged at a light outlet at the front end of the imaging shooting lens.
- 3. The machine vision-based circuit board production inspection method of claim 2, wherein the image acquisition of the circuit board to be inspected comprises: Controlling an industrial camera fixed above the detection station to shoot a front view angle image of the circuit board to be detected according to a 0-degree view angle perpendicular to the surface of the circuit board to be detected; controlling an industrial camera fixed at the lateral direction of the detection station to shoot an oblique view angle image of the circuit board to be detected according to a view angle forming an included angle of 30-60 degrees with the surface of the circuit board to be detected, and then shooting a low-angle oblique view angle image of the circuit board to be detected according to a view angle forming an included angle of 10-20 degrees with the surface of the circuit board to be detected; And performing image combination on the front view angle image, the oblique view angle image and the low-angle oblique view angle image, and taking the combination result as a multi-angle image of the circuit board to be detected.
- 4. The machine vision based wiring board production inspection method of claim 3, wherein performing image combining comprises: respectively extracting line trend vectors of the front view angle image, the oblique view angle image and the low-angle oblique view angle image, and calculating the line trend similarity of the image pair according to the line trend vectors of the images; Carrying out trend vector superposition on the line trend vectors of each image pair based on the line trend similarity of the image pairs, and establishing a line trend reference coordinate system according to the superimposed line trend combination vectors; And registering and combining the front view angle image, the oblique view angle image and the low-angle oblique view angle image by using a line trend reference coordinate system, and taking the combined result as a multi-angle image of the circuit board to be detected.
- 5. The machine vision-based circuit board production detection method according to claim 1, wherein determining the board surface reflection area according to the gray gradient difference condition of the multi-angle image in step S1 comprises: Calculating gray gradient values of each pixel point in the multi-angle image in the horizontal direction and the vertical direction, and counting average gradient values of the pixel points according to the gray gradient values in the horizontal direction and the vertical direction; Dividing the multi-angle image into a plurality of image areas according to the average gradient value of the pixel points; and comparing the gray gradient values of the image areas, and taking the adjacent pixel points as the plate surface reflection areas if the gray gradient values of the adjacent pixel points in the horizontal direction and the vertical direction are higher than the average gradient value of the corresponding image areas.
- 6. The machine vision-based circuit board production inspection method according to claim 1, wherein step S2 includes: Performing local gray average value calculation on pixel points in the panel reflection area, and taking the pixel points with local gray average value larger than the whole gray average value of the panel reflection area as a reflection interference area; controlling a polarizing filter at the front end of an imaging shooting lens of the industrial camera corresponding to the image shot by the imaging shooting lens, which comprises a plate surface reflection area, to execute angle rotation according to a preset stepping angle, and re-acquiring the image of the reflection interference area under different rotation angles; Counting the brightness attenuation rate of the image of the reflection interference area under each rotation angle, and taking the rotation angle as the corresponding polarization direction of the reflection interference area if the brightness attenuation rate under any rotation angle exceeds a preset brightness attenuation rate threshold; And according to the polarization direction, controlling the polarization filter at the front end of the imaging shooting lens to rotate to an angle position in an orthogonal relation with the polarization direction so as to acquire the full image of the circuit board again.
- 7. The machine vision-based circuit board production inspection method according to claim 1, wherein step S3 includes: taking pixels of an original reflection interference area in the full image of the circuit board as substitute pixels, and reversely projecting the substitute pixels to corresponding reflection interference areas in the multi-angle image according to visual angle information of an industrial camera for re-acquiring the full image of the circuit board; And according to the gray gradient difference condition of the substituted pixel and the adjacent pixel point in the reverse projection result, performing local interpolation smoothing on the substituted pixel to obtain the multi-angle optimized image.
- 8. The machine vision-based circuit board production detection method according to claim 1, wherein determining the circuit board surface feature points according to the color layering result in step S4 includes: Calculating the gray distribution peak value of the pixels in each channel according to the color layering result; Extracting bulk pixels with local gray average value higher than the whole gray average value [20%,40% ] and area smaller than [5 pixels, 50 pixels ] based on the gray distribution peak value, and calculating roundness of the bulk pixels, if the roundness of the bulk pixels is higher than 0.7 and overlaps with the reflection interference area, judging the bulk pixels as welding spot characteristic points; Identifying strip pixels with local gray average values lower than the whole gray average values [10%,20% ] and continuous lengths greater than [20 pixels, 50 pixels ] by using gray distribution peak values, and calculating the consistency of the communication length of the strip pixels with the local direction; Identifying a block pixel with a local gray average value higher than the whole gray average value [10%,30% ] and an area larger than [100 pixels, 500 pixels ] by using a gray distribution peak value, and calculating the aspect ratio and the edge gray gradient distribution of the block pixel; and taking the welding spot characteristic points, the circuit characteristic points and the element characteristic points as the surface characteristic points of the circuit board.
- 9. A machine vision-based wiring board production inspection system for performing the machine vision-based wiring board production inspection method of claim 1, the machine vision-based wiring board production inspection system comprising: The data acquisition module is used for shooting multi-angle images of the circuit board to be detected by utilizing a preset shooting lens; The angle characteristic module is used for identifying a reflection interference area and a corresponding polarization direction based on the gray distribution condition of the plate surface reflection area, and adjusting the angle of a polarization filter at the front end of the shooting lens according to the polarization direction so as to re-acquire the full image of the circuit board; the image optimization module is used for optimizing the corresponding plate surface reflection area in the multi-angle image by utilizing the full image of the circuit board to obtain a multi-angle optimized image; The characteristic point determining module is used for performing color layering on the multi-angle optimized image and determining characteristic points on the surface of the circuit board according to a color layering result; And the detection report generation module is used for comparing the surface characteristic points of the circuit board by using a preset standard circuit board characteristic library and generating a circuit board detection report according to the comparison result.
- 10. A computer-readable storage medium, on which a computer program is stored, which when executed implements the machine vision-based board production inspection method according to any one of claims 1 to 8.
Description
Circuit board production detection method, system and medium based on machine vision Technical Field The invention relates to the technical field of machine vision, in particular to a circuit board production detection method, a system and a medium based on machine vision. Background The circuit board (Printed Circuit Board, PCB) is used as a core base component of the electronic product, and the production process thereof has gradually evolved to the high density, high precision and miniaturization directions. The traditional circuit board detection mode mainly relies on manual visual inspection and optical microscope auxiliary observation to check welding quality, circuit connectivity and element positions one by one. The detection mode can meet the quality control requirements of low-productivity and low-integration products in an early production line, but the manual detection method has the defects of low efficiency and easiness in being influenced by experience and fatigue of operators in a modern large-scale automatic production environment. To improve the detection efficiency, the prior art gradually introduces detection means based on automatic optical detection (AOI, automatic Optical Inspection). The method generally collects images of the circuit board through a high-resolution camera, and identifies defects through image processing means such as template matching, gray scale contrast or edge extraction. However, the detection means are limited by rigidization of rule setting, and false detection and omission detection are easy to occur when the detection means face complex background and welding spot morphology differences. Disclosure of Invention Accordingly, the present invention is directed to a method, a system, and a medium for inspecting circuit board production based on machine vision, which solve at least one of the above-mentioned problems. In order to achieve the above purpose, a machine vision-based circuit board production detection method comprises the following steps: step S1, shooting a multi-angle image of a circuit board to be detected by using a preset shooting lens, and determining a board surface reflection area according to the gray gradient difference condition of the multi-angle image; Step S2, based on the gray level distribution condition of the plate surface reflection area, identifying the reflection interference area and the corresponding polarization direction, and adjusting the angle of a polarization filter at the front end of the shooting lens according to the polarization direction so as to re-acquire the full image of the circuit board; Step S3, optimizing a corresponding plate surface reflection area in the multi-angle image by using the full image of the circuit board to obtain a multi-angle optimized image; S4, performing color layering on the multi-angle optimized image, and determining characteristic points of the surface of the circuit board according to a color layering result; And S5, comparing the surface characteristic points of the circuit board by using a preset standard circuit board characteristic library, and generating a circuit board detection report according to the comparison result. The application realizes the pixel-level feature identification of the surface elements, welding spots and circuits of the circuit board by multi-angle image acquisition, multi-channel color layering, global texture distribution and local structure contour extraction and polarized filter adjustment and elimination of reflection interference, further establishes a standard feature library for feature information under various working conditions by pixel distribution curve statistics, feature stability analysis and grading threshold setting, and utilizes the library to accurately compare and judge defects of the circuit board to be detected. The method has the advantages that the interference of the reflection area and the highlight area of the panel is effectively restrained by combining multi-angle image acquisition with the adjustment of the polarizing filter, meanwhile, the overall layout and the accurate capture of micro features of the circuit board are realized by utilizing the overall texture distribution and the local structural contour analysis, the normal fluctuation and the real defects of the process can be distinguished by the stability analysis of pixel distribution curves and gray scale, area and morphological parameters, the recognition precision under the complex background and the local shielding is further improved by comprehensively judging multi-channel information and multi-parameter, the comparison is conducted by means of a standard feature library, the accurate distinction of the real defects and the process fluctuation is facilitated, the occurrence of false detection and omission detection is remarkably reduced, the detection reliability and stability are improved, the consistency and the reliability of the product quality are ensured, t