Electronic component detection method based on machine vision
Through the electronic component detection method based on machine vision, the feature quantity and similarity of component images are extracted, and the problem of uncomprehensive detection in the prior art is solved, and more accurate component defect identification and installation and welding quality control is achieved. Enhanced early warning capabilities and product reliability.
Patent Information
- Application Number
- CN202411183054.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-11-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The lack of detection of different parameters of the workflow of electronic components in the prior art leads to incomplete detection, which easily leads to erroneous welding, and lacks early warning and clarity of results.
Using electronic component detection method based on machine vision, the component images are collected for pre-processing, feature quantities are extracted, similarity is calculated, results are compared to send out early warning signals, and installation and welding operation instructions are processed to ensure the accuracy of detection. and clear display of results.
It improves the accuracy of detection and clarity of results, reduces misjudgment and misjudgment, enhances the early warning capability of the system, ensures the accurate installation and welding quality of components, and improves the reliability of the final product.
Smart Images

Figure CN119044195A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent detection, and in particular to an electronic component detection method based on machine vision. Background Art
[0002] In recent years, electronic component inspection technology has developed rapidly. Intelligent testing equipment is equipped with artificial intelligence and machine learning algorithms, which can automatically identify and analyze defects, reduce human errors and improve inspection efficiency. Advances in data analysis technology enable real-time processing and analysis of large amounts of data during electronic component inspection, thereby quickly identifying potential problems and trends.
[0003] At present, a Chinese invention patent with publication number CN 117741377A discloses a method for detecting electronic components. This method uses high-energy particles generated by a radiation source to verify the radiation resistance of the device. By comparing the linear relationship between the continuous working current of the drain of the device to be detected and the voltage change between the source and the drain, the device with unqualified radiation capacity can be effectively eliminated. However, the related technology does not detect different parameters of the component work process, lacks comprehensiveness of detection, easily causes incorrect welding, is not conducive to saving resources, does not provide early warning and display based on the detection results, and lacks clarity and intuitiveness of the result display. Summary of the invention
[0004] The technical problem solved by the present invention is: the related technology does not detect different parameters of the component workflow, lacks comprehensiveness of detection, easily causes incorrect welding, is not conducive to saving resources, does not provide early warning and display based on the detection results, and lacks clarity and intuitiveness of the result display.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: In the first aspect, a method for detecting electronic components based on machine vision comprises the following steps:
[0006] Step S1, collecting component barcodes, component dimensions and component images, and performing a first preprocessing on the component images;
[0007] Step S2, extracting a first feature quantity of the first preprocessed component image, obtaining a component defect image, extracting a second feature quantity of the component defect image, calculating a first similarity between the first feature quantity and the second feature quantity, comparing the first value with the first similarity to obtain a first comparison result, and issuing a first warning signal according to the first comparison result;
[0008] Step S3, presetting the installation center point coordinates, calculating the component center coordinates, comparing the component center coordinates with the installation center coordinates to obtain a second comparison result, and obtaining a second warning signal or installation operation instruction according to the second comparison result;
[0009] Step S4, receiving the installation operation instruction, setting the size of the cutting frame, cutting the first preprocessed component image to obtain a component sub-image, extracting a third feature quantity of the component sub-image, obtaining a weld hole defect image, extracting a fourth feature quantity of the weld hole defect image, calculating a second similarity between the third feature quantity and the fourth feature quantity, comparing the second value with the second similarity to obtain a third comparison result, and issuing a third warning signal or a welding operation instruction according to the third comparison result;
[0010] Step S5, receiving welding operation instructions, setting welding parameters, performing welding operations on components, and after the welding operation is completed, issuing a first detection signal, collecting component current within a first time period, calculating the deviation value of the component current, comparing the deviation value of the component current with the third value, obtaining a fourth comparison result, and issuing a fourth warning signal based on the fourth comparison result.
[0011] As a preferred solution of the electronic component detection method based on machine vision described in the present invention, step S1 includes the following sub-steps:
[0012] Step S11, collecting component barcodes, component dimensions and component images;
[0013] Step S12, performing a first preprocessing on the component image, wherein the first preprocessing includes a denoising process and a filtering process, and the filtering process is a mean filtering process.
[0014] The step S2 includes the following sub-steps:
[0015] Step S21, extracting a first feature quantity of the first preprocessed component image, wherein the first feature quantity includes cracks, bubbles, discoloration, and smoothness;
[0016] Step S22, scanning the component barcode, matching the corresponding component model in response to the scanning operation, calling the component database, inputting the component model into the component database, and obtaining the corresponding component defect picture, wherein the component defect picture includes a component crack picture, a component bubble picture, and a component discoloration picture;
[0017] Step S23, extracting a second feature quantity of the component defect image, the second feature quantity including cracks, bubbles and discoloration, and calculating a first similarity between the first feature quantity and the second feature quantity by using a cosine similarity formula;
[0018] Step S24, setting the standard similarity to a first value, comparing the first value with the first similarity to obtain a first comparison result, and issuing a first warning signal based on the first comparison result, wherein the first comparison result includes that all similarities are less than the first value, one of the similarities is greater than or equal to the first value, and one or more of the similarities is greater than or equal to the first value.
[0019] As a preferred solution of the electronic component detection method based on machine vision described in the present invention, when the first comparison result is that one of the first similarities is greater than or equal to a first value, a component defect corresponding to the first similarity greater than or equal to the first value is obtained, a first warning signal is issued, and the component defect corresponding to the first similarity greater than or equal to the first value is displayed;
[0020] When the first comparison result is that one or more of the first similarities are greater than or equal to the first value, sort the one or more first similarities greater than or equal to the first value in descending order to obtain the first similarity with the largest value, obtain the component defect corresponding to the first similarity with the largest value, issue a first warning signal, and display the component defect corresponding to the first similarity with the largest value;
[0021] Otherwise, the first warning signal is not issued.
[0022] As a preferred solution of the electronic component detection method based on machine vision described in the present invention, step S3 includes the following sub-steps:
[0023] Step S31, constructing a plane rectangular coordinate system with the lower left corner of the component as the origin, the length of the component as the X-axis, and the width of the component as the Y-axis, and presetting the installation center point coordinates, wherein the installation center point coordinates are two-dimensional coordinates;
[0024] Step S32, obtaining the coordinates of the component vertices and calculating the coordinates of the component center, wherein the component center is represented as the intersection of the perpendicular bisector of the component length and the perpendicular bisector of the component width;
[0025] Step S33, compare the component center coordinates with the installation center coordinates to obtain a second comparison result, wherein the second comparison result includes sameness and difference. When the second comparison result is same, an installation operation instruction is issued; when the second comparison result is different, a second warning signal is issued, and the difference between the component center coordinates and the installation center coordinates or the installation operation instruction is displayed on the OLED display.
[0026] As a preferred solution of the electronic component detection method based on machine vision described in the present invention, step S4 includes the following sub-steps:
[0027] Step S41, when an installation operation instruction is issued, receiving the installation operation instruction, and setting the size of the cutting frame, the size of the cutting frame includes the length of the cutting frame and the width of the cutting frame;
[0028] Step S42, cutting the first preprocessed component image to obtain component sub-images;
[0029] Step S42, extracting a third feature quantity of the component sub-image, the third feature quantity includes the shape of the welding hole and the area of the welding hole, obtaining a welding hole defect image, the welding hole defect includes a non-circular shape, an overly large area, and an underlying area, and extracting a fourth feature quantity of the welding hole defect image;
[0030] Step S43, calculating the second similarity between the third feature quantity and the fourth feature quantity by using the cosine similarity formula, comparing the second value with the second similarity, and obtaining a third comparison result, wherein the third comparison result includes that the second similarity is less than the second value, one of the second similarities is greater than or equal to the second value, and one or more of the second similarities is greater than or equal to the second value.
[0031] As a preferred embodiment of the electronic component detection method based on machine vision described in the present invention, when the third comparison result is that one of the second similarities is greater than or equal to the second value, the weld hole defect corresponding to the second similarity greater than or equal to the second value is obtained, a third warning signal is issued, and the weld hole defect corresponding to the second similarity greater than or equal to the second value is displayed;
[0032] When the third comparison result is that one or more of the second similarities are greater than or equal to the second value, the second similarities greater than or equal to the second value are sorted in descending order, the second similarities with the largest value are obtained, the weld hole defect corresponding to the second similarity with the largest value is obtained, a third warning signal is issued, and the weld hole defect corresponding to the second similarity with the largest value is displayed;
[0033] Otherwise, issue a welding operation instruction.
[0034] As a preferred solution of the electronic component detection method based on machine vision described in the present invention, step S5 includes the following sub-steps:
[0035] Step S51, when a welding operation instruction is issued, receiving the welding operation instruction and setting welding parameters, wherein the welding parameters include welding spot shape, welding spot material amount and welding time;
[0036] Step S52, performing a welding operation on the component, after the welding operation is completed, sending a first detection signal, and collecting the component current within a first time period;
[0037] Step S53, calculating the deviation value of the component current by using the standard deviation formula, wherein the calculation logic of the deviation value includes:
[0038] Calculating an average value of the component current, calculating a difference between the component current and the average value of the component current, recording the difference as a first difference, calculating a standard deviation of the component current according to the first difference, and recording the standard deviation as a deviation value;
[0039] Step S54, compare the deviation value of the component current with the third value to obtain a fourth comparison result, the fourth comparison result includes that the deviation value of the component current is less than the third value and that the deviation value of the component current is greater than or equal to the third value. When the fourth comparison result is that the deviation value of the component current is greater than or equal to the third value, a fourth warning signal is issued; otherwise, the fourth warning signal is not issued.
[0040] In a second aspect, the present invention provides an electronic device comprising a memory, a processor and storage in the memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in any one of the methods described above are executed.
[0041] In a third aspect, the present invention provides a storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps in any one of the methods described above are executed.
[0042] The beneficial effects of the present invention are as follows: by performing a first preprocessing and feature extraction on component images, it is beneficial to more accurately identify and analyze the defects and dimensions of components, thereby improving the accuracy of detection; by comparing the first similarity with the second similarity, defects can be more accurately identified, reducing the possibility of misjudgment and missed judgment; by setting different early warning signals, problems can be discovered and measures can be taken in time at different detection stages, thereby enhancing the early warning capability of the system; by issuing early warning signals based on similarity comparison results, potential problems can be responded to quickly, and the impact of faults on the production line can be reduced; by calculating the comparison results of the component center coordinates and the installation center point coordinates, it is verified whether the components are accurately installed, which is beneficial to avoiding subsequent problems caused by installation deviations; setting a cutting frame and extracting sub-image features improves the detection and processing speed; by comprehensively using machine vision technology and similarity comparison, defects of components can be detected more accurately, thereby improving the reliability of the final product quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of the basic flow of a method for detecting electronic components based on machine vision provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0045] Example 1, reference Figure 1 , as an embodiment of the present invention, provides an electronic component detection method based on machine vision, comprising the following steps:
[0046] Step S1, collecting component barcodes, component dimensions and component images, and performing a first preprocessing on the component images;
[0047] Step S2, extracting a first feature quantity of the first preprocessed component image, obtaining a component defect image, extracting a second feature quantity of the component defect image, calculating a first similarity between the first feature quantity and the second feature quantity, comparing the first value with the first similarity to obtain a first comparison result, and issuing a first warning signal according to the first comparison result;
[0048] Step S3, presetting the installation center point coordinates, calculating the component center coordinates, comparing the component center coordinates with the installation center coordinates to obtain a second comparison result, and obtaining a second warning signal or installation operation instruction according to the second comparison result;
[0049] Step S4, receiving the installation operation instruction, setting the size of the cutting frame, cutting the first preprocessed component image to obtain a component sub-image, extracting a third feature quantity of the component sub-image, obtaining a weld hole defect image, extracting a fourth feature quantity of the weld hole defect image, calculating a second similarity between the third feature quantity and the fourth feature quantity, comparing the second value with the second similarity to obtain a third comparison result, and issuing a third warning signal or a welding operation instruction according to the third comparison result;
[0050] Step S5, receiving welding operation instructions, setting welding parameters, performing welding operations on components, and after the welding operation is completed, issuing a first detection signal, collecting component current within a first time period, calculating the deviation value of the component current, comparing the deviation value of the component current with the third value, obtaining a fourth comparison result, and issuing a fourth warning signal based on the fourth comparison result.
[0051] The present invention performs a first preprocessing and feature extraction on component images, which is beneficial to more accurately identifying and analyzing defects and sizes of components, thereby improving the accuracy of detection. By comparing the first similarity and the second similarity, defects can be more accurately identified and the possibility of misjudgment and missed judgment can be reduced. By setting different early warning signals, problems can be discovered and measures can be taken in time at different detection stages, thereby enhancing the early warning capability of the system. Early warning signals are issued based on similarity comparison results, which can quickly respond to potential problems and reduce the impact of faults on production lines. By calculating the comparison results of component center coordinates and installation center point coordinates, it is verified whether the components are accurately installed, which is beneficial to avoiding subsequent problems caused by installation deviations. A cutting frame is set and sub-image features are extracted to improve the detection and processing speed. By comprehensively using machine vision technology and similarity comparison, defects of components can be detected more accurately, thereby improving the reliability of final product quality.
[0052] The step S1 includes the following sub-steps:
[0053] Step S11, collecting component barcodes, component dimensions and component images;
[0054] Step S12, performing a first preprocessing on the component image, wherein the first preprocessing includes a denoising process and a filtering process, and the filtering process is a mean filtering process.
[0055] In the specific implementation, preprocessing the data is conducive to the subsequent analysis of the data.
[0056] The step S2 includes the following sub-steps:
[0057] Step S21, extracting a first feature quantity of the first preprocessed component image, wherein the first feature quantity includes cracks, bubbles, discoloration, and smoothness;
[0058] Step S22, scanning the component barcode, matching the corresponding component model in response to the scanning operation, calling the component database, inputting the component model into the component database, and obtaining the corresponding component defect picture, wherein the component defect picture includes a component crack picture, a component bubble picture, and a component discoloration picture;
[0059] Step S23, extracting a second feature quantity of the component defect image, the second feature quantity including cracks, bubbles and discoloration, and calculating a first similarity between the first feature quantity and the second feature quantity by using a cosine similarity formula;
[0060] Step S24, setting the standard similarity to a first value, comparing the first value with the first similarity to obtain a first comparison result, and issuing a first warning signal based on the first comparison result, wherein the first comparison result includes that all similarities are less than the first value, one of the similarities is greater than or equal to the first value, and one or more of the similarities is greater than or equal to the first value.
[0061] When the first comparison result is that one of the first similarities is greater than or equal to the first value, obtaining component defects corresponding to the first similarities greater than or equal to the first value, issuing a first warning signal, and displaying the component defects corresponding to the first similarities greater than or equal to the first value;
[0062] When the first comparison result is that one or more of the first similarities are greater than or equal to the first value, sort the one or more first similarities greater than or equal to the first value in descending order to obtain the first similarity with the largest value, obtain the component defect corresponding to the first similarity with the largest value, issue a first warning signal, and display the component defect corresponding to the first similarity with the largest value;
[0063] Otherwise, the first warning signal is not issued.
[0064] In a specific implementation, by performing a first preprocessing and feature extraction on the component image, it is helpful to more accurately identify and analyze the defects and dimensions of the components, thereby improving the accuracy of detection. By comparing the first similarity and the second similarity, defects can be identified more accurately and the possibility of misjudgment and missed judgment can be reduced.
[0065] The step S3 includes the following sub-steps:
[0066] Step S31, constructing a plane rectangular coordinate system with the lower left corner of the component as the origin, the length of the component as the X-axis, and the width of the component as the Y-axis, and presetting the installation center point coordinates, wherein the installation center point coordinates are two-dimensional coordinates;
[0067] Step S32, obtaining the coordinates of the component vertices and calculating the coordinates of the component center, wherein the component center is represented as the intersection of the perpendicular bisector of the component length and the perpendicular bisector of the component width;
[0068] Step S33, compare the component center coordinates with the installation center coordinates to obtain a second comparison result, wherein the second comparison result includes sameness and difference. When the second comparison result is same, an installation operation instruction is issued; when the second comparison result is different, a second warning signal is issued, and the difference between the component center coordinates and the installation center coordinates or the installation operation instruction is displayed on the OLED display.
[0069] In specific implementation, by calculating the comparison results between the center coordinates of the components and the coordinates of the installation center points, it is verified whether the components are accurately installed, which is helpful to avoid subsequent problems caused by installation deviations.
[0070] The step S4 includes the following sub-steps:
[0071] Step S41, when an installation operation instruction is issued, receiving the installation operation instruction, and setting the size of the cutting frame, the size of the cutting frame includes the length of the cutting frame and the width of the cutting frame;
[0072] Step S42, cutting the first preprocessed component image to obtain component sub-images;
[0073] Step S42, extracting a third feature quantity of the component sub-image, the third feature quantity includes the shape of the welding hole and the area of the welding hole, obtaining a welding hole defect image, the welding hole defect includes a non-circular shape, an overly large area, and an underlying area, and extracting a fourth feature quantity of the welding hole defect image;
[0074] Step S43, calculating the second similarity between the third feature quantity and the fourth feature quantity by using the cosine similarity formula, comparing the second value with the second similarity, and obtaining a third comparison result, wherein the third comparison result includes that the second similarity is less than the second value, one of the second similarities is greater than or equal to the second value, and one or more of the second similarities is greater than or equal to the second value.
[0075] When the third comparison result is that one of the second similarities is greater than or equal to the second value, the weld hole defect corresponding to the second similarity greater than or equal to the second value is obtained, a third warning signal is issued, and the weld hole defect corresponding to the second similarity greater than or equal to the second value is displayed;
[0076] When the third comparison result is that one or more of the second similarities are greater than or equal to the second value, the second similarities greater than or equal to the second value are sorted in descending order, the second similarities with the largest value are obtained, the weld hole defect corresponding to the second similarity with the largest value is obtained, a third warning signal is issued, and the weld hole defect corresponding to the second similarity with the largest value is displayed;
[0077] Otherwise, issue a welding operation instruction.
[0078] In the specific implementation, a cutting frame is set and sub-image features are extracted to improve the detection and processing speed.
[0079] The step S5 comprises the following sub-steps:
[0080] Step S51, when a welding operation instruction is issued, receiving the welding operation instruction and setting welding parameters, wherein the welding parameters include welding spot shape, welding spot material amount and welding time;
[0081] Step S52, performing a welding operation on the component, after the welding operation is completed, sending a first detection signal, and collecting the component current within a first time period;
[0082] Step S53, calculating the deviation value of the component current by using the standard deviation formula, wherein the calculation logic of the deviation value includes:
[0083] Calculating an average value of the component current, calculating a difference between the component current and the average value of the component current, recording the difference as a first difference, calculating a standard deviation of the component current according to the first difference, and recording the standard deviation as a deviation value;
[0084] Step S54, compare the deviation value of the component current with the third value to obtain a fourth comparison result, the fourth comparison result includes that the deviation value of the component current is less than the third value and that the deviation value of the component current is greater than or equal to the third value. When the fourth comparison result is that the deviation value of the component current is greater than or equal to the third value, a fourth warning signal is issued; otherwise, the fourth warning signal is not issued.
[0085] In the specific implementation, by setting different early warning signals, problems can be discovered and measures can be taken in time at different detection stages, thus enhancing the system's early warning capability.
[0086] The present invention performs a first preprocessing and feature extraction on component images, which is beneficial to more accurately identifying and analyzing defects and sizes of components, thereby improving the accuracy of detection. By comparing the first similarity and the second similarity, defects can be more accurately identified and the possibility of misjudgment and missed judgment can be reduced. By setting different early warning signals, problems can be discovered and measures can be taken in time at different detection stages, thereby enhancing the early warning capability of the system. Early warning signals are issued based on similarity comparison results, which can quickly respond to potential problems and reduce the impact of faults on production lines. By calculating the comparison results of component center coordinates and installation center point coordinates, it is verified whether the components are accurately installed, which is beneficial to avoiding subsequent problems caused by installation deviations. A cutting frame is set and sub-image features are extracted to improve the detection and processing speed. By comprehensively using machine vision technology and similarity comparison, defects of components can be detected more accurately, thereby improving the reliability of final product quality.
[0087] It should be understood by those skilled in the art that the embodiments of the present invention can be provided as methods, systems or computer program products. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or optical disk. These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0088] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. An electronic component detection method based on machine vision, characterized in that: The following steps are involved: Step S1, collecting component barcodes, component dimensions and component images, and performing a first preprocessing on the component images; Step S2, extracting a first feature quantity of the first preprocessed component image, obtaining a component defect image, extracting a second feature quantity of the component defect image, calculating a first similarity between the first feature quantity and the second feature quantity, comparing the first value with the first similarity to obtain a first comparison result, and issuing a first warning signal according to the first comparison result; Step S3, presetting the installation center point coordinates, calculating the component center coordinates, comparing the component center coordinates with the installation center coordinates to obtain a second comparison result, and obtaining a second warning signal or installation operation instruction according to the second comparison result; Step S4, receiving the installation operation instruction, setting the size of the cutting frame, cutting the first preprocessed component image to obtain a component sub-image, extracting a third feature quantity of the component sub-image, obtaining a weld hole defect image, extracting a fourth feature quantity of the weld hole defect image, calculating a second similarity between the third feature quantity and the fourth feature quantity, comparing the second value with the second similarity to obtain a third comparison result, and issuing a third warning signal or a welding operation instruction according to the third comparison result; Step S5, receiving welding operation instructions, setting welding parameters, performing welding operations on components, and after the welding operation is completed, issuing a first detection signal, collecting component current within a first time period, calculating the deviation value of the component current, comparing the deviation value of the component current with the third value, obtaining a fourth comparison result, and issuing a fourth warning signal based on the fourth comparison result.
2. The method for detecting electronic components based on machine vision according to claim 1, characterized in that: The step S1 includes the following sub-steps: Step S11, collecting component barcodes, component dimensions and component images; Step S12, performing a first preprocessing on the component image, wherein the first preprocessing includes a denoising process and a filtering process, and the filtering process is a mean filtering process.
3. The electronic component detection method based on machine vision according to claim 1, characterized in that: The step S2 includes the following sub-steps: Step S21, extracting a first feature quantity of the first preprocessed component image, wherein the first feature quantity includes cracks, bubbles, discoloration, and smoothness; Step S22, scanning the component barcode, matching the corresponding component model in response to the scanning operation, calling the component database, inputting the component model into the component database, and obtaining the corresponding component defect picture, wherein the component defect picture includes a component crack picture, a component bubble picture, and a component discoloration picture; Step S23, extracting a second feature quantity of the component defect image, the second feature quantity including cracks, bubbles and discoloration, and calculating a first similarity between the first feature quantity and the second feature quantity by using a cosine similarity formula; Step S24, setting the standard similarity to a first value, comparing the first value with the first similarity to obtain a first comparison result, and issuing a first warning signal based on the first comparison result, wherein the first comparison result includes that all similarities are less than the first value, one of the similarities is greater than or equal to the first value, and one or more of the similarities is greater than or equal to the first value.
4. The electronic component detection method based on machine vision according to claim 3, characterized in that: When the first comparison result is that one of the first similarities is greater than or equal to the first value, obtaining component defects corresponding to the first similarities greater than or equal to the first value, issuing a first warning signal, and displaying the component defects corresponding to the first similarities greater than or equal to the first value; When the first comparison result is that one or more of the first similarities are greater than or equal to the first value, sort the one or more first similarities greater than or equal to the first value in descending order to obtain the first similarity with the largest value, obtain the component defect corresponding to the first similarity with the largest value, issue a first warning signal, and display the component defect corresponding to the first similarity with the largest value; Otherwise, the first warning signal is not issued.
5. The electronic component detection method based on machine vision according to claim 1, characterized in that: The step S3 includes the following sub-steps: Step S31, constructing a plane rectangular coordinate system with the lower left corner of the component as the origin, the length of the component as the X-axis, and the width of the component as the Y-axis, and presetting the installation center point coordinates, wherein the installation center point coordinates are two-dimensional coordinates; Step S32, obtaining the coordinates of the component vertices and calculating the coordinates of the component center, wherein the component center is represented as the intersection of the perpendicular bisector of the component length and the perpendicular bisector of the component width; Step S33, compare the component center coordinates with the installation center coordinates to obtain a second comparison result, wherein the second comparison result includes sameness and difference. When the second comparison result is same, an installation operation instruction is issued; when the second comparison result is different, a second warning signal is issued, and the difference between the component center coordinates and the installation center coordinates or the installation operation instruction is displayed on the OLED display.
6. The electronic component detection method based on machine vision according to claim 1, characterized in that: The step S4 includes the following sub-steps: Step S41, when an installation operation instruction is issued, receiving the installation operation instruction, and setting the size of the cutting frame, the size of the cutting frame includes the length of the cutting frame and the width of the cutting frame; Step S42, cutting the first preprocessed component image to obtain component sub-images; Step S42, extracting a third feature quantity of the component sub-image, the third feature quantity includes the shape of the welding hole and the area of the welding hole, obtaining a welding hole defect image, the welding hole defect includes a non-circular shape, an overly large area, and an underlying area, and extracting a fourth feature quantity of the welding hole defect image; Step S43, calculating the second similarity between the third feature quantity and the fourth feature quantity by using the cosine similarity formula, comparing the second value with the second similarity, and obtaining a third comparison result, wherein the third comparison result includes that the second similarity is less than the second value, one of the second similarities is greater than or equal to the second value, and one or more of the second similarities is greater than or equal to the second value.
7. The electronic component detection method based on machine vision according to claim 6, characterized in that: When the third comparison result is that one of the second similarities is greater than or equal to the second value, the weld hole defect corresponding to the second similarity greater than or equal to the second value is obtained, a third warning signal is issued, and the weld hole defect corresponding to the second similarity greater than or equal to the second value is displayed; When the third comparison result is that one or more of the second similarities are greater than or equal to the second value, the second similarities greater than or equal to the second value are sorted in descending order, the second similarities with the largest value are obtained, the weld hole defect corresponding to the second similarity with the largest value is obtained, a third warning signal is issued, and the weld hole defect corresponding to the second similarity with the largest value is displayed; Otherwise, a welding operation instruction is issued.
8. The electronic component detection method based on machine vision according to claim 1, characterized in that: The step S5 includes the following sub-steps: Step S51, when a welding operation instruction is issued, receiving the welding operation instruction and setting welding parameters, wherein the welding parameters include welding spot shape, welding spot material amount and welding time; Step S52, performing a welding operation on the component, after the welding operation is completed, sending a first detection signal, and collecting the component current within a first time period; Step S53, calculating the deviation value of the component current by using the standard deviation formula, wherein the calculation logic of the deviation value includes: Calculating an average value of the component current, calculating a difference between the component current and the average value of the component current, recording the difference as a first difference, calculating a standard deviation of the component current according to the first difference, and recording the standard deviation as a deviation value; Step S54, compare the deviation value of the component current with the third value to obtain a fourth comparison result, the fourth comparison result includes that the deviation value of the component current is less than the third value and that the deviation value of the component current is greater than or equal to the third value. When the fourth comparison result is that the deviation value of the component current is greater than or equal to the third value, a fourth warning signal is issued; otherwise, the fourth warning signal is not issued.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the electronic component detection method based on machine vision according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the electronic component detection method based on machine vision according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
PCB defect detection method and system based on image data
CN117333441A
Intelligent automatic processing method and device in PCB circuit quality inspection
CN117825931A
Circuit board component defect detection method and device, terminal and storage medium
CN117871545A
Depth feature combined sensor packaging process defect detection device and method
CN118096774A
Smart decision feedback device and method for inspecting circuit board
US20200225279A1
