Method, device and electronic equipment for detecting wrong components of electronic components on PCB

By detecting the matching scores of the screen printing information of electronic components and the key screen printing information on the PCB board, the problem of inefficient manual detection is solved and efficient and accurate detection of error parts is achieved.

CN116109851BActive Publication Date: 2025-09-02CHINA GRIDCOM +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310151634.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-09
Publication Date
2025-09-02
Estimated Expiration
2043-02-09

AI Technical Summary

Technical Problem

In the prior art, the detection of error parts of electronic components on PCB boards relies on manual detection, which is inefficient, has high cost, and has high missed detection and error detection rates.

Method used

By obtaining the silkscreen information of the electronic component, matching with the key silkscreen information generates a matching character string, and calculating the matching score based on the matching character string and template silkscreen information to determine whether the electronic component is wrong.

Benefits of technology

The efficiency of error-based detection is improved, the missed detection rate and error-based detection rate are reduced, and more accurate error-based determination is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116109851B_ABST
    Figure CN116109851B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, and electronic device for detecting incorrect components of electronic components on a PCB board. The method comprises: obtaining silk screen information of the electronic component; matching the silk screen information with key silk screen information to generate a matching string, wherein the key silk screen information is fixed silk screen information of the electronic component; determining a matching score based on the matching string and template silk screen information, wherein the template silk screen information is silk screen information obtained by matching a template image of the electronic component with the key silk screen information; and detecting whether the electronic component is incorrect based on the matching score. The method matches the silk screen information of the electronic component with the key silk screen information to obtain a matching string, and detects whether the electronic component is incorrect based on the matching score generated by the matching string and the template silk screen information. This method achieves the determination of incorrect components of the electronic component, improves detection efficiency, and reduces missed detection rate and false detection rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of circuit boards, and in particular to a method, device, and electronic equipment for detecting mismatched electronic components on a PCB. Background Art

[0002] PCB (Printed Circuit Board) is a major component of electronic products, and its quality determines the quality of these products. As the quality of electronic products improves, the production process standards for component installation on PCBs also improve. When installing electronic components on a PCB, it is necessary to determine whether the components are correctly installed. The silkscreen information of the components is an important reference for whether the components are correctly installed, which can assist in the detection of component errors. Electronic components are divided into those with silkscreen and those without silkscreen. The silkscreen of components mainly includes the logo, name, other information (such as structure), batch number, production date (or factory date), place of origin and pin information. Among them, the name and model are fixed silkscreen.

[0003] In the inspection of electronic components, most of the time, manual inspection is done to check whether the components are wrong. Manual inspection mainly detects whether the components are correct based on the key information of the silk screen (i.e., fixed silk screen information). However, manual inspection is inefficient, costly, and has high missed detection and false detection rates. Summary of the Invention

[0004] The present invention aims to at least partially address one of the technical problems in the related art. To this end, a first object of the present invention is to provide a method for detecting incorrect electronic components on a PCB. The method matches the silkscreen information of the electronic component with key silkscreen information to obtain a matching string. The method then detects whether the electronic component is incorrect based on a matching score generated between the matching string and the template silkscreen information. This method enables the determination of incorrect electronic components, improves detection efficiency, and reduces both missed detection and false detection rates.

[0005] A second object of the present invention is to provide a computer-readable storage medium.

[0006] A third object of the present invention is to provide an electronic device.

[0007] A fourth object of the present invention is to provide a device for detecting mismatched electronic components on a PCB.

[0008] To achieve the above-mentioned purpose, according to an embodiment of the first aspect of the present invention, a method for detecting wrong parts of electronic components on a PCB board is proposed, comprising: obtaining silk screen information of the electronic component; matching the silk screen information with key silk screen information to generate a matching string, wherein the key silk screen information is fixed silk screen information of the electronic component; determining a matching score based on the matching string and the template silk screen information, wherein the template silk screen information is silk screen information obtained by matching the template image of the electronic component with the key silk screen information; and detecting whether the electronic component is wrong based on the matching score.

[0009] According to the method for detecting wrong parts of electronic components on a PCB board according to an embodiment of the present invention, the silk screen information of the electronic component is obtained, and the silk screen information is matched with the key silk screen information to generate a matching string, wherein the key silk screen information is the fixed silk screen information of the electronic component, and a matching score is determined based on the matching string and the template silk screen information, wherein the template silk screen information is the silk screen information obtained after matching the template image of the electronic component with the key silk screen information, and whether the electronic component is wrong is detected based on the matching score. Thus, by matching the silk screen information of the electronic component with the key silk screen information, the fixed silk screen information of the electronic component is screened out, and then a matching score is obtained based on the fixed silk screen information of the electronic component and the template silk screen information, and whether the electronic component is wrong is detected based on the matching score, thereby realizing the determination of wrong parts of the electronic component, improving the detection efficiency, and reducing the missed detection rate and the false detection rate.

[0010] According to one embodiment of the present invention, silk screen information is matched with key silk screen information to generate a matching string, including: obtaining silk screen characters and position information corresponding to the silk screen characters based on the silk screen information; sorting the silk screen characters in coordinate order based on the position information to generate an initial character table; when it is determined that there is a character between any two adjacent silk screen characters based on the position information of the two adjacent silk screen characters in the initial character table, replacing the character between the two adjacent silk screen characters with a preset special character to generate a target character table, wherein the special character matches any character; and searching the target character table for a string that matches the key silk screen information to obtain a matching string.

[0011] According to one embodiment of the present invention, a matching score is determined based on a matching string and template silk screen information, including: determining a first ratio of matching characters in the matching string, wherein the matching characters are characters other than special characters in the matching string; determining a position deviation based on position information of the matching characters and position information of the matching characters in the template silk screen information; determining an angle deviation based on an angle of the matching string and silk screen angle information of the matching string in the template silk screen information; counting a target number of matching characters within a predetermined range of a best matching position of a target character table, and determining a second ratio of the target number to the number of non-matching characters within a predetermined range of the best matching position in the template silk screen information, wherein the best matching position is determined by searching the target character table for a character string that matches key silk screen information; and determining a matching score based on the first ratio, the position deviation, the angle deviation, and the second ratio.

[0012] According to one embodiment of the present invention, counting a target number of matching characters within a predetermined range of a best matching position includes: starting at the best matching position, looking forward at a first predetermined number of characters, and counting a first number of matching characters in the first predetermined number of characters; starting at the best matching position, looking backward at a second predetermined number of characters, and counting a second number of matching characters in the second predetermined number of characters; and adding the first number and the second number to obtain a target number.

[0013] According to one embodiment of the present invention, the matching score is calculated according to the following formula: p = a*p KeyString +b*p pos +c*p θ +d*p OthersString , where a is the first weight, b is the second weight, c is the third weight, d is the fourth weight, and p KeyString is the first ratio, p pos is the position deviation, p θ is the angular deviation, p OthersString is the second ratio.

[0014] According to one embodiment of the present invention, determining the presence of characters between any two adjacent silk-screen characters based on position information of any two adjacent silk-screen characters in an initial character table includes: determining the presence of characters between any two adjacent silk-screen characters when the difference between the horizontal coordinates of any two adjacent silk-screen characters is greater than the width of any two adjacent silk-screen characters, or when the difference between the vertical coordinates of any two adjacent silk-screen characters is greater than the length of any two adjacent silk-screen characters.

[0015] According to an embodiment of the present invention, after searching the target character table for a character string that matches the key silk screen information, the method further includes: if no character string that matches the key silk screen information is found, determining that a faulty electronic component occurs.

[0016] According to an embodiment of the present invention, detecting whether an electronic component is a wrong component based on a matching score includes: determining that the electronic component is a wrong component when the matching score is less than or equal to a preset score threshold.

[0017] According to one embodiment of the present invention, the template silk screen information is obtained according to the following steps: obtaining a template image; performing character detection on the template image to obtain silk screen angle information, position information and silk screen character information; matching the silk screen character information with the key silk screen information to obtain matching character information and non-matching character information. The silk screen angle information, position information, matching character information and non-matching character information constitute the template silk screen information.

[0018] To achieve the above-mentioned purpose, according to an embodiment of the second aspect of the present invention, a computer-readable storage medium is proposed, on which a program for detecting wrong parts of electronic components on a PCB is stored. When the method for detecting wrong parts of electronic components on a PCB is executed by a processor, the method for detecting wrong parts of electronic components on a PCB according to any of the aforementioned embodiments is implemented.

[0019] According to the computer-readable storage medium of an embodiment of the present invention, by executing the computer program for detecting wrong parts of electronic components on the above-mentioned PCB board, the silk screen information of the electronic component is matched with the key silk screen information to obtain a matching string, and the matching score generated by the matching string and the template silk screen information is used to detect whether the electronic component is wrong. This realizes the determination of wrong parts of the electronic component, improves the detection efficiency, and reduces the missed detection rate and the false detection rate.

[0020] To achieve the above-mentioned purpose, an electronic device is proposed according to an embodiment of the third aspect of the present invention, comprising: a memory, a processor, and a program for detecting wrong parts of electronic components on a PCB board stored in the memory and runnable on the processor. When the processor executes the program, a method for detecting wrong parts of electronic components on a PCB board according to any of the aforementioned embodiments is implemented.

[0021] According to the electronic device of the embodiment of the present invention, the processor executes the computer program for detecting wrong parts of electronic components on the above-mentioned PCB board, matches the silk screen information of the electronic component with the key silk screen information to obtain a matching string, and detects whether the electronic component is wrong based on the matching score generated by the matching string and the template silk screen information, thereby realizing the determination of wrong parts of the electronic component, improving the detection efficiency, and reducing the missed detection rate and the false detection rate.

[0022] To achieve the above-mentioned purpose, according to the fourth aspect embodiment of the present invention, a wrong component detection device for electronic components on a PCB board is proposed, including: an acquisition module for acquiring the silk screen information of the electronic component; a matching module for matching the silk screen information with the key silk screen information to generate a matching string, wherein the key silk screen information includes the model and name of the electronic component; a first determination module for determining a matching score based on the matching string and the template silk screen information, wherein the template silk screen information is the silk screen information obtained after matching the template image of the electronic component with the key silk screen information; a detection module for detecting whether the electronic component is wrong based on the matching score.

[0023] According to the device for detecting wrong parts of electronic components on a PCB board according to an embodiment of the present invention, the silk screen information of the electronic component is obtained by an acquisition module, and the silk screen information is matched with the key silk screen information by a matching module to generate a matching string, wherein the key silk screen information is the fixed silk screen information of the electronic component, and a matching score is determined by a first determination module based on the matching string and the template silk screen information, wherein the template silk screen information is the silk screen information obtained by matching the template image of the electronic component with the key silk screen information, and the detection module detects whether the electronic component is wrong based on the matching score. Thus, by matching the silk screen information of the electronic component with the key silk screen information, the fixed silk screen information of the electronic component is screened out, and then a matching score is obtained based on the fixed silk screen information of the electronic component and the template silk screen information, and whether the electronic component is wrong based on the matching score, it is possible to determine whether the electronic component is wrong, thereby improving the detection efficiency and reducing the missed detection rate and the false detection rate.

[0024] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 1 is a flow chart of a method for detecting an electronic component error on a PCB according to a first embodiment of the present invention;

[0026] Figure 2 1 is a flow chart of a method for detecting an electronic component error on a PCB according to a second embodiment of the present invention;

[0027] Figure 3 1 is a flow chart of a method for detecting wrong electronic components on a PCB according to a third embodiment of the present invention;

[0028] Figure 4 1 is a flow chart of a method for detecting an electronic component error on a PCB according to a fourth embodiment of the present invention;

[0029] Figure 5is a system diagram of an electronic device according to an embodiment of the present invention;

[0030] Figure 6 The figure is a schematic structural diagram of a device for detecting electronic components on a PCB according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.

[0032] The following describes a method, device, storage medium, and electronic device for detecting electronic components on a PCB board according to embodiments of the present invention with reference to the accompanying drawings.

[0033] Figure 1 1 is a flow chart of a method for detecting wrong components of electronic components on a PCB according to a first embodiment of the present invention.

[0034] like Figure 1 As shown, the method for detecting wrong components of electronic components on a PCB includes the following steps:

[0035] S101, obtaining silk screen information of electronic components.

[0036] Specifically, an image of a PCB board on which electronic components are installed is first obtained, and then the silk screen information of the electronic components is obtained through a silk screen detection algorithm. The silk screen information includes the angle information, position information and silk screen characters of the silk screen, wherein the position information includes the coordinate information of the upper left corner of the character and the length information and width information of the character.

[0037] S102 : Match the silk screen information with key silk screen information to generate a matching string, wherein the key silk screen information is fixed silk screen information of the electronic component.

[0038] Specifically, the key silk screen information is the fixed silk screen information of the electronic component, such as the model and name of the electronic component. The silk screen characters include name, model, batch number and production date (or factory date). The changing silk screen characters of the electronic component include batch number and production date. The fixed silk screen characters include model and name. The changing silk screen characters of the electronic component have little effect on the error detection of the electronic component. The error detection is mainly performed through the fixed silk screen characters. Therefore, by matching the silk screen information with the key silk screen information, the fixed silk screen characters are filtered out from the silk screen information to generate a matching string.

[0039] It should be noted that the key silk screen information can be set according to the actual situation of the electronic components.

[0040] In some embodiments, as Figure 2 As shown, the silk screen information is matched with the key silk screen information to generate a matching string, including:

[0041] S201, obtaining silk-screen characters and position information corresponding to the silk-screen characters according to silk-screen information.

[0042] It is understandable that the silk-screen information includes silk-screen angle information, position information and silk-screen characters. Therefore, the silk-screen characters and position information corresponding to the silk-screen characters can be obtained through the silk-screen information.

[0043] S202 , sorting the silk-screen characters in order of coordinate size according to the position information to generate an initial character table.

[0044] That is, the silk-screen characters are sorted in order of magnitude of the horizontal coordinates and the vertical coordinates according to the coordinate information of the upper left corner of the silk-screen characters to generate an initial character table.

[0045] S203, when it is determined that there is a character between any two adjacent silk-screen characters according to the position information of the two adjacent silk-screen characters in the initial character table, replacing the character between the two adjacent silk-screen characters with a preset special character to generate a target character table, wherein the special character matches any character.

[0046] Specifically, any two adjacent silk-screen characters are selected in the initial character table, and whether there is a character between the two adjacent silk-screen characters is determined based on the position information of the any two adjacent silk-screen characters. When there is a character between the two adjacent silk-screen characters, the character between the two adjacent silk-screen characters is replaced with a preset special character to supplement the characters in the initial character table, so as to avoid the problem that the silk-screen characters are not detected during silk-screen character detection, resulting in inaccurate error detection algorithm.

[0047] In some embodiments, determining that there is a character between two adjacent silk-screen characters based on position information of any two adjacent silk-screen characters in an initial character table includes: determining that there is a character between two adjacent silk-screen characters when the difference between the horizontal coordinates of any two adjacent silk-screen characters is greater than the width of any two adjacent silk-screen characters, or when the difference between the vertical coordinates of any two adjacent silk-screen characters is greater than the length of any two adjacent silk-screen characters.

[0048] For example, the coordinates of the first silk-screen character are (1, 1), the coordinates of the second silk-screen character are (4, 1), and the coordinates of the third silk-screen character are (1, 4). The lengths and widths of the first, second, and third silk-screen characters are all 2 mm. The first and second silk-screen characters are adjacent characters in the first row, and the first, second, and third silk-screen characters are adjacent characters in the first column. The difference between the horizontal coordinates of the first and second silk-screen characters is 3 mm, which is greater than the width of the first and second silk-screen characters (2 mm). Therefore, there is a character between the first and second silk-screen characters. The difference between the vertical coordinates of the first and third silk-screen characters is 3 mm, which is greater than the length of the first and second silk-screen characters (2 mm). Therefore, there is a character between the first and third silk-screen characters.

[0049] In an optional embodiment, a first ratio between the difference between the horizontal coordinates of any two adjacent silk-screened characters and the widths of the two adjacent silk-screened characters is calculated, or a second ratio between the difference between the vertical coordinates of any two adjacent silk-screened characters and the lengths of the two adjacent silk-screened characters is calculated, and the first ratio or the second ratio is rounded to obtain the number of characters between the two adjacent silk-screened characters.

[0050] S204: searching the target character table for a character string that matches the key silk-screen information to obtain a matching character string.

[0051] Specifically, each character in the key silk screen information is matched with the target character table. Special characters can be matched with any characters. Only when the characters and sequence of the string completely match the key silk screen information, is it considered that a matching string is found.

[0052] For example, if the key silk screen information is abcd and the special character is 1, then a1cd, 11cd, or 1b1d matches the key silk screen information, but aacd and dcba do not match the key silk screen information.

[0053] In the above embodiment, it is estimated whether there is a character between the two adjacent silk-screen characters based on the coordinates of the two adjacent silk-screen characters, and the character between the two adjacent characters is replaced by a special character to avoid the problem that the silk-screen characters are not detected during silk-screen character detection, resulting in an inaccurate error detection algorithm.

[0054] In some embodiments, after searching the target character table for a character string that matches the key silk screen information, the method further includes: if no character string that matches the key silk screen information is found, determining that a faulty electronic component occurs.

[0055] That is, if a character string that completely matches the key silk screen information cannot be found in the target character table, it means that the model and name of the electronic component are different from the model and name of the correct electronic component, and the electronic component is a wrong part.

[0056] S103 , determining a matching score according to the matching character string and the template silk screen information, wherein the template silk screen information is silk screen information obtained by matching the template image of the electronic component with the key silk screen information.

[0057] Specifically, the deviation between the matching string and the template silk screen information is calculated according to the silk screen information of the matching string and the template silk screen information to obtain a matching score.

[0058] In some embodiments, as Figure 3 As shown, the matching score is determined based on the matching string and template silkscreen information, including:

[0059] S301 : Determine a first ratio of matching characters in a matching string, wherein the matching characters are characters other than special characters in the matching string.

[0060] That is to say, calculate the proportion of matching characters in the matching string and get the first ratio p KeyString For example, the key silk screen information is abcd, if the matching string is a1cd, then the first ratio p KeyString is 3 / 4; if the matching string is 11cd, then the first ratio p KeyString is 2 / 4; if the matching string is 1111, then the first ratio p KeyString is 0.

[0061] S302: Determine a position deviation based on the position information of the matching characters and the position information of the matching characters in the template silk-screen information.

[0062] Specifically, the position deviation p of each matching character and the corresponding matching character in the template silk screen information is calculated according to formula (1): pos , and then according to the position deviation p of each matching character pos Calculate the position deviation:

[0063]

[0064] Among them, x tpl 、y tpl is the position information of the matching characters in the template silk screen information, w tpl 、h tpl The width and height of the characters in the template silk screen information are matched, x ins 、y ins The position information of the matched characters.

[0065] S303: Determine the angle deviation according to the angle of the matching character string and the silk screen angle information of the matching character string in the template silk screen information.

[0066] Specifically, the angle deviation p of the matching string angle and the matching string angle information in the template silk screen information is calculated according to formula (2): θ :

[0067]

[0068] Among them, θ tpl is the silk screen angle information (expressed in degrees), θ ins To match the angle of the string (expressed in °), % is the remainder.

[0069] S304, counting a target number of matching characters within a predetermined range of a best matching position in the target character table, and determining a second ratio of the target number to the number of non-matching characters within the predetermined range of the best matching position in the template silk screen information, wherein the best matching position is determined by searching the target character table for a character string that matches the key silk screen information.

[0070] Specifically, when searching for a character string that matches the key silk screen information from the target character table, the best matching position is determined in the target character table, and then the target number of matching characters within a predetermined range of the best matching position is found, and a second ratio p of the target number to the number of non-matching characters within the predetermined range of the best matching position in the template silk screen information is calculated. OthersString .

[0071] It should be noted that the predetermined range is determined by matching the template image of the electronic component with the key silk screen information.

[0072] In some embodiments, counting a target number of matching characters within a predetermined range of the best matching position includes: starting at the best matching position, looking forward at a first predetermined number of characters, and counting a first number of matching characters in the first predetermined number of characters; starting at the best matching position, looking backward at a second predetermined number of characters, and counting a second number of matching characters in the second predetermined number of characters; and adding the first number and the second number to obtain the target number.

[0073] For example, starting from the best matching position, look forward 5 characters, count the first number of matching characters in these 5 characters, and look backward 4 characters, count the second number of matching characters in these 4 characters, and then add the first number and the second number to obtain the target number.

[0074] It should be noted that the number of non-matching characters within the predetermined range of the best matching position in the template silk-screen information is also counted using the above method.

[0075] S305: Determine a matching score according to the first ratio, the position deviation, the angle deviation, and the second ratio.

[0076] In some embodiments, the match score is calculated according to the following formula:

[0077] p=a*p KeyString +b*p pos +c*p θ +d*p OthersString

[0078] Among them, a is the first weight, b is the second weight, c is the third weight, d is the fourth weight, p KeyString is the first ratio, p pos is the position deviation, p θ is the angular deviation, p OthersString is the second ratio.

[0079] It should be noted that the first weight a, the second weight b, the third weight c and the fourth weight d can be set according to actual conditions. In this embodiment, a=0.9, b=0.1, c=0.1, d=0.1.

[0080] In the above embodiment, the silk screen position information, angle deviation and non-critical silk screen information are used as auxiliary information to calculate the matching score, so that the wrong part detection result is more accurate.

[0081] S104: Detect whether the electronic component is wrong based on the matching score.

[0082] Specifically, the template silk-screen information is the silk-screen information of the correct electronic component, and the matching score is the degree of matching between the matching string of the electronic component and the template silk-screen information. Therefore, the matching score can reflect the degree of matching between the electronic component and the correct electronic component, so whether the electronic component is a wrong part can be detected based on the matching score.

[0083] In some embodiments, detecting whether an electronic component is a wrong component based on the matching score includes: determining that the electronic component is a wrong component when the matching score is less than or equal to a preset score threshold.

[0084] It can be understood that when the matching score is less than or equal to the preset score threshold, it indicates that the electronic component has a low matching degree with the correct electronic component, and therefore, it is determined that the electronic component is a wrong component.

[0085] In the above embodiment, the silk screen information of the electronic component is matched with the key silk screen information to obtain a matching string, and the matching score generated by the matching string and the template silk screen information is used to detect whether the electronic component is a wrong part, thereby realizing the determination of the wrong part of the electronic component, improving the detection efficiency, and reducing the missed detection rate and the false detection rate.

[0086] In some embodiments, the template silk screen information is obtained according to the following steps: obtaining a template image; performing character detection on the template image to obtain silk screen angle information, position information and silk screen character information; matching the silk screen character information with the key silk screen information to obtain matching character information and non-matching character information. The silk screen angle information, position information, matching character information and non-matching character information constitute the template silk screen information.

[0087] It should be noted that the matching method of the silk screen character information and the key silk screen information is the same as the matching method of the silk screen information and the key silk screen information described above, and will not be described in detail here.

[0088] The technical solution of this application will be further described in detail below in conjunction with specific implementation methods:

[0089] like Figure 4 As shown, the method for detecting wrong components of electronic components on a PCB includes the following steps:

[0090] S401, obtaining a template image and silk screen key information of an electronic component.

[0091] S402: Perform character detection on the template image to obtain silk screen angle information, position information, and silk screen character information.

[0092] S403 , matching the silk screen character information with the key silk screen information to obtain the template silk screen information, where the template silk screen information includes silk screen angle information, position information, matching character information, and non-matching character information.

[0093] S404: Acquire an image of a PCB board on which electronic components are mounted.

[0094] S405 , performing character detection on the image of the PCB board using a silk screen detection algorithm to obtain silk screen information, which includes silk screen angle information, position information, and silk screen characters.

[0095] S406, matching the silk screen characters with the key silk screen information.

[0096] S407, determine whether the silk-screen characters have a matching string that matches the key silk-screen characters. If the silk-screen characters have a matching string that matches the key silk-screen characters, execute step S408; if the silk-screen characters do not have a matching string that matches the key silk-screen characters, execute step S411.

[0097] S408, calculating a matching score based on the matching string and the template silk screen information. Calculating the matching score based on the matching string and the template silk screen information includes: determining a first ratio of matching characters in the matching string; determining a position deviation based on the position information of the matching characters and the position information of the matching characters in the template silk screen information; determining an angle deviation based on the angle of the matching string and the silk screen angle information of the matching string in the template silk screen information; counting a target number of matching characters within a predetermined range of the best matching position of the target character table, and determining a second ratio of the target number to the number of non-matching characters within the predetermined range of the best matching position in the template silk screen information; and determining a matching score based on the first ratio, the position deviation, the angle deviation, and the second ratio.

[0098] S409, determining whether the matching score is greater than a preset score threshold. If the matching score is greater than the preset score threshold, executing step S410; if the matching score is less than or equal to the preset score threshold, executing step S411.

[0099] S410, determining that there is no faulty electronic component.

[0100] S411, determining that a faulty electronic component occurs.

[0101] In the above embodiment, the template silk screen information is generated by detecting and matching the template image, and then the silk screen characters of the resistor element are matched with the key silk screen information, and the fixed silk screen characters in the silk screen characters are screened out to obtain a matching string. The matching score is calculated based on the matching string and the template silk screen information. The matching score can reflect the degree of matching between the electronic component and the correct electronic component, thereby realizing the determination of wrong electronic components, improving the detection efficiency, and reducing the missed detection rate and the false detection rate.

[0102] In summary, according to the method for detecting wrong parts of electronic components on a PCB board according to an embodiment of the present invention, by matching the silk screen information of the electronic component with the key silk screen information, the fixed silk screen information of the electronic component is screened out, and then a matching score is obtained based on the fixed silk screen information of the electronic component and the template silk screen information. The electronic component is detected based on the matching score to determine whether it is a wrong part, thereby realizing the determination of the wrong part of the electronic component, improving the detection efficiency, and reducing the missed detection rate and the false detection rate; and, based on the coordinates of two adjacent silk screen characters, it is estimated whether there is a character between the two adjacent characters, and a special character is used to replace the character between the two adjacent characters to avoid the problem that the silk screen characters are not detected during the silk screen character detection, resulting in an inaccurate wrong part detection algorithm. In addition, the silk screen position information, angle deviation and non-critical silk screen information are used as auxiliary information to calculate the matching score, so that the wrong part detection result is more accurate.

[0103] Corresponding to the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, on which a program for detecting wrong parts of electronic components on a PCB board is stored. When the method for detecting wrong parts of electronic components on a PCB board is executed by a processor, the method for detecting wrong parts of electronic components on a PCB board of any of the above embodiments is implemented.

[0104] According to the computer-readable storage medium of an embodiment of the present invention, by executing the computer program for detecting wrong parts of electronic components on the above-mentioned PCB board, the silk screen information of the electronic component is matched with the key silk screen information to obtain a matching string, and the matching score generated by the matching string and the template silk screen information is used to detect whether the electronic component is wrong. This realizes the determination of wrong parts of the electronic component, improves the detection efficiency, and reduces the missed detection rate and the false detection rate.

[0105] Corresponding to the above embodiment, an embodiment of the present invention further provides an electronic device. Figure 5 As shown, the electronic device 100 includes: a memory 110, a processor 120, and a program for detecting electronic components on a PCB board that is stored in the memory 110 and can be run on the processor 120. When the processor 120 executes the program, the method for detecting electronic components on a PCB board in any of the aforementioned embodiments is implemented.

[0106] According to the electronic device of the embodiment of the present invention, the processor executes the computer program for detecting wrong parts of electronic components on the above-mentioned PCB board, matches the silk screen information of the electronic component with the key silk screen information to obtain a matching string, and detects whether the electronic component is wrong based on the matching score generated by the matching string and the template silk screen information, thereby realizing the determination of wrong parts of the electronic component, improving the detection efficiency, and reducing the missed detection rate and the false detection rate.

[0107] Corresponding to the above embodiment, an embodiment of the present invention further provides a device for detecting wrong components of electronic components on a PCB. Figure 6 As shown, the device for detecting wrong components of electronic components on a PCB board includes: an acquisition module 10 , a matching module 20 , a first determination module 30 and a detection module 40 .

[0108] Among them, the acquisition module 10 is used to obtain the silk screen information of the electronic component; the matching module 20 is used to match the silk screen information with the key silk screen information to generate a matching string, wherein the key silk screen information includes the model and name of the electronic component; the first determination module 30 is used to determine the matching score based on the matching string and the template silk screen information, wherein the template silk screen information is the silk screen information obtained after matching the template image of the electronic component with the key silk screen information; the detection module 40 is used to detect whether the electronic component is wrong based on the matching score.

[0109] In some embodiments, the matching module 20 is also used to: obtain silk-screen characters and position information corresponding to the silk-screen characters based on the silk-screen information; sort the silk-screen characters in order of coordinate size based on the position information to generate an initial character table; when it is determined that there are characters between any two adjacent silk-screen characters based on the position information of any two adjacent silk-screen characters in the initial character table, replace the characters between the two adjacent silk-screen characters with preset special characters to generate a target character table, wherein the special characters match any characters; search the target character table for a character string that matches the key silk-screen information to obtain a matching character string.

[0110] In some embodiments, the first determination module 30 is also used to: determine a first ratio of matching characters in a matching string, wherein the matching characters are characters other than special characters in the matching string; determine a position deviation based on position information of the matching characters and position information of the matching characters in the template silk screen information; determine an angle deviation based on the angle of the matching string and the silk screen angle information of the matching string in the template silk screen information; count a target number of matching characters within a predetermined range of the best matching position of the target character table, and determine a second ratio of the target number to the number of non-matching characters within a predetermined range of the best matching position in the template silk screen information, wherein the best matching position is determined by searching the target character table for a character string that matches the key silk screen information; and determine a matching score based on the first ratio, the position deviation, the angle deviation, and the second ratio.

[0111] In some embodiments, the first determination module 30 is also used to: use the best matching position as the starting position, look forward to a first predetermined number of characters, and count a first number of matching characters in the first predetermined number of characters; use the best matching position as the starting position, look backward to a second predetermined number of characters, and count a second number of matching characters in the second predetermined number of characters; add the first number and the second number to obtain the target number.

[0112] In some embodiments, the match score is calculated according to the following formula:

[0113] p=a*p KeyString +b*p pos +c*p θ +d*p OthersString

[0114] Among them, a is the first weight, b is the second weight, c is the third weight, d is the fourth weight, p KeyString is the first ratio, p pos is the position deviation, p θ is the angular deviation, p OthersString is the second ratio.

[0115] In some embodiments, the matching module 20 is also used to determine that there are characters between two adjacent silk-screened characters when the difference between the horizontal coordinates of any two adjacent silk-screened characters is greater than the width of any two adjacent silk-screened characters, or when the difference between the vertical coordinates of any two adjacent silk-screened characters is greater than the length of any two adjacent silk-screened characters.

[0116] In some embodiments, the device further includes a second determination module (not shown), which is configured to search the target character table for a character string that matches the key silk screen information, and determine that a faulty electronic component occurs if no character string that matches the key silk screen information is found.

[0117] In some embodiments, the detection module 40 is configured to determine that a faulty electronic component occurs when the matching score is less than or equal to a preset score threshold.

[0118] In some embodiments, the template silk screen information is obtained according to the following steps: obtaining a template image; performing character detection on the template image to obtain silk screen angle information, position information and silk screen character information; matching the silk screen character information with the key silk screen information to obtain matching character information and non-matching character information. The silk screen angle information, position information, matching character information and non-matching character information constitute the template silk screen information.

[0119] It should be noted that the specific implementation of the device for detecting electronic components on a PCB board in an embodiment of the present invention corresponds one-to-one to the specific implementation of the method for detecting electronic components on a PCB board in the aforementioned embodiment of the present invention, and will not be repeated here.

[0120] According to the device for detecting wrong parts of electronic components on a PCB board according to an embodiment of the present invention, the silk screen information of the electronic component is matched with the key silk screen information to screen out the fixed silk screen information of the electronic component. Then, a matching score is obtained based on the fixed silk screen information of the electronic component and the template silk screen information. Whether the electronic component is wrong is detected based on the matching score, thereby realizing the determination of wrong parts of the electronic component, improving the detection efficiency, and reducing the missed detection rate and the false detection rate.

[0121] It should be noted that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wires (electronic device), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.

[0122] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0123] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0124] In addition, the terms "first" and "second" used in the embodiments of the present invention are only used for descriptive purposes and should not be understood as indicating or implying relative importance, or implicitly indicating the number of technical features indicated in this embodiment. Therefore, the features defined by the terms "first" and "second" in the embodiments of the present invention can explicitly or implicitly indicate that the embodiment includes at least one of such features. In the description of the present invention, the word "plurality" means at least two or two or more, such as two, three, four, etc., unless otherwise clearly and specifically defined in the embodiments.

[0125] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A method for detecting wrong components of electronic components on a PCB, characterized in that: include: Obtaining silk screen information of the electronic component; Matching the silk screen information with key silk screen information to generate a matching string, wherein the key silk screen information is fixed silk screen information of the electronic component; determining a matching score based on the matching character string and the template silk screen information, wherein the template silk screen information is silk screen information obtained by matching the template image of the electronic component with the key silk screen information; detecting whether the electronic component is a wrong component according to the matching score; Match the silk screen information with the key silk screen information to generate a matching string, including: According to the silk-screen information, obtaining silk-screen characters and position information corresponding to the silk-screen characters; Sort the silk-screen characters in order of coordinate size according to the position information to generate an initial character table; When it is determined that there is a character between any two adjacent silk-screen characters in the initial character table based on position information of the two adjacent silk-screen characters, replacing the character between the two adjacent silk-screen characters with a preset special character to generate a target character table, wherein the special character matches any character; Searching the target character table for a character string that matches the key silk-screen information to obtain the matching character string; Determining a matching score based on the matching character string and the template silk screen information includes: determining a first ratio of matching characters in the matching string, wherein the matching characters are characters in the matching string excluding the special characters; Determining a position deviation based on the position information of the matching characters and the position information of the matching characters in the template silk-screen information; Determining an angle deviation according to the angle of the matching character string and the silk screen angle information of the matching character string in the template silk screen information; counting a target number of matching characters within a predetermined range of a best matching position in the target character table, and determining a second ratio of the target number to a number of non-matching characters within the predetermined range of the best matching position in the template silk screen information, wherein the best matching position is determined by searching the target character table for a character string that matches the key silk screen information; The matching score is determined based on the first ratio, the position deviation, the angle deviation, and the second ratio.

2. The method according to claim 1, characterized in that Counting the target number of matching characters within a predetermined range of the best matching position includes: Taking the best matching position as a starting position, searching forward a first predetermined number of characters, and counting a first number of matching characters in the first predetermined number of characters; Starting from the best matching position, searching backward for a second predetermined number of characters, and counting a second number of matching characters in the second predetermined number of characters; The target quantity is obtained by adding the first quantity and the second quantity.

3. The method according to claim 1, characterized in that The matching score is calculated according to the following formula: p=a*p KeyString +b*p pos +c*p θ +d*p OthersString Among them, a is the first weight, b is the second weight, c is the third weight, d is the fourth weight, p KeyString is the first ratio, p pos is the position deviation, p θ is the angular deviation, p OthersString is the second ratio.

4. The method according to claim 1, wherein Determining the existence of characters between any two adjacent silk-screen characters according to position information of any two adjacent silk-screen characters in the initial character table includes: When the difference between the horizontal coordinates of any two adjacent silk-screen characters is greater than the width of any two adjacent silk-screen characters, or the difference between the vertical coordinates of any two adjacent silk-screen characters is greater than the length of any two adjacent silk-screen characters, it is determined that there is a character between the two adjacent silk-screen characters.

5. The method according to claim 1, wherein After searching the target character table for a character string that matches the key silk screen information, the method further includes: If no character string matching the key silk-screen information is found, it is determined that the electronic component is a faulty component.

6. The method according to claim 1, wherein Detecting whether the electronic component is a wrong component according to the matching score includes: When the matching score is less than or equal to a preset score threshold, it is determined that the electronic component is faulty.

7. The method according to claim 1, characterized in that The template silk screen information is obtained according to the following steps: Acquire the template image; Performing character detection on the template image to obtain silk screen angle information, position information and silk screen character information; The silk screen character information is matched with the key silk screen information to obtain matching character information and non-matching character information. The silk screen angle information, the position information, the matching character information and the non-matching character information constitute the template silk screen information.

8. A computer-readable storage medium, characterized in that A wrong component detection program for electronic components on a PCB is stored thereon, and when the wrong component detection method for electronic components on a PCB is executed by a processor, the wrong component detection method for electronic components on a PCB according to any one of claims 1-7 is implemented.

9. An electronic device, characterized in that: include: A memory, a processor, and a program for detecting wrong parts of electronic components on a PCB board stored in the memory and runnable on the processor. When the processor executes the program, a method for detecting wrong parts of electronic components on a PCB board according to any one of claims 1 to 7 is implemented.

10. A device for detecting wrong components of electronic components on a PCB, characterized in that: include: An acquisition module, used for acquiring silk screen information of the electronic component; a matching module, configured to match the silk screen information with key silk screen information to generate a matching string, wherein the key silk screen information includes the model and name of the electronic component; a first determining module, configured to determine a matching score based on the matching character string and template silk screen information, wherein the template silk screen information is silk screen information obtained by matching the template image of the electronic component with the key silk screen information; A detection module, configured to detect whether the electronic component is a wrong component based on the matching score; The matching module is further configured to: obtain, based on the silk-screen information, silk-screen characters and position information corresponding to the silk-screen characters; sort the silk-screen characters in order of coordinate size based on the position information to generate an initial character table; when it is determined based on the position information of any two adjacent silk-screen characters in the initial character table that there is a character between the two adjacent silk-screen characters, replace the character between the two adjacent silk-screen characters with a preset special character to generate a target character table, wherein the special character matches any character; and search the target character table for a character string that matches the key silk-screen information to obtain a matching character string; The first determination module is further used to: determine a first ratio of matching characters in a matching string, wherein the matching characters are characters other than special characters in the matching string; determine a position deviation based on position information of the matching characters and position information of the matching characters in the template silk-screen information; determine an angle deviation based on an angle of the matching string and silk-screen angle information of the matching string in the template silk-screen information; count a target number of matching characters within a predetermined range of a best matching position of a target character table, and determine a second ratio of the target number to the number of non-matching characters within a predetermined range of a best matching position in the template silk-screen information, wherein the best matching position is determined by searching the target character table for a character string that matches the key silk-screen information; and determine a matching score based on the first ratio, the position deviation, the angle deviation, and the second ratio.

Citation Information

Patent Citations

  • Method for automatically making impedance test file, electronic equipment and storage medium

    CN112946365A

  • Character defect detection method, system and device and storage medium

    CN113111868A