CN114429442A - Method for determining polarity state of capacitor - Google Patents
Method for determining polarity state of capacitor Download PDFInfo
- Publication number
- CN114429442A CN114429442A CN202011176462.0A CN202011176462A CN114429442A CN 114429442 A CN114429442 A CN 114429442A CN 202011176462 A CN202011176462 A CN 202011176462A CN 114429442 A CN114429442 A CN 114429442A
- Authority
- CN
- China
- Prior art keywords
- capacitor
- edge coordinate
- polarity state
- coordinate point
- slope
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 239000003990 capacitor Substances 0.000 title claims abstract description 172
- 238000000034 method Methods 0.000 title claims abstract description 57
- 238000013461 design Methods 0.000 claims abstract description 17
- 239000007787 solid Substances 0.000 claims description 39
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 239000011159 matrix material Substances 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 10
- 238000004364 calculation method Methods 0.000 description 4
- 230000010339 dilation Effects 0.000 description 4
- 230000007613 environmental effect Effects 0.000 description 4
- 230000003628 erosive effect Effects 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 4
- 238000007781 pre-processing Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000001514 detection method Methods 0.000 description 3
- 230000000877 morphologic effect Effects 0.000 description 3
- 238000005286 illumination Methods 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 230000010287 polarization Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/001—Industrial image inspection using an image reference approach
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/12—Edge-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/181—Segmentation; Edge detection involving edge growing; involving edge linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20036—Morphological image processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30141—Printed circuit board [PCB]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Image Processing (AREA)
Abstract
A method for determining the polarity state of a capacitor, comprising: the method comprises the steps of obtaining an entity circuit board image, comparing the entity circuit board image with a circuit board design drawing file to obtain an entity capacitor image, obtaining a plurality of edge coordinate points in the entity capacitor image, wherein the edge coordinate points are arranged along the periphery of a closed pattern, the number of the edge coordinate points is n, n is at least three, calculating the total amount of a slope distance by a formula, and judging and outputting the polarity state of a capacitor related to the closed pattern according to the total amount of the slope distance.
Description
Technical Field
The present invention relates to a method for determining a polarity state of an electronic component, and more particularly, to a method for determining a polarity state of a capacitor using image recognition.
Background
When manufacturing circuit boards such as computer motherboards and development boards in factories, various electronic components are combined on a substrate, and regardless of manual or automatic placement of the electronic components, the electronic components may have positive and negative polarities and wrong pin directions. Known methods for checking for errors are, for example, manual checking, attaching a voltage or current detector to a part of the electronic components or a part of the circuit board and measuring whether the measured value thereof corresponds to a factory set value. However, the above-described inspection method is too time-consuming and tends to make the entire circuit board manufacturing process inefficient. At present, the image recognition technology can also be used for auxiliary inspection, after the image of the electronic component containing the circuit board is obtained, whether the electronic component has the pin dislocation condition is judged according to the processed image.
However, due to various environmental factors that cannot be precisely controlled, such as the illumination direction, the lens angle of the image capturing device, and the shielding of the neighboring elements, the image containing the electronic element is too distorted or cannot be determined after being pre-processed and converted, or the position of the electronic element to be detected on the circuit board cannot be identified, so that an error detection (undersell) or an over-judgment (over-kill) phenomenon occasionally occurs by using the image identification method, where the error detection means that the pin position of the electronic element is not detected, and the over-judgment means that the pin position of the electronic element is correct and is determined to be reverse.
Disclosure of Invention
In view of the above, the present invention provides a method for determining the polarity state of a capacitor, which can effectively determine the polarity state of the capacitor even if the environment for acquiring the capacitor image is not good.
A method for determining a polarity state of a capacitor according to a first embodiment of the present invention includes: obtaining a solid circuit board image; comparing the solid circuit board image with a circuit board design drawing file to obtain a solid capacitor image; obtaining a plurality of edge coordinate points in the physical capacitor image, wherein the edge coordinate points are arranged along the periphery of a closed pattern, the number of the edge coordinate points is n, and n is at least three; calculating a total slope distance by the following equation:
(ii) a And determining and outputting a polarity state of a capacitor associated with the closed pattern according to the slope distance total, wherein W is the slope distance total, d (i, i +1) is a distance between an i-th edge coordinate point and an i + 1-th edge coordinate point among the plurality of edge coordinate points, s (i, i +1) is a slope of a connection line between the i-th edge coordinate point and the i + 1-th edge coordinate point, d (n,1) is a distance between an n-th edge coordinate point and a first edge coordinate point among the plurality of edge coordinate points, and s (n,1) is a slope of a connection line between the n-th edge coordinate point and the first edge coordinate point.
A method for determining a polarity state of a capacitor according to a second embodiment of the present invention includes: obtaining a solid circuit board image; comparing the solid circuit board image with a circuit board design drawing file to obtain a solid capacitor image; obtaining a closed pattern in the physical capacitor image, and obtaining an arch pattern based on the closed pattern, wherein the arch pattern and the closed pattern are at least partially overlapped; generating a first determined polarity state of a capacitor associated with the closed pattern based on the arcuate pattern; judging whether the initial judgment polarity state is the same as a preset polarity state; when the initial judgment polarity state is the same as the preset polarity state, outputting the initial judgment polarity state; when the initial judgment polarity state is different from the preset polarity state, obtaining a plurality of edge coordinate points positioned at the periphery of the closed pattern, calculating a total slope distance amount according to the distance between every two adjacent edge coordinate points of the edge coordinate points and the slope of a connecting line, and generating a secondary judgment polarity state related to the capacitor according to the total slope distance amount; judging whether the judging polarity state is the same as the preset polarity state; and outputting the polarity-covering state when the polarity-covering state is the same as the preset polarity state.
The invention is described in detail below with reference to the drawings and specific examples, but the invention is not limited thereto.
Drawings
Fig. 1 is a flowchart of a method for determining a polarity state of a capacitor according to a first embodiment of the present invention.
Fig. 2 is a perspective view of a capacitor suitable for use in the method for determining the polarity state of the capacitor according to the first embodiment of the present invention.
Fig. 3A is a schematic diagram of a physical capacitor image obtained by the method for determining a polarity state of a capacitor according to the first embodiment of the invention.
Fig. 3B is a schematic diagram of binarizing an image in a selected range by the method for determining the polarity of a capacitor according to the first embodiment of the present invention.
Fig. 3C is a schematic diagram of a physical capacitance image obtained by another embodiment of the method for determining a polarity state of a capacitor according to the first embodiment of the invention.
Fig. 3D is a schematic diagram of a plurality of edge coordinate points and connecting lines therebetween in the method for determining the polarity state of the capacitor according to the first embodiment of the invention.
Fig. 4 is another schematic diagram of a plurality of edge coordinate points and connecting lines therebetween in the capacitor polarity state determination method according to the first embodiment of the invention.
Fig. 5A is a schematic diagram of another physical capacitor image obtained by the method for determining a polarity state of a capacitor according to the first embodiment of the invention.
Fig. 5B is a schematic diagram of the method for determining the polarity state of the capacitor according to the first embodiment of the present invention for binarizing an image in another selected range.
Fig. 5C is a schematic diagram of another physical capacitance image obtained by another embodiment of the method for determining a polarity state of a capacitor according to the first embodiment of the invention.
Fig. 5D is a schematic diagram of a plurality of edge coordinate points and connecting lines therebetween in the method for determining the polarity state of the capacitor according to the first embodiment of the invention.
Fig. 6 is a detailed flowchart of determining the polarity state based on the total amount of slope distance in the method for determining the polarity state of the capacitor according to the first embodiment of the present invention.
Fig. 7 is another detailed flowchart of determining the polarity state based on the total amount of slope distance in the method for determining the polarity state of the capacitor according to the first embodiment of the present invention.
Fig. 8 is a flowchart of a method for determining the polarity of a capacitor according to a second embodiment of the present invention.
Fig. 9 is a schematic diagram of a first bow pattern and a second bow pattern of a capacitor polarity state determination method according to a second embodiment of the invention.
Fig. 10 is a detailed flowchart of a capacitor polarity state determination method according to a second embodiment of the present invention.
Wherein, the reference numbers:
20 capacitor
21 solid pattern
31 pattern image
32 closed pattern
301-307 edge coordinate points
L longitudinal straight line
P1 and P2 edge coordinate points
40 multiple edge coordinate points and connecting line therebetween
51 pattern image
52 closed pattern
501-506 edge coordinate points
90 circular pattern
91 first arcuate pattern
92 second arcuate pattern
Detailed Description
The detailed features and advantages of the present invention are described in detail in the following embodiments, which are sufficient for anyone skilled in the art to understand the technical contents of the present invention and to implement the present invention, and the related objects and advantages of the present invention can be easily understood by anyone skilled in the art according to the contents provided in the present specification, the claims and the attached drawings. The following examples further illustrate aspects of the present invention in detail, but are not intended to limit the scope of the invention in any way.
The invention will be described in detail with reference to the following drawings, which are provided for illustration purposes and the like:
referring to fig. 1, which is a flowchart illustrating a method for determining a polarity state of a capacitor according to a first embodiment of the present invention, the method may include the following steps: step S11, obtaining an image of a solid circuit board; step S12, comparing the solid circuit board image with the circuit board design drawing file to obtain a solid capacitor image; step S13, obtaining a plurality of edge coordinate points in the physical capacitor image, wherein the edge coordinate points are disposed along a periphery of a closed pattern, the number of the edge coordinate points is n, and n is at least three; step S14, calculating a total slope distance by the equation eq 1; and step S15, determining and outputting the polarity status of a capacitor associated with the closed pattern according to the total slope distance.
Referring to fig. 1 and fig. 2 together, a first embodiment of the present invention is described in more detail, wherein fig. 2 is a perspective view of a capacitor 20. The upper surface of the capacitor 20 has a solid pattern 21, the solid pattern 21 is used to represent the polarity direction of the capacitor 20, usually the solid pattern 21 is in the shape of an arc, and the orientation of the arc relative to the chord thereof represents the orientation of the cathode relative to the anode of the capacitor 20. That is, if the arc of the arcuate solid pattern 21 is located on the right side of the chord thereof, the negative electrode of the capacitor 20 is located on the right side of the positive electrode of the capacitor 20. In the step S11 of the first embodiment of the present invention, the image of the physical circuit board is obtained by taking a picture of the circuit board, recording a video of the circuit board, and the like, wherein the circuit board at least includes a capacitor, and the image of the physical circuit board at least includes the capacitor.
In step S12 of the first embodiment of the present invention, the physical circuit board image and the circuit board design drawing file are compared to obtain the physical capacitor image. Specifically, the circuit board design drawing file is a design drawing file of the circuit board, especially a design drawing electronic file. The circuit board design drawing file represents a plurality of electronic components of the circuit board, such as various capacitors, resistors, microchips, processing chips …, and the like, and preferably includes a plurality of predetermined coordinates, wherein each predetermined coordinate corresponds to an electronic component. In the following description about the first embodiment of the capacitor polarity state determination method of the present invention, only the preset capacitor coordinates among the preset coordinates will be explained as an example. In the embodiment, a conversion matrix between the physical circuit board image and the circuit board design drawing file can be obtained by presetting a plurality of reference points on the circuit board and the circuit board design drawing file, and the preset capacitor coordinates are converted into the physical capacitor coordinates on the physical circuit board image by the conversion matrix, so that the physical capacitor image covered in the physical circuit board image can be obtained. In detail, the embodiment of obtaining the physical capacitor image based on the physical capacitor coordinates may be: the image capture range is formed by extending outward around the coordinates of the solid capacitor, wherein the outward extending manner is to extend a predetermined length around the coordinates of the solid capacitor along two opposite directions of a plurality of axes (e.g., a vertical axis and a horizontal axis) of the image of the solid capacitor, so that the image capture range includes the capacitor. It should be noted that the above manner of obtaining the physical capacitor image is merely illustrative of one embodiment, and the present invention is not limited thereto.
In another embodiment, in order to reduce the computation amount of the personal electronic device or eliminate unnecessary noise, image preprocessing, such as morphological image processing, for example, binarization (binarization), erosion (erosion) and/or dilation (dilation), may be performed on the image in the image capturing range, and the preprocessed image may be used as the solid capacitor image. Therefore, unnecessary noise can be removed or the image can be enhanced, and the aims of improving the image quality and facilitating subsequent judgment are fulfilled. As shown in fig. 3A to 3C, the solid capacitor image is obtained by binarizing (fig. 3B) the image (fig. 3A) in the image capturing range and then performing morphological image processing (fig. 3C) such as erosion or dilation. As can be seen from fig. 3A and 3C, fig. 3A includes a pattern image 31, and the pattern image 31 is an image of the solid pattern 21 of the capacitor 20 shown in the solid circuit board image, and the closed pattern 32 shown in fig. 3C corresponds to the pattern image 31. Theoretically, the closed pattern 32 should be the same as the pattern image 31, but due to various environmental factors such as the illumination direction, the lens angle of the image capturing device, and the shielding of the neighboring elements, some unnecessary data of the image after image preprocessing is not effectively removed, or some necessary data is accidentally removed, and thus the closed pattern 32 may not be consistent with the pattern image 31.
Continuing to step S12, in step S13 of the first embodiment of the present invention, a plurality of edge coordinate points (as shown in fig. 3D) disposed along the periphery of the closed pattern are obtained from the physical capacitor image, wherein the number of the edge coordinate points is n, and n is at least three. Specifically, the edge coordinate points can be generated at the periphery of the outline of the closed pattern 32 by using the outline extraction functions "findContours" and "drawContours" of the computer vision library OpenCV, for example. In order to describe the shape of the closed pattern, the number of the edge coordinate points needs to be at least 3, and the number is preferably adjusted according to the amount of calculation. In FIG. 3D, only 7 edge coordinate points 301-307 are shown as a simple example, but in practice the number of edge coordinate points may be more to more clearly describe the closed pattern with these edge coordinate points. For the following steps, these edge coordinate points may be sequentially marked as first to nth edge coordinate points along the outer periphery of the closed pattern, for example, the edge coordinate points 301 to 307 in fig. 3D may be sequentially set as first to last edge coordinate points, and any one of the edge coordinate points 301 to 307 may be used as the first edge coordinate point.
Step S14 of the first embodiment of the present invention is to calculate the total amount W of the slope distance of the closed pattern 32 by the equation eq 1:
wherein W is the total distance of the slope, d (i, i +1) is the distance between the ith edge coordinate point and the (i +1) th edge coordinate point among the edge coordinate points, s (i, i +1) is the slope of the connection line between the ith edge coordinate point and the (i +1) th edge coordinate point, d (n,1) is the distance between the nth edge coordinate point and the first edge coordinate point among the edge coordinate points, and s (n,1) is the slope of the connection line between the nth edge coordinate point and the 1 st edge coordinate point. From the above equation eq1, it can be seen that the longer the length of the connection line between two connected edge coordinate points is, or the larger the absolute value of the slope of the connection line is, the greater the influence on the total slope distance W is. It should be noted that, in step S14, when the connection line between any two edge coordinate points is a vertical straight line (i.e., the two edge coordinate points have the same abscissa), the slope of the vertical straight line is defined as a maximum slope value or a minimum slope value that can be calculated. Accordingly, the longitudinal straight line can participate in the calculation of the total slope distance W together, and since the absolute value of the slope of the longitudinal straight line is significantly greater than the absolute values of the slopes of the other connecting lines, the absolute value becomes an important factor influencing the calculation result of the total slope distance W, so that the total slope distance W cannot be calculated due to the occurrence of the longitudinal straight line (the actual slope is infinite) of the identified closed pattern 32.
Specifically, in the present embodiment, for s (i, i +1), when the abscissa of the i-th edge coordinate point and the i + 1-th edge coordinate point are equal, the value of s (i, i +1) may be set to the maximum slope value when the ordinate of the i + 1-th edge coordinate point is greater than the ordinate of the i-th edge coordinate point, and the value of s (i, i +1) may be set to the minimum slope value when the ordinate of the i + 1-th edge coordinate point is less than the ordinate of the i-th edge coordinate point. Similarly, in this embodiment, for s (n,1), when the abscissa of the nth edge coordinate point and the abscissa of the 1 st edge coordinate point are equal, the value of s (n,1) may be set as the maximum slope value when the ordinate of the 1 st edge coordinate point is greater than the ordinate of the nth edge coordinate point, and the value of s (n,1) may be set as the minimum slope value when the ordinate of the 1 st edge coordinate point is less than the ordinate of the nth edge coordinate point. However, the opposite definition can be applied to the values of s (i, i +1) and s (n,1), that is, when the ordinate of the i +1 th edge coordinate point is greater than the ordinate of the i-th edge coordinate point, the value of s (i, i +1) is set as the minimum slope value, and when the ordinate of the 1 st edge coordinate point is greater than the ordinate of the n-th edge coordinate point, the value of s (n,1) is also set as the minimum slope value.
The maximum slope value and the minimum slope value can be defined by themselves according to the requirement, for example, the maximum slope value is defined as 15, and the minimum slope value is defined as-15. Alternatively, the maximum slope value and the minimum slope value may be determined based on the absolute values of the slopes of the connecting lines of the other non-longitudinal lines, for example, when the maximum value of the absolute values of the slopes of the connecting lines of the other non-longitudinal lines is 18.4, the maximum slope value and the minimum slope value may be set to a value greater than the maximum value, for example, 20 and-20, respectively. The maximum and minimum slope values can also vary depending on the size (radius) of the capacitor, for example, 15 and-15 for a capacitor radius of 6 mm, but 1.3 times (i.e., 19.5 and-19.5) the maximum and minimum slope values can be 15 and-15 for a capacitor radius of 8 mm (which is about 1.3 times the former radius). Table one is provided below, where the maximum and minimum slope values that can be used set the ratio at different sizes relative to the slope of a 6 mm capacitor, at common different radii capacitors.
(watch one)
Please refer to fig. 4, which further illustrates the vertical line by way of example. In the plurality of edge coordinate points and the connecting lines 40 therebetween obtained based on the closed pattern shown in fig. 4, in order to explain the case where there are vertical straight lines, the vertical straight line L and the edge coordinate points P1 and P2 at both ends thereof are particularly marked. Since the abscissa of the edge coordinate points P1 and P2 is equal, the connecting line (i.e. the vertical line L) between them extends along the vertical axis, and the slope of the connecting line cannot be mathematically calculated, the slope value s of the vertical line L must be determined in the manner set forth above (P1, P2). In the present embodiment, when the edge coordinate point P2 is the next edge coordinate point of the edge coordinate point P1 (i.e., P1 is i, P2 is i +1), or when the edge coordinate point P2 is the first edge coordinate point and the edge coordinate point P1 is the last edge coordinate point (i.e., P1 is n, P2 is 1), since the ordinate of the edge coordinate point P2 is greater than the ordinate of the edge coordinate point P1, s (P1, P2) is set to the maximum slope value; when the edge coordinate point P1 is the next edge coordinate point of the edge coordinate point P2 (i.e., P1 is i +1 and P2 is i), or when the edge coordinate point P1 is the first edge coordinate point and the edge coordinate point P2 is the last edge coordinate point (i.e., P2 is n and P1 is 1), since the ordinate of the edge coordinate point P1 is smaller than the ordinate of the edge coordinate point P2, s (P2 and P1) is set as the minimum slope value.
Referring to fig. 3A to 3D and fig. 5A to 5D, fig. 5A to 5C show a solid capacitor image obtained by binarizing the image (fig. 5A) in another image capture range and then performing morphological image processing (fig. 5C) such as erosion or dilation, and fig. 5D shows a plurality of edge coordinates disposed along the periphery of the closed pattern 52 obtained from the solid capacitor image. In detail, what is presented by fig. 3A is the case where the arc of the pattern image 31 is to the left of the chord, while fig. 5A is the case where the arc of the pattern image 51 is to the right of the chord. With the step S14, when the maximum slope value and the minimum slope value are set to 15 and-15, the edge coordinate points 301-307 in fig. 3D are sequentially set from the first edge coordinate point to the last edge coordinate point, so that the total slope distance W is about 67.9289; the edge coordinates 501-506 of FIG. 5D are sequentially set from the first edge coordinate to the last edge coordinate, resulting in a total slope distance W of about-67.9289. However, as mentioned above, when the values of s (i, i +1) and s (n,1) are defined in opposite settings, the signs of the slope distance total W are opposite, i.e., the slope distance total W corresponding to FIG. 3D is about-67.9289, and the slope distance total W corresponding to FIG. 5D is about 67.9289.
After the total slope distance W is calculated in step S14, step S15 determines and outputs the polarity state of a capacitor 20 associated with the closed pattern according to the total slope distance W, wherein the polarity state may be "the negative pole of the capacitor is located on the left side of the positive pole of the capacitor", "the negative pole of the capacitor is located on the right side of the positive pole of the capacitor", or "cannot be determined". In addition, the above-mentioned polarity state can be represented by a number or a symbol, for example, L represents "the negative electrode of the capacitor is located on the left side of the positive electrode of the capacitor", R represents "the negative electrode of the capacitor is located on the right side of the positive electrode of the capacitor", and 0 represents "cannot be determined". Specifically, as shown in fig. 6, step S15 may include sub-steps S151 to S153, which will be described later. In the sub-step S151, it is determined whether the total slope distance W falls within a positive value range or a negative value range for determining whether the total slope distance W calculated in the step S14 is sufficient to correctly show the orientation relationship between the positive electrode and the negative electrode of the capacitor 20. If the total slope distance W falls outside the positive value reaching range and the negative value reaching range (i.e., the value of the total slope distance W with a positive value is not large enough, or the value of the total slope distance W with a negative value is not small enough), it means that the probability of erroneous determination caused by the total slope distance W calculated this time is high. Preferably, different positive compliance ranges or negative compliance ranges can be set for different sized capacitors, since different maximum and minimum slope values are set for different sized capacitors.
When the sub-step S151 determines that the total slope distance W does not fall within either the positive value compliance range or the negative value compliance range, the sub-step S152 is performed subsequently to determine that the polarity status is not determinable. Then, another step S11 is optionally performed to obtain the image of the solid circuit board more suitable for the determination, and the steps S12-S15 are performed again with the obtained image of the solid circuit board again. Otherwise, when the sub-step S151 determines that the total slope distance W falls within the positive value compliance range or the negative value compliance range, the sub-step S153 is performed to determine the orientation relationship between the positive electrode and the negative electrode of the capacitor 20. In detail, in this embodiment, when the total slope distance W falls within the positive value reaching range, it is determined that the polarity state is that the negative pole of the capacitor is located on the left side of the positive pole of the capacitor (i.e. as shown in fig. 3D); when the total slope distance W falls within the negative compliance range, it is determined that the polarity state is that the negative terminal of the capacitor is located on the right side of the positive terminal of the capacitor (i.e., as shown in fig. 5D). Similarly, when the values of s (i, i +1) and s (n,1) are defined in opposite settings, the polarity state when the total slope distance W falls within the positive compliance range is determined to be that the negative pole of the capacitor is located on the right side of the positive pole of the capacitor, and the polarity state when the total slope distance W falls within the negative compliance range is determined to be that the negative pole of the capacitor is located on the left side of the positive pole of the capacitor.
In addition, as shown in fig. 7, before performing the sub-step S151 'in the step S15' of fig. 7, the sub-step S150 may be further performed to adjust the total slope distance W in a normalized manner. Specifically, the normalization may be performed by dividing the total slope distance W by the diameter of the capacitor 20 to obtain a normalized total and determining whether the normalized total falls within a positive or negative threshold. Therefore, when the radius of the capacitor is different and different maximum slope values and minimum slope values are adopted, different positive value standard value ranges or negative value standard value ranges do not need to be arranged corresponding to different sizes of the capacitor, and storage space required by additional setting can be omitted. When the sub-step S151 'determines that the normalized total amount falls within the positive value reaching range or the negative value reaching range, the sub-step S153' is executed. In step S153', when the normalized total amount falls within the positive value reaching range, it is determined that the polarity status is that the negative terminal of the capacitor is located on the left side of the positive terminal of the capacitor; and when the normalized total amount falls within the negative value reaching range, determining that the polarity state is that the negative pole of the capacitor is located on the right side of the positive pole of the capacitor.
Finally, in the actual situation of factory manufacturing, besides determining the polarity state of the capacitor, it is still necessary to determine whether the polarity state is in accordance with the originally specified polarity state, and the product can be successfully delivered only if the polarity state is correct. In order to increase the process efficiency, the data with the predetermined polarity state can be added to the method for determining the polarity state of the capacitor of the present invention. In an embodiment of the invention, the circuit board design drawing file may further have a predetermined polarity state associated with the plurality of electronic components. In this case, after the polarity state of the capacitor is determined, it is determined whether the polarity state is the same as the preset polarity state, and if the polarity state is the same as the preset polarity state, the polarity state is output; if the polarity state is different from the preset polarity state, a warning signal for warning can be generated or a judgment is repeatedly made once, so that the invention is not limited. The present invention is not limited to the expression of the predetermined polarity state, but the expression of the predetermined polarity state is the same as the expression of the determined polarity state of the capacitor. For example, in the first embodiment, the predetermined polarity state can be "the negative electrode of the capacitor is located on the left side of the positive electrode of the capacitor" and "the negative electrode of the capacitor is located on the right side of the positive electrode of the capacitor".
In the first embodiment of the method for determining the polarity state of the capacitor according to the present invention, the current polarity state of the capacitor is determined by calculating the slope of each edge coordinate point adjacent to the outer edge contour of the graph and the sum of the product of the slopes, and finally, the current polarity state can be compared with the preset polarity state to determine whether the current polarity state is matched with the preset polarity state. Even if the image of the capacitor after image capture cannot identify a complete entity pattern after image preprocessing due to environmental factors and the like, the polarity state of the capacitor can be effectively judged, and the error detection rate and the error judgment rate are further reduced.
Please refer to fig. 8, which is a flowchart illustrating a method for determining a polarity state of a capacitor according to a second embodiment of the present invention. Compared with the first embodiment, in the second embodiment, a first determination procedure is first performed to generate a first determination polarity state, and a second determination procedure is performed to generate a second determination polarity state when the first determination polarity state is different from a predetermined polarity state, wherein the second determination procedure is performed by the method of the first embodiment. The present embodiment is provided to determine the polarity state by an initial determination program with a small calculation amount under normal conditions, and to further determine a secondary determination program with high robustness to environmental influence factors when the polarity state determination is abnormal. In this way, the steps S13 to S15 can be avoided for each physical capacitor image, thereby improving the overall performance of the actual production. In the present embodiment, steps S21 to S24 are the aforementioned initial determination procedure, and step S27 is the aforementioned secondary determination procedure, wherein steps S21 and S22 are the same as steps S11 and S12 of the first embodiment, and step S27 is the steps S13 to S15 of the first embodiment, so that the descriptions of steps S21 to S22 and S27 will be omitted in the following description.
Referring to fig. 8 again, the second embodiment of the method for determining the polarity state of the capacitor according to the present invention includes the following steps: step S21, obtaining an image of a solid circuit board; step S22, comparing the solid circuit board image with the circuit board design drawing file to obtain a solid capacitor image; step S23, obtaining a closed pattern in the physical capacitor image, and obtaining an arch pattern based on the closed pattern, wherein the arch pattern and the closed pattern at least partially overlap; step S24, generating an initial polarity state of a capacitor associated with the closed pattern based on the arcuate pattern; step S25, determining whether the initial polarity state is the same as a predetermined polarity state; step S26, when the initial judgment polarity state is the same as the preset polarity state, outputting the initial judgment polarity state; step S27, when the initial polarity state is different from the predetermined polarity state, obtaining a plurality of edge coordinate points located at the periphery of the closed pattern, calculating a total slope distance amount according to the distance between every two adjacent edge coordinate points of the edge coordinate points and the slope of the connection line, and generating a polarity state associated with the capacitor according to the total slope distance amount; step S28, determining whether the determined polarity state is the same as the predetermined polarity state; and step S29, outputting the determined polarity state when the determined polarity state is the same as the predetermined polarity state. The following is a detailed explanation and example of the above steps.
Please refer to fig. 8 and fig. 9. In step S23, the closed pattern 52 based on the obtained solid capacitor image after preprocessing the solid capacitor image further obtains an arch pattern (first arch pattern 91) as shown in fig. 9, wherein the first arch pattern 91 at least partially overlaps the closed pattern 52. Preferably, the first arcuate pattern 91 is the smallest arcuate encompassing this closed pattern 52, and the bow of the first arcuate pattern 91 is to the left or right of its chord. In step S24, an initial polarity state of the capacitor associated with the closed pattern 52 is generated based on the first arcuate pattern 91. This initial polarization state is obtained according to the orientation relationship of the bow and the chord of the first bow pattern 91, wherein the initial polarization state can be "" the negative pole of the capacitor is located at the left side of the positive pole of the capacitor "" or "" the negative pole of the capacitor is located at the right side of the positive pole of the capacitor "", and the detailed flow of step S24 will be described later. In the following step S25, after the initial polarity state is generated, it is determined whether the initial polarity state and the predetermined polarity state are the same. When the initial determination polarity state is the same as the preset polarity state, proceeding to step S26, outputting the initial determination polarity state; when the initial determination polarity state is different from the predetermined polarity state, step S27 is executed, i.e., the re-determination procedure is further executed (i.e., steps S13 to S15 of the first embodiment are executed).
After the secondary polarity state is generated in step S27, step S28 may determine whether the secondary polarity state is the same as the predetermined polarity state. In step S29, when the determined polarity state is the same as the predetermined polarity state, the determined polarity state can be outputted. If the polarity state is determined to be different from the preset polarity state, a warning signal for warning may be generated, or step S21 may be executed again and the capacitance polarity state determination method of the second embodiment is executed again, which is not limited in the present invention.
Referring to fig. 10, which is a detailed flowchart of the step S24 of the capacitor polarity state determination method according to the second embodiment of the present invention, the step S24 includes the sub-steps S241-S244 for generating the initial determination polarity state based on the first bow pattern 91. In detail, referring to fig. 9 again, in step S241, the circular pattern 90 may be generated according to the first arcuate pattern 91, and in detail, the center of the circular pattern 90 and the semicircular position thereof may be found by iterating each coordinate point on the outline of the first arcuate pattern 91 by using dichotomies (bisectors), so as to generate the circular pattern 90, wherein the arc portion of the first arcuate pattern 91 overlaps the outer circumference of the circular pattern 90, and the portion of the outer circumference that is not overlapped with the arc forms the second arcuate pattern 92 with the chord of the first arcuate pattern 91. Subsequently, in step S242, the area of the first arcuate pattern 91 and the area of the second arcuate pattern 92 are compared to obtain the magnitude relationship between the two areas. In step S243, the orientation of the smaller area of the first and second arcuate patterns 91 and 92 relative to the larger area is determined. Finally, the initial polarity state is determined in step S244 to be the negative pole of the capacitor is located on the left or right side of the positive pole of the capacitor. Specifically, the orientation of the smaller area of the first arcuate pattern 91 and the second arcuate pattern 92 relative to the larger area is the orientation of the negative electrode of the capacitor relative to the positive electrode thereof. Referring to fig. 2, since the solid pattern 21 represents the orientation of the negative electrode with respect to the positive electrode on the capacitor 20, the circular pattern 90 may correspond to the circular periphery of the capacitor 20, the smaller one of the first and second arcuate patterns 91 and 92 may correspond to the solid pattern 21, and the larger one of the first and second arcuate patterns 91 and 92 may correspond to a portion of the circular periphery of the capacitor 20 that does not include the solid pattern 21. Taking fig. 9 as an example, since the first arcuate pattern 91 (smaller in area) is located on the right side of the second arcuate pattern 92 (larger in area), it can be determined that the initial polarity state of fig. 9 is that the negative electrode of the capacitor is located on the right side of the positive electrode of the capacitor.
The above description is a description of embodiments illustrating embodiments of the present invention. By the capacitor polarity state determination method provided by the invention, the polarity state of the capacitor can be effectively determined even if the environment for obtaining the capacitor image is not good. In addition, under the condition of low operation performance, referring to the second embodiment of the present invention, before determining the polarity state of the capacitor by using the total slope distance, the initial determination of the polarity state of the capacitor is determined by using the areas of the first segment and the second segment.
The present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof, and it should be understood that various changes and modifications can be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (10)
1. A method for determining a polarity state of a capacitor, comprising:
obtaining a solid circuit board image;
comparing the solid circuit board image with a circuit board design drawing file to obtain a solid capacitor image;
obtaining a plurality of edge coordinate points in the physical capacitor image, wherein the edge coordinate points are arranged along the periphery of a closed pattern, the number of the edge coordinate points is n, and n is at least three;
calculating a total slope distance by the following equation:
determining and outputting a polarity state of a capacitor associated with the closed pattern according to the total slope distance,
wherein W is the total distance of the slope, d (i, i +1) is the distance between the ith edge coordinate point and the (i +1) th edge coordinate point among the plurality of edge coordinate points, s (i, i +1) is the slope of the connection line between the ith edge coordinate point and the (i +1) th edge coordinate point, d (n,1) is the distance between the nth edge coordinate point and the first edge coordinate point among the plurality of edge coordinate points, and s (n,1) is the slope of the connection line between the nth edge coordinate point and the first edge coordinate point.
2. The method of claim 1, wherein when calculating the total slope distance according to the equation, if the abscissa of the i-th edge coordinate point and the i + 1-th edge coordinate point are equal, the value of s (i, i +1) is set to a maximum slope value when the ordinate of the i + 1-th edge coordinate point is greater than the ordinate of the i-th edge coordinate point, and the value of s (i, i +1) is set to a minimum slope value when the ordinate of the i + 1-th edge coordinate point is less than the ordinate of the i-th edge coordinate point, and the method further comprises calculating the total slope distance according to the equation
When the abscissa of the nth edge coordinate point and the abscissa of the 1 st edge coordinate point are equal, the value of s (n,1) is set as the maximum slope value when the ordinate of the 1 st edge coordinate point is greater than the ordinate of the nth edge coordinate point, and the value of s (n,1) is set as the minimum slope value when the ordinate of the 1 st edge coordinate point is less than the ordinate of the nth edge coordinate point.
3. The method of claim 1, wherein determining and outputting the polarity status of the capacitor associated with the closed pattern based on the total amount of slope distance comprises:
judging whether the total slope distance falls within a positive value standard value range or a negative value standard value range;
when the total slope distance is within the positive value reaching range, determining the polarity state as the negative pole of the capacitor being located at one of the left side and the right side of the positive pole of the capacitor; and
when the total slope distance falls within the negative value reaching range, the polarity state is determined as the other of the left side and the right side of the negative pole of the capacitor.
4. The capacitor polarity state determination method according to claim 3,
when the total slope distance is judged to be outside the positive value standard value range and the negative value standard value range, the polarity state is judged to be not capable of being judged, and another entity circuit board image containing the capacitor is obtained so as to judge the polarity state of the capacitor again.
5. The method of claim 1, wherein determining and outputting the polarity status of the capacitor associated with the closed pattern based on the total amount of slope distance comprises:
dividing the total amount of slope distance by a diameter of the capacitor to obtain a normalized total amount;
determining whether the normalized total amount falls within a positive value compliance range or a negative value compliance range;
when the normalized total amount falls within the positive value reaching range, determining that the polarity state is one of the left side and the right side of the negative pole of the capacitor; and
when the normalized total amount falls within the negative value reaching range, the polarity status is determined as the other of the left side and the right side of the negative pole of the capacitor.
6. The method of claim 1, wherein comparing the physical circuit board image with the circuit board design drawing to obtain the physical capacitor image comprises:
converting a preset capacitor coordinate of the circuit board design drawing file into an entity capacitor coordinate of the entity circuit board image by using a conversion matrix, and obtaining the entity capacitor image from an image range containing the entity capacitor coordinate in the entity circuit board image.
7. A method for determining a polarity state of a capacitor, comprising:
obtaining a solid circuit board image;
comparing the solid circuit board image with a circuit board design drawing file to obtain a solid capacitor image;
obtaining a closed pattern in the physical capacitor image, and obtaining an arch pattern based on the closed pattern, wherein the arch pattern and the closed pattern are at least partially overlapped;
generating a first determined polarity state of a capacitor associated with the closed pattern based on the arcuate pattern;
judging whether the initial judgment polarity state is the same as a preset polarity state;
when the initial judgment polarity state is the same as the preset polarity state, outputting the initial judgment polarity state;
when the initial judgment polarity state is different from the preset polarity state, obtaining a plurality of edge coordinate points positioned at the periphery of the closed pattern, calculating a total slope distance amount according to the distance between every two adjacent edge coordinate points of the plurality of edge coordinate points and the slope of a connecting line, and generating a secondary judgment polarity state related to the capacitor according to the total slope distance amount;
judging whether the judging polarity state is the same as the preset polarity state; and
and outputting the polarity-covering state when the polarity-covering state is the same as the preset polarity state.
8. The method of claim 7, wherein defining the bow pattern as a first bow pattern, generating the initial determined polarity state of the capacitor associated with the closed pattern based on the first bow pattern comprises:
generating a circular pattern according to the first arch pattern, wherein the arc part of the first arch pattern overlaps the periphery of the circular pattern, and the part of the periphery which is not overlapped with the arc and the chord of the first arch pattern form a second arch pattern;
comparing the area of the first arch pattern with the area of the second arch pattern; and
and judging that the first bow-shaped pattern and the second bow-shaped pattern are respectively a smaller area and a larger area, and the direction of the smaller area relative to the larger area is the direction of the negative electrode of the capacitor relative to the positive electrode of the capacitor.
9. The method of claim 7, wherein the edge coordinate points are disposed along a periphery of a closed pattern, the number of the edge coordinate points is n, and n is at least three.
10. The method of claim 9, wherein calculating the total distance of slopes according to the distance between every two adjacent edge coordinate points of the edge coordinate points and the slope of the connecting line comprises:
the total slope distance is calculated by the following equation:
wherein W is the total distance of the slope, d (i, i +1) is the distance between the ith edge coordinate point and the (i +1) th edge coordinate point among the plurality of edge coordinate points, s (i, i +1) is the slope of the connection line between the ith edge coordinate point and the (i +1) th edge coordinate point, d (n,1) is the distance between the nth edge coordinate point and the first edge coordinate point among the plurality of edge coordinate points, and s (n,1) is the slope of the connection line between the nth edge coordinate point and the first edge coordinate point.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011176462.0A CN114429442A (en) | 2020-10-29 | 2020-10-29 | Method for determining polarity state of capacitor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011176462.0A CN114429442A (en) | 2020-10-29 | 2020-10-29 | Method for determining polarity state of capacitor |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114429442A true CN114429442A (en) | 2022-05-03 |
Family
ID=81310039
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011176462.0A Pending CN114429442A (en) | 2020-10-29 | 2020-10-29 | Method for determining polarity state of capacitor |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114429442A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04236318A (en) * | 1991-01-21 | 1992-08-25 | Nec Corp | Inspecting device of polarity of capacitor |
JP2013012646A (en) * | 2011-06-30 | 2013-01-17 | Nippon Chemicon Corp | Capacitor, and method and program for manufacturing the same |
CN103869215A (en) * | 2012-12-10 | 2014-06-18 | 鸿富锦精密工业(深圳)有限公司 | Electronic component inspection system and electronic component inspection method |
CN107895064A (en) * | 2017-10-19 | 2018-04-10 | 上海望友信息科技有限公司 | Component polarity detection method, system, computer-readable recording medium and equipment |
CN109870141A (en) * | 2017-12-05 | 2019-06-11 | 英业达科技有限公司 | The polar method and system of electrolytic capacitor are judged using image |
CN111007441A (en) * | 2019-12-16 | 2020-04-14 | 深圳市振邦智能科技股份有限公司 | Electrolytic capacitor polarity detection method and detection system |
-
2020
- 2020-10-29 CN CN202011176462.0A patent/CN114429442A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04236318A (en) * | 1991-01-21 | 1992-08-25 | Nec Corp | Inspecting device of polarity of capacitor |
JP2013012646A (en) * | 2011-06-30 | 2013-01-17 | Nippon Chemicon Corp | Capacitor, and method and program for manufacturing the same |
CN103869215A (en) * | 2012-12-10 | 2014-06-18 | 鸿富锦精密工业(深圳)有限公司 | Electronic component inspection system and electronic component inspection method |
CN107895064A (en) * | 2017-10-19 | 2018-04-10 | 上海望友信息科技有限公司 | Component polarity detection method, system, computer-readable recording medium and equipment |
CN109870141A (en) * | 2017-12-05 | 2019-06-11 | 英业达科技有限公司 | The polar method and system of electrolytic capacitor are judged using image |
CN111007441A (en) * | 2019-12-16 | 2020-04-14 | 深圳市振邦智能科技股份有限公司 | Electrolytic capacitor polarity detection method and detection system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113344931B (en) | Plug-in visual detection and identification method, readable storage medium and device | |
CN110660072B (en) | Method and device for identifying straight line edge, storage medium and electronic equipment | |
US20030031356A1 (en) | Pattern inspection apparatus and method | |
US20190266752A1 (en) | Method for identification of characteristic points of a calibration pattern within a set of candidate points derived from an image of the calibration pattern | |
CN110596121A (en) | Keyboard appearance detection method and device and electronic system | |
KR20130126370A (en) | Method and apparatus for inspecting via hole | |
CN114820620B (en) | Bolt loosening defect detection method, system and device | |
JP6177541B2 (en) | Character recognition device, character recognition method and program | |
CN114998208A (en) | Drilling deviation detection method for PCB | |
CN112419207A (en) | Image correction method, device and system | |
CN113538603A (en) | Optical detection method and system based on array product and readable storage medium | |
US6885777B2 (en) | Apparatus and method of determining image processing parameter, and recording medium recording a program for the same | |
CN109919155B (en) | Inclination angle correction method for text image and terminal | |
US8687921B2 (en) | Image processing apparatus, image processing method, and image processing program | |
CN117029733B (en) | Bolt loosening detection method, system and device based on computer vision | |
CN114429442A (en) | Method for determining polarity state of capacitor | |
CN116223515A (en) | Conductive pattern defect detection method for circuit board test process | |
TWI730918B (en) | Determining method for polarity state of capacitor | |
US7027637B2 (en) | Adaptive threshold determination for ball grid array component modeling | |
CN115311281A (en) | Wafer circle center correction method | |
TWI735365B (en) | Determining method for polarity of capacitor | |
CN114429443A (en) | Method for determining polarity of capacitor | |
JPH08110305A (en) | Method and device for inspecting appearance | |
CN114428082A (en) | Electronic component image capturing method and capacitor polarity determination method using same | |
CN117078913B (en) | Object inclination correction method, device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |