Method for determining the polarity status of capacitors

By using edge coordinate points of the capacitor image to calculate the total slope distance in the image recognition method, the polarity state determination problem under the influence of environmental factors is solved, and a more efficient capacitor polarity state determination is achieved.

CN114429442BActive Publication Date: 2025-03-04GIGA BYTE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011176462.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-29
Publication Date
2025-03-04
Estimated Expiration
2040-10-29

AI Technical Summary

Technical Problem

When the prior art uses an image recognition method to determine the polarity state of an electronic component, it is susceptible to environmental factors such as lighting direction, lens angle and adjacent component masking, resulting in image distortion or unrecognition, and thus error detection or misjudgment occurs.

Method used

By obtaining the physical circuit board image and comparing the design drawing files, the physical capacitor image is obtained, multiple edge coordinate points along the periphery of the closed pattern are extracted, and the total slope distance is calculated to determine the polarity state of the capacitor.

Benefits of technology

Even in the poor environment, the polarity status of the capacitor can be effectively judged, the error detection rate and error judgment rate can be reduced, and the efficiency of the circuit board manufacturing process can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114429442B_ABST
    Figure CN114429442B_ABST
Patent Text Reader

Abstract

A method for determining the polarity state of a capacitor includes: obtaining a physical circuit board image, comparing the physical circuit board image with a circuit board design drawing to obtain a physical capacitor image, obtaining multiple edge coordinate points in the physical capacitor image, wherein the multiple edge coordinate points are arranged along the periphery of a closed pattern, the number of the multiple edge coordinate points is n, and n is at least three, calculating a slope distance total using an equation, and judging and outputting the polarity state of a capacitor associated with the closed pattern based on the slope distance total.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for determining the polarity state of an electronic component, and in particular to a method for determining the polarity state of a capacitor using image recognition. Background Art

[0002] When manufacturing circuit boards such as computer motherboards and development boards in factories, various electronic components are combined with the substrate. Regardless of whether the electronic components are placed manually or automatically, there is a possibility that the polarity and pin direction of the placed electronic components are incorrect. Known methods of checking for errors include manual inspection, connecting some electronic components or parts of the circuit board with voltage or current detectors and measuring whether the measured values ​​meet the factory settings. However, the above inspection methods are too time-consuming and can easily make the entire circuit board manufacturing process inefficient. Image recognition technology can now be used to assist in inspection. After obtaining an image of the electronic components containing the circuit board, it is determined based on the processed image whether the electronic components have misplaced pins.

[0003] However, due to various environmental factors that cannot be precisely controlled, such as the direction of light, the angle of the lens of the imaging device, and the shielding of adjacent components, the image containing the electronic components after pre-processing conversion is too distorted or cannot be judged, or the position of the electronic components to be tested on the circuit board cannot be identified, etc., resulting in occasional underkill or overkill phenomena in the image recognition method. Underkill means that the wrong pin position of the electronic component is not detected, and overkill means that the pin position of the electronic component is correct but is judged to be reversed. Summary of the invention

[0004] In view of the above, the present invention provides a capacitor polarity state determination method that can meet the above needs, and can effectively determine the polarity state of the capacitor even if the environment for obtaining the capacitor image is not good.

[0005] According to the first embodiment of the present invention, the capacitor polarity state determination method includes: obtaining a physical circuit board image; comparing the physical circuit board image with a circuit board design file to obtain a physical capacitor image; obtaining a plurality of edge coordinate points in the physical capacitor image, wherein the plurality of edge coordinate points are arranged along the periphery of a closed pattern, the number of the plurality of edge coordinate points is n, and n is at least three; calculating a slope distance total using the following equation:

[0006]

[0007] ; and judging and outputting the polarity state of a capacitor associated with the closed pattern according to the total slope distance, wherein W is the total slope distance, d(i,i+1) is the distance between the i-th edge coordinate point and the i+1-th edge coordinate point among the multiple edge coordinate points, s(i,i+1) is the slope of the line between the i-th edge coordinate point and the i+1-th edge coordinate point, d(n,1) is the distance between the n-th edge coordinate point and the first edge coordinate point among the multiple edge coordinate points, and s(n,1) is the slope of the line between the n-th edge coordinate point and the first edge coordinate point.

[0008] According to a second embodiment of the present invention, a capacitor polarity state determination method includes: obtaining a physical circuit board image; comparing the physical circuit board image with a circuit board design file to obtain a physical 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 at least partially overlap; generating a preliminary polarity state of a capacitor associated with the closed pattern based on the arch pattern; judging whether the preliminary polarity state is the same as a preset polarity state; when the preliminary polarity state is the same as the preset polarity state, outputting the preliminary polarity state; when the preliminary polarity state is different from the preset polarity state, obtaining a plurality of edge coordinate points located at the periphery of the closed pattern, calculating a slope distance total according to the distance between each two adjacent edge coordinate points of the edge coordinate points and the slope of the connecting line, and generating a reverse polarity state associated with the capacitor according to the slope distance total; judging whether the reverse polarity state is the same as the preset polarity state; and outputting the reverse polarity state when the reverse polarity state is the same as the preset polarity state.

[0009] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments, but is not intended to limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 FIG. 4 is a flow chart of a method for determining a capacitor polarity state according to a first embodiment of the present invention.

[0011] Figure 2 FIG. 1 is a three-dimensional diagram of a capacitor applicable to the capacitor polarity state determination method according to the first embodiment of the present invention.

[0012] Figure 3A FIG. 1 is a schematic diagram of a physical capacitor image obtained in an implementation of a capacitor polarity state determination method according to the first embodiment of the present invention.

[0013] Figure 3B It is a schematic diagram of binarizing an image in a selected range according to the capacitor polarity state determination method of the first embodiment of the present invention.

[0014] Figure 3C FIG. 4 is a schematic diagram of a physical capacitance image obtained in another implementation of the capacitor polarity state determination method according to the first embodiment of the present invention.

[0015] Figure 3D FIG. 1 is a schematic diagram of a plurality of edge coordinate points and the connecting lines therebetween in the capacitor polarity state determination method according to the first embodiment of the present invention.

[0016] Figure 4 Another schematic diagram of a plurality of edge coordinate points and the connecting lines therebetween in the capacitor polarity state determination method according to the first embodiment of the present invention.

[0017] Figure 5A FIG. 4 is a schematic diagram of another physical capacitor image obtained in an implementation of the capacitor polarity state determination method according to the first embodiment of the present invention.

[0018] Figure 5B It is a schematic diagram of binarizing an image in another selected range according to the capacitor polarity state determination method of the first embodiment of the present invention.

[0019] Figure 5C FIG. 4 is a schematic diagram of another physical capacitance image obtained in another implementation of the capacitor polarity state determination method according to the first embodiment of the present invention.

[0020] Figure 5D FIG. 1 is a schematic diagram of a plurality of edge coordinate points and the connecting lines therebetween in the capacitor polarity state determination method according to the first embodiment of the present invention.

[0021] Figure 6 This is a detailed flow chart of determining the polarity state based on the total amount of slope distance in the capacitor polarity state determination method according to the first embodiment of the present invention.

[0022] Figure 7 Another detailed flow chart of determining the polarity state based on the total amount of slope distance in the capacitor polarity state determination method according to the first embodiment of the present invention.

[0023] Figure 8 FIG. 4 is a flow chart of a capacitor polarity state determination method according to a second embodiment of the present invention.

[0024] Fig. 9 FIG. 4 is a schematic diagram of a first arch pattern and a second arch pattern of a capacitor polarity state determination method according to a second embodiment of the present invention.

[0025] Fig.10 FIG. 4 is a detailed flow chart of a capacitor polarity state determination method according to a second embodiment of the present invention.

[0026] Wherein, the reference numerals are:

[0027] 20 Capacitor

[0028] 21 Solid Pattern

[0029] 31 pattern images

[0030] 32 Closed Pattern

[0031] 301~307 Edge coordinate points

[0032] L Vertical straight line

[0033] P1, P2 edge coordinate points

[0034] More than 40 edge coordinate points and their connections

[0035] 51 pattern images

[0036] 52 Closed Pattern

[0037] 501~506 Edge coordinate points

[0038] 90 Circular Pattern

[0039] 91 First Arch Pattern

[0040] 92 Second Arch Pattern DETAILED DESCRIPTION

[0041] The detailed features and advantages of the present invention are described in detail in the following embodiments, and the contents are sufficient to enable anyone familiar with the relevant art to understand the technical content of the present invention and implement it accordingly, and according to the contents provided in this specification, the scope of the patent application and the drawings, anyone familiar with the relevant art can easily understand the relevant purposes and advantages of the present invention. The following examples further illustrate the viewpoints of the present invention in detail, but do not limit the scope of the present invention in any viewpoint.

[0042] The structural principle and working principle of the present invention are described in detail below in conjunction with the accompanying drawings:

[0043] Reference Figure 1 , which is a flow chart of the first embodiment of the capacitor polarity state determination method provided by the present invention, which may include the following steps: step S11, obtaining a physical circuit board image; step S12, comparing the physical circuit board image and the circuit board design drawing to obtain a physical capacitor image; step S13, 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; step S14, calculating a slope distance total using equation eq1; and step S15, judging and outputting the polarity state of a capacitor associated with the closed pattern according to the slope distance total.

[0044] Please also read Figure 1and Figure 2 , to further describe the first embodiment of the present invention, wherein Figure 2 is a three-dimensional diagram of the capacitor 20. The upper surface of the capacitor 20 has a solid pattern 21, and the solid pattern 21 is used to represent the polarity direction of the capacitor 20. Usually, the solid pattern 21 is in an arc shape, and the position of the arc of the arc relative to its chord represents the position of the negative electrode of the capacitor 20 relative to the positive electrode. That is, if the arc of the solid pattern 21 in the shape of an arc is on the right side of its chord, the negative electrode of the capacitor 20 is on the right side of the positive electrode of the capacitor 20. Step S11 of the first embodiment of the present invention can be, for example, to obtain a physical circuit board image by photographing or recording a circuit board with an imaging device, wherein the circuit board must include at least one capacitor, and the physical circuit board image includes at least the capacitor.

[0045] In step S12 of the first embodiment of the present invention, the physical circuit board image and the circuit board design drawing are then compared to obtain a physical capacitor image. Specifically, the circuit board design drawing is a design drawing of the circuit board, and in particular, an electronic design drawing. This circuit board design drawing represents multiple electronic components of the circuit board, such as various capacitors, resistors, microchips, processing chips, etc., and this circuit board design drawing preferably includes multiple preset coordinates, and each preset coordinate corresponds to an electronic component. In the following description of the first embodiment of the capacitor polarity state determination method of the present invention, only the preset capacitor coordinates in the preset coordinates will be used as an example for explanation. In this embodiment, by pre-setting multiple reference points on the circuit board and the circuit board design drawing, a conversion matrix between the physical circuit board image and the circuit board design drawing can be obtained, and the aforementioned preset capacitor coordinates are converted into physical capacitor coordinates on the physical circuit board image using this conversion matrix, and then the physical capacitor image included in the physical circuit board image can be obtained. In detail, the implementation method of obtaining a physical capacitor image based on the physical capacitor coordinates can be: expanding outwards with the physical capacitor coordinates as the center to frame an imaging range, wherein the outward expansion method can be to extend a preset length in two opposite directions along multiple axes (such as mutually perpendicular longitudinal and horizontal axes) of the physical capacitor image with the physical capacitor coordinates as the center, so that the imaging range includes the capacitor. It should be noted that the above method of obtaining a physical capacitor image is only an explanation of an implementation method, and the present invention is not limited thereto.

[0046] In another specific implementation, in order to reduce the amount of computation of the personal electronic device or remove unnecessary noise, the image in the image capture range may be preprocessed, such as morphological image processing such as binarization, erosion and / or dilation, and then the image preprocessed is used as the aforementioned physical capacitor image. In this way, unnecessary noise can be removed or the image can be enhanced, thereby improving the image quality and facilitating subsequent judgment. FIG. 3A to FIG. 3C As shown, it is an image in the imaging range ( Figure 3A ) is binarized ( Figure 3B ) and then perform morphological image processing such as erosion or dilation ( Figure 3C ) after the physical capacitor image is obtained. Figure 3A and Figure 3C It can be seen that Figure 3A The pattern image 31 is included in the physical circuit board image, and the pattern image 31 is the image of the physical pattern 21 of the capacitor 20 presented in the physical circuit board image. Figure 3C The closed pattern 32 shown in FIG. 3 corresponds to the pattern image 31. In theory, the closed pattern 32 should be the same as the pattern image 31. However, due to various environmental factors such as the direction of illumination, the lens angle of the imaging device, and shielding of adjacent components, some unnecessary data may not be effectively removed after the image is pre-processed, or some necessary data may be accidentally removed, which may cause the closed pattern 32 to be inconsistent with the pattern image 31.

[0047] Following step S12, in step S13 of the first embodiment of the present invention, a plurality of edge coordinate points (such as Figure 3D ), wherein the number of these edge coordinate points is n, and n is at least three. Specifically, the above-mentioned multiple edge coordinate points can be generated on the contour periphery of the closed pattern 32 by, for example, the contour extraction functions "findContours" and "drawContours" of the computer vision library OpenCV. In order to describe the shape of the above-mentioned closed pattern, the number of edge coordinate points must be at least 3, and this number is preferably adjusted according to the amount of calculation caused. Figure 3D In FIG. 3 , only 7 edge coordinate points 301 to 307 are shown as a simple example, but in fact the number of edge coordinate points may be greater, so that the closed pattern can be described more clearly with these edge coordinate points. For subsequent steps, these edge coordinate points may be marked as the first to nth edge coordinate points in sequence along the outer periphery of the closed pattern, for example Figure 3D The edge coordinate points 301 - 307 in can be set as the first to the last edge coordinate points in sequence, and any edge coordinate point 301 - 307 can be used as the first edge coordinate point.

[0048] In the first embodiment of the present invention, step S14 calculates the total slope distance W of the closed pattern 32 using equation eq1:

[0049]

[0050] Where W is the total amount of slope distance, d(i,i+1) is the distance between the ith edge coordinate point and the i+1th edge coordinate point among the edge coordinate points, s(i,i+1) is the slope of the line between the ith edge coordinate point and the i+1th 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 line between the nth edge coordinate point and the first edge coordinate point. It can be seen from the above equation eq1 that the longer the length of the line between the two connected edge coordinate points, or the greater the absolute value of the slope of the line, the greater the impact on the total amount of slope distance W. It should be noted that in step S14, when the line between any two edge coordinate points is a vertical straight line (that is, the two edge coordinate points have the same horizontal coordinate), the slope of the vertical straight line needs to be defined as a maximum slope value or a minimum slope value that can be calculated. Accordingly, the vertical straight line can be used together in the calculation of the total slope distance W, and because the absolute value of the slope of the vertical straight line is significantly greater than the absolute values ​​of the slopes of other connecting lines, it becomes an important factor affecting the calculation result of the total slope distance W, so that the total slope distance W will not be unable to be calculated due to the presence of a vertical straight line (the actual slope is infinite) in the recognized closed pattern 32.

[0051] Specifically, in this embodiment, for s(i,i+1), when the abscissas of the i-th edge coordinate point and the i+1-th edge coordinate point are equal, 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) can be set as the maximum slope value, and when the ordinate of the i+1-th edge coordinate point is less than the ordinate of the i-th edge coordinate point, the value of s(i,i+1) can be set as the minimum slope value. Similarly, in this embodiment, for s(n,1), when the abscissas of the n-th edge coordinate point and the 1-th edge coordinate point are equal, when the ordinate of the 1-th edge coordinate point is greater than the ordinate of the n-th edge coordinate point, the value of s(n,1) can be set as the maximum slope value, and when the ordinate of the 1-th edge coordinate point is less than the ordinate of the n-th edge coordinate point, the value of s(n,1) can be set as the minimum slope value. However, the values ​​of s(i,i+1) and s(n,1) can also be defined in the opposite way, that is, when the ordinate of the i+1th edge coordinate point is greater than the ordinate of the ith edge coordinate point, the value of s(i,i+1) is set as the minimum slope value, and when the ordinate of the 1st edge coordinate point is greater than the ordinate of the nth edge coordinate point, the value of s(n,1) is also set as the minimum slope value.

[0052] The above-mentioned maximum slope value and minimum slope value can be defined according to the needs, for example, the maximum slope value is defined as 15, and the minimum slope value is -15. Alternatively, the maximum slope value and the minimum slope value can also be determined based on the absolute value of the slope of other non-vertical straight lines. For example, when the maximum value of the absolute value of the slope of other non-vertical straight lines is 18.4, the maximum slope value and the minimum slope value can be set to a value greater than the maximum value, for example, 20 and -20 respectively. In addition, the maximum slope value and the minimum slope value can also vary according to the size (radius) of the capacitor. For example, when the radius of the capacitor is 6 mm, the maximum slope value and the minimum slope value are 15 and -15 respectively, but when the radius of the capacitor is 8 mm (its radius is about 1.3 times that of the former), the maximum slope value and the minimum slope value can be 1.3 times of 15 and -15 (i.e., 19.5 and -19.5). Table 1 is provided below, showing the maximum slope value and the minimum slope value that can be used under common capacitors of different radii, and the slope setting ratios of 6 mm capacitors under different sizes.

[0053]

[0054] (Table 1)

[0055] Please refer to Figure 4 , which is a further example of a vertical straight line. Figure 4In the plurality of edge coordinate points and the connecting line 40 obtained based on the closed pattern, in order to explain the case where there is a longitudinal straight line, the longitudinal straight line L and the edge coordinate points P1 and P2 at both ends are specially labeled. Since the horizontal coordinates of the edge coordinate points P1 and P2 are equal, the connecting line therebetween (i.e., the longitudinal straight line L) extends along the longitudinal axis and the slope of the connecting line cannot be calculated by mathematical calculation. Therefore, the slope value s(P1, P2) of the longitudinal straight line L must be determined by the aforementioned setting method. In this embodiment, when edge coordinate point P2 is the next edge coordinate point of edge coordinate point P1 (i.e., P1 is i and P2 is i+1), or when edge coordinate point P2 is the first edge coordinate point and edge coordinate point P1 is the last edge coordinate point (i.e., P1 is n and P2 is 1), since the ordinate of edge coordinate point P2 is greater than the ordinate of edge coordinate point P1, s(P1, P2) is set as the maximum slope value; and when edge coordinate point P1 is the next edge coordinate point of edge coordinate point P2 (i.e., P1 is i+1 and P2 is i), or when edge coordinate point P1 is the first edge coordinate point and edge coordinate point P2 is the last edge coordinate point (i.e., P2 is n and P1 is 1), since the ordinate of edge coordinate point P1 is less than the ordinate of edge coordinate point P2, s(P2, P1) is set as the minimum slope value.

[0056] Please refer to FIG. 3A to FIG. 3D , and refer to FIG. 5A to FIG. 5D ,in FIG. 5A to FIG. 5C For an image in another imaging range ( Figure 5A ) is binarized ( Figure 5B ) and then perform morphological image processing such as erosion or dilation ( Figure 5C ) after the physical capacitor image is obtained, and Figure 5D Then, a plurality of edge coordinate points arranged along the periphery of the closed pattern 52 are obtained from the physical capacitor image. Figure 3A What is presented is the case where the arc of the pattern image 31 is on the left side of the chord, while Figure 5A This is the case where the arc of the pattern image 51 is on the right side of the chord. By the aforementioned step S14, when the maximum slope value and the minimum slope value are set to 15 and -15, Figure 3D The edge coordinate points 301-307 are sequentially set as the first edge coordinate point to the last edge coordinate point, and the total slope distance W is approximately 67.9289; and Figure 5D The edge coordinate points 501-506 are set as the first edge coordinate point to the last edge coordinate point in sequence, and the slope distance total W is about -67.9289. However, as mentioned above, when the values ​​of s(i,i+1) and s(n,1) are set oppositely, the positive and negative signs of the slope distance total W are also opposite, that is, Figure 3DThe slope distance W is about -67.9289, which corresponds to Figure 5D The slope distance W is approximately 67.9289.

[0057] After the slope distance total amount W is calculated in step S14, step S15 can determine and output the polarity state of a capacitor 20 associated with the closed pattern according to the slope distance total amount W, wherein the polarity state can be "the negative pole of the capacitor is on the left side of the positive pole of the capacitor", "the negative pole of the capacitor is on the right side of the positive pole of the capacitor" or "cannot be determined". In addition, the above polarity state can be represented by only a number or symbol, for example, L represents "the negative pole of the capacitor is on the left side of the positive pole of the capacitor", R represents "the negative pole of the capacitor is on the right side of the positive pole of the capacitor", and 0 represents "cannot be determined". In detail, if Figure 6 As shown, step S15 may include sub-steps S151 to S153 as described below. In sub-step S151, it is determined whether the total amount of slope distance W falls within a positive value range or a negative value range, so as to determine whether the total amount of slope distance W calculated in step S14 is sufficient to correctly display the orientation relationship between the positive and negative electrodes of the capacitor 20. If the total amount of slope distance W falls outside the positive value range and the negative value range (that is, the value of the total amount of slope distance W with a positive value is not large enough, or the value of the total amount of slope distance W with a negative value is not small enough), it means that the total amount of slope distance W calculated this time is more likely to cause misjudgment. Preferably, since different maximum slope values ​​and minimum slope values ​​are set for capacitors of different sizes, different positive value ranges or negative value ranges can be set for capacitors of different sizes.

[0058] When sub-step S151 determines that the total slope distance W does not fall within either the positive standard value range or the negative standard value range, sub-step S152 is subsequently executed to determine that the polarity state is unable to be determined. Subsequently, step S11 can be selectively executed again in order to obtain a physical circuit board image that is more suitable for judgment, and steps S12-S15 are performed again with the re-obtained physical circuit board image. Conversely, when sub-step S151 determines that the total slope distance W falls within the positive standard value range or the negative standard value range, sub-step S153 is then executed to determine the orientation relationship between the positive and negative poles of the capacitor 20. In detail, in this embodiment, when the total slope distance W falls within the positive standard value range, the polarity state is judged to be that the negative pole of the capacitor is on the left side of the positive pole of the capacitor (i.e., Figure 3D When the slope distance total W falls within the negative value range, the polarity state is determined to be that the negative electrode of the capacitor is on the right side of the positive electrode of the capacitor (i.e. Figure 5DHowever, similarly, when the values ​​of s(i,i+1) and s(n,1) are set and defined oppositely, the polarity state when the slope distance total amount W falls within the positive value range is that the negative electrode of the capacitor is on the right side of the positive electrode of the capacitor, and the polarity state when the slope distance total amount W falls within the negative value range is that the negative electrode of the capacitor is on the left side of the positive electrode of the capacitor.

[0059] In addition, if Figure 7 As shown, in Figure 7 In step S15', before executing sub-step S151', sub-step S150 may be further executed to adjust the slope distance total amount W in a normalized manner. In detail, the normalization may be performed by dividing the slope distance total amount W by the diameter of the capacitor 20 to obtain a normalized total amount, and determining whether the normalized total amount falls within the positive standard value range or the negative standard value range. Thus, when different maximum slope values ​​and minimum slope values ​​are used for different capacitor radii, it is not necessary to set different positive standard value ranges or negative standard value ranges corresponding to different capacitor sizes, thereby omitting the storage space required for these additional settings. When sub-step S151' determines that the normalized total amount falls within the positive standard value range or the negative standard value range, sub-step S153' is executed in succession. In step S153', when the normalized total falls within the positive standard value range, the polarity state is determined to be that the negative pole of the capacitor is on the left side of the positive pole of the capacitor; and when the normalized total falls within the negative standard value range, the polarity state is determined to be that the negative pole of the capacitor is on the right side of the positive pole of the capacitor.

[0060] Finally, in actual factory manufacturing, in addition to determining the polarity state of the capacitor, it is still necessary to determine whether it meets the polarity state specified in the original specifications, and only when the polarity state is correct can it be shipped smoothly. In order to increase process efficiency, data with a preset polarity state can be added to the capacitor polarity state determination method of the present invention. In one embodiment of the present invention, the circuit board design drawing may further have preset polarity states associated with multiple electronic components. In this case, after determining the polarity state of the capacitor, it can be determined whether the polarity state is the same as the preset polarity state. 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 can be generated for warning or the determination can be repeated, and the present invention is not limited to this. Among them, the present invention does not limit the expression of the preset polarity state, but its expression must be the same as the expression of the polarity state of the determined capacitor. For example, in conjunction with the aforementioned first embodiment, the preset polarity states may 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”.

[0061] The above is a description of the first embodiment of the capacitor polarity state determination method of the present invention. The current capacitor polarity state 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 slopes multiplied together. Finally, the polarity state can be compared with the preset polarity state to see if it is consistent. Even if the image of the capacitor cannot be identified as a complete entity pattern after image preprocessing due to environmental factors, the polarity state of the capacitor can still be effectively determined, thereby reducing the error detection rate and the misjudgment rate.

[0062] See also Figure 8 , which is a flow chart of the second embodiment of the capacitor polarity state determination method of the present invention. Compared with the aforementioned first embodiment, in the second embodiment, a preliminary determination program is first executed to generate a preliminary determination polarity state, and when the preliminary determination polarity state is different from a preset polarity state, a re-determination program is executed to generate a re-determination polarity state, wherein the re-determination program is executed by the method of the aforementioned first embodiment. The purpose of the setting of this embodiment is to be able to complete the determination of the polarity state with a preliminary determination program with a small amount of calculation under normal circumstances, and in the case of abnormal polarity state determination, further confirm it with a re-determination program that has high robustness to environmental factors. Such an execution method can avoid performing the aforementioned steps S13 to S15 on each physical capacitor image, thereby improving the overall efficiency during actual production. In this embodiment, steps S21 to S24 are the aforementioned initial judgment procedure, and step S27 is the aforementioned re-judgment procedure, wherein steps S21 and S22 are the same as steps S11 and S12 of the first embodiment, and step S27 is also steps S13 to S15 of the first embodiment, so the description of steps S21 to S22 and S27 will be omitted in the following description.

[0063] Please refer again Figure 8The second embodiment of the capacitor polarity state determination method provided by the present invention may include the following steps: step S21, obtaining a physical circuit board image; step S22, comparing the physical circuit board image and the circuit board design file to obtain a physical 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 a preliminary polarity state of a capacitor associated with the closed pattern based on the arch pattern; step S25, determining whether the preliminary polarity state is the same as a preset polarity state; step S26, determining whether the preliminary polarity state is the same as a preset polarity state; step S27, determining whether the preliminary polarity state is the same as a preset polarity state; step S28, determining whether the preliminary polarity state is the same as a preset polarity state; step S29, determining whether the preliminary polarity state is the same as a preset polarity state; step S30, determining whether the preliminary polarity state is the same as a preset polarity state; step S31, determining whether the preliminary polarity state is the same as a preset polarity state; step S32, determining whether the preliminary polarity state is the same as a preset polarity state; step S33, determining whether the preliminary polarity state is the same as a preset polarity state; step S34, determining whether the preliminary polarity state is the same as a preset polarity state; step S35, determining whether the preliminary polarity state is the same as a preset polarity state; step S36, determining whether the preliminary polarity state is the same as a preset polarity state; step S37, determining whether the preliminary polarity state is the same as a preset polarity state; step S38, determining whether the preliminary polarity state is the same as a preset polarity state; step S39, determining whether the preliminary polarity state is the same as a preset polarity state; step S40, determining whether the preliminary polarity state is the same as a preset polarity state; step S41, determining whether the preliminary polarity state is the same as a preset polarity state; step S42, determining whether the preliminary polarity state is the same Step S26, when the initial polarity state is the same as the preset polarity state, output the initial polarity state; Step S27, when the initial polarity state is different from the preset polarity state, obtain multiple edge coordinate points located at the periphery of the closed pattern, calculate a slope distance total by the distance between each two adjacent edge coordinate points of the edge coordinate points and the slope of the connecting line, and generate a reverse polarity state associated with the capacitor according to the slope distance total; Step S28, determine whether the reverse polarity state is the same as the preset polarity state; and Step S29, when the reverse polarity state is the same as the preset polarity state, output the reverse polarity state. The following is a detailed explanation and example of each of the above steps.

[0064] Please also refer to Figure 8 and Fig. 9 In step S23, based on the closed pattern 52 of the physical capacitor image obtained after preprocessing the physical capacitor image, the following is further obtained: Fig. 9 A bow pattern (first bow pattern 91) is generated, wherein the first bow pattern 91 at least partially overlaps with the closed pattern 52. Preferably, the first bow pattern 91 is the smallest bow that covers the closed pattern 52, and the bow of the first bow pattern 91 is located on the left or right side of its chord. In step S24, a preliminary polarity state of the capacitor associated with the closed pattern 52 is generated based on the first bow pattern 91. According to the azimuth relationship between the bow and the chord of the first bow pattern 91, this preliminary polarity state can be obtained, wherein the preliminary polarity state can be "the negative pole of the capacitor is on the left side of the positive pole of the capacitor" or "the negative pole of the capacitor is on the right side of the positive pole of the capacitor", and the detailed process of step S24 will be described later. In the subsequent step S25, after the preliminary polarity state is generated, it is determined whether the preliminary polarity state and the preset polarity state are the same. When the initially determined polarity state is the same as the preset polarity state, step S26 is continued to output the initially determined polarity state; when the initially determined polarity state is different from the preset polarity state, step S27 is executed, that is, a further re-determination procedure is performed (that is, steps S13 to S15 of the first embodiment are executed).

[0065] After the re-judged polarity state is generated in step S27, step S28 can be continued to determine whether the re-judged polarity state is the same as the preset polarity state. In step S29, when the re-judged polarity state is the same as the preset polarity state, the re-judged polarity state can be output. If the re-judged polarity state is different from the preset polarity state, a warning signal for warning can be generated, or step S21 can be executed again and the capacitor polarity state determination method of the second embodiment can be re-executed, which is not limited by the present invention.

[0066] Please refer to Fig.10 , which is a detailed flow chart of step S24 of the capacitor polarity state determination method of the second embodiment of the present invention, generating a preliminary polarity state determination based on the first arcuate pattern 91, wherein step S24 may include sub-steps S241 to S244. For details, please refer to Fig. 9 In step S241, a circular pattern 90 can be generated based on the first arch pattern 91. Specifically, by iterating the coordinate points on the contour of the first arch pattern 91 using bisectors, the center of the circular pattern 90 and its semicircle position can be found, thereby generating a circular pattern 90, wherein the arc portion of the first arch pattern 91 overlaps the periphery of the circular pattern 90, and the portion of the periphery that does not overlap with the arc forms a second arch pattern 92 with the chord of the first arch pattern 91. Subsequently, in step S242, the area of ​​the first arch pattern 91 and the area of ​​the second arch pattern 92 are compared to obtain the size relationship between the two areas. Step S243 determines the orientation of the first arch pattern 91 and the second arch pattern 92 with a smaller area relative to the larger area. Finally, step S244 determines that the initial polarity state is that the negative electrode of the capacitor is located on the left or right side of the positive electrode of the capacitor. Specifically, the position of the first arcuate pattern 91 and the second arcuate pattern 92 with a smaller area relative to the larger area is the position of the negative electrode of the capacitor relative to its positive electrode. Figure 2 Since the solid pattern 21 on the capacitor 20 represents the position of the negative electrode relative to the positive electrode, the circular pattern 90 may correspond to the circular periphery of the capacitor 20, the first arch pattern 91 and the second arch pattern 92 with a smaller area may correspond to the solid pattern 21, and the first arch pattern 91 and the second arch pattern 92 with a larger area may correspond to the portion of the circular periphery of the capacitor 20 that does not include the solid pattern 21. Fig. 9 For example, since the first arcuate pattern 91 (the one with a smaller area) is located on the right side of the second arcuate pattern 92 (the one with a larger area), it can be determined that Fig. 9 The initial polarity state is that the negative pole of the capacitor is on the right side of the positive pole of the capacitor.

[0067] The above is a description of the implementation of the embodiment of the present invention. By means of the capacitor polarity state determination method provided by the present invention, the polarity state of the capacitor can be effectively determined even if the environment for obtaining the capacitor image is not good. Moreover, under the condition of low computing performance, the second embodiment of the present invention can be referred to. Before using the slope distance total amount to determine the polarity state of the capacitor, the area size of the first bow and the second bow is first used to determine the initial polarity state of the capacitor.

[0068] Of course, the present invention may have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for determining the polarity state of a capacitor, characterized in that: Include: Obtaining a physical circuit board image; Comparing the physical circuit board image with a circuit board design file to obtain a physical capacitor image; Obtaining a plurality of edge coordinate points in the physical capacitor image, wherein the plurality of edge coordinate points are arranged along a periphery of a closed pattern, the number of the plurality of edge coordinate points is n, and n is at least three; Calculate a slope distance total using the following equation: Wherein W is the total amount of slope distance, d(i,i+1) is the distance between the ith edge coordinate point and the i+1th edge coordinate point among the plurality of edge coordinate points, s(i,i+1) is the slope of the line between the ith edge coordinate point and the i+1th 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 line between the nth edge coordinate point and the first edge coordinate point; as well as According to whether the slope distance total or a normalized total falls within a positive standard value range or a negative standard value range, the polarity state of a capacitor associated with the closed pattern is judged and output; wherein the normalized total is obtained by dividing the slope distance total by a diameter of the capacitor.

2. The method for determining the polarity state of a capacitor according to claim 1, wherein: When the total amount of slope distance is calculated using the equation, when the abscissas of the i-th edge coordinate point and the i+1-th edge coordinate point are equal, 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 to a maximum slope value, and when the ordinate of the i+1-th edge coordinate point is less than the ordinate of the i-th edge coordinate point, the value of s(i,i+1) is set to a minimum slope value, and When the horizontal coordinates of the nth edge coordinate point and the first edge coordinate point are equal, when the vertical coordinate of the first edge coordinate point is greater than the vertical coordinate of the nth edge coordinate point, the value of s(n,1) is set to the maximum slope value, and when the vertical coordinate of the first edge coordinate point is less than the vertical coordinate of the nth edge coordinate point, the value of s(n,1) is set to the minimum slope value.

3. The method for determining the polarity state of a capacitor according to claim 1, wherein: When the slope distance total falls within the positive value range, determining that the polarity state is that the negative electrode of the capacitor is located at one of the left side and the right side of the positive electrode of the capacitor; and When the slope distance total falls within the negative value range, it is determined that the polarity state is that the negative electrode of the capacitor is located at the other of the left and right sides of the positive electrode of the capacitor.

4. The method for determining the polarity state of a capacitor according to claim 3, wherein: When it is determined that the total slope distance falls outside the positive standard value range and the negative standard value range, the polarity state is determined to be undeterminable, and another physical circuit board image containing the capacitor is obtained to determine the polarity state of the capacitor again.

5. The method for determining the polarity state of a capacitor according to claim 1, wherein: When the normalized total falls within the positive value range, determining that the polarity state is that the negative electrode of the capacitor is located at one of the left side and the right side of the positive electrode of the capacitor; and When the normalized total falls within the negative value range, the polarity state is determined to be that the negative electrode of the capacitor is located at the other of the left and right sides of the positive electrode of the capacitor.

6. The method for determining the polarity state of a capacitor according to claim 1, wherein: Comparing the physical circuit board image with the circuit board design file to obtain the physical capacitor image includes: A conversion matrix is ​​used to convert a preset capacitor coordinate of the circuit board design file into a physical capacitor coordinate of the physical circuit board image, and the physical capacitor image is obtained from an image range in the physical circuit board image that includes the physical capacitor coordinate.

7. A method for determining the polarity state of a capacitor, characterized in that: Include: Obtaining a physical circuit board image; Comparing the physical circuit board image with a circuit board design file to obtain a physical capacitor image; Obtaining a closed pattern in the physical capacitor image, and obtaining an arcuate pattern based on the closed pattern, wherein the arcuate pattern at least partially overlaps with the closed pattern; generating a preliminary polarity state of a capacitor associated with the closed pattern based on the arcuate pattern; Determining whether the initially determined polarity state is the same as a preset polarity state; When the initially determined polarity state is the same as the preset polarity state, outputting the initially determined polarity state; When the initially determined polarity state is different from the preset polarity state, a plurality of edge coordinate points located at the periphery of the closed pattern are obtained, a slope distance total is calculated based on the distance between each two adjacent edge coordinate points of the plurality of edge coordinate points and the slope of the connecting line, and a reversed polarity state associated with the capacitor is generated according to whether the slope distance total or a normalized total falls within a positive value range or a negative value range; Determining whether the re-determined polarity state and the preset polarity state are the same; as well as When the redetermined polarity state is the same as the preset polarity state, the redetermined polarity state is output.

8. The method for determining the polarity state of a capacitor according to claim 7, wherein: Defining the arcuate pattern as a first arcuate pattern, and generating the initial polarity state of the capacitor associated with the closed pattern based on the first arcuate pattern comprises: Generating a circular pattern according to the first arcuate pattern, wherein the arc portion of the first arcuate pattern overlaps the periphery of the circular pattern, and the portion of the periphery not overlapping with the arc and the chord of the first arcuate pattern form a second arcuate pattern; comparing an area of ​​the first arcuate pattern and an area of ​​the second arcuate pattern; and It is determined that the first arch pattern and the second arch pattern are respectively a smaller area and a larger area, and the orientation of the smaller area relative to the larger area is the orientation of the negative electrode of the capacitor relative to the positive electrode of the capacitor.

9. The method for determining the polarity state of a capacitor according to claim 7, wherein: The plurality of 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.

10. The method for determining the polarity state of a capacitor according to claim 9, wherein: Calculating the total amount of slope distance based on the distance between every two adjacent edge coordinate points of the plurality of edge coordinate points and the slope of the connecting line comprises: The slope distance amount is calculated using the following equation: Wherein W is the total slope distance, d(i,i+1) is the distance between the i-th edge coordinate point and the i+1-th edge coordinate point among the multiple edge coordinate points, s(i,i+1) is the slope of the line between the i-th edge coordinate point and the i+1-th edge coordinate point, d(n,1) is the distance between the n-th edge coordinate point and the first edge coordinate point among the multiple edge coordinate points, and s(n,1) is the slope of the line between the n-th edge coordinate point and the first edge coordinate point.

Citation Information

Patent Citations

  • Electronic component inspection system and electronic component inspection method

    CN103869215A

  • Method and system for judging polarity of electrolytic capacitor by utilizing image

    CN109870141A