CN104537650B - Polarity direction determination method and device for aluminum electrolytic capacitor - Google Patents

Polarity direction determination method and device for aluminum electrolytic capacitor Download PDF

Info

Publication number
CN104537650B
CN104537650B CN201410784101.2A CN201410784101A CN104537650B CN 104537650 B CN104537650 B CN 104537650B CN 201410784101 A CN201410784101 A CN 201410784101A CN 104537650 B CN104537650 B CN 104537650B
Authority
CN
China
Prior art keywords
gray
image
electrolytic capacitor
aluminum electrolytic
scale
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.)
Active
Application number
CN201410784101.2A
Other languages
Chinese (zh)
Other versions
CN104537650A (en
Inventor
张玉兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shikun Electronic Technology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyuan Electronics Thecnology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201410784101.2A priority Critical patent/CN104537650B/en
Publication of CN104537650A publication Critical patent/CN104537650A/en
Application granted granted Critical
Publication of CN104537650B publication Critical patent/CN104537650B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a polarity direction determination method and a polarity direction determination device for an aluminum electrolytic capacitor, wherein the method comprises the following steps: acquiring a single-channel gray scale image of the aluminum electrolytic capacitor; carrying out thresholding operation on the single-channel gray-scale image to obtain a thresholded image; generating a circular ring image of the aluminum electrolytic capacitor according to the outline information of the thresholding image; counting the pixel gray value of the circular ring image; and judging the polarity direction of the aluminum electrolytic capacitor according to the statistical result. The embodiment of the invention can quickly identify the polarity direction of the aluminum electrolytic capacitor, improve the judgment efficiency and save the production cost.

Description

Polarity direction determination method and device for aluminum electrolytic capacitor
Technical Field
The invention relates to the technical field of optical detection, in particular to a polarity direction determination method and device for an aluminum electrolytic capacitor.
Background
The aluminum electrolytic capacitor is made by using an aluminum cylinder as a negative electrode, filling liquid electrolyte in the aluminum cylinder and inserting a bent aluminum strip as a positive electrode. The anode sheet is processed by direct current voltage to form an oxide film as a medium. It features large capacity, large leakage, poor stability, positive and negative polarities, and is suitable for power filter or low-frequency circuit. The direction judgment of the existing aluminum electrolytic capacitor depends on manually using a universal meter to detect the leakage current and the leakage resistance of the capacitor and then judging the polarity direction of the capacitor. This determination method is based on circuit detection, and has a slow determination speed, low efficiency, and high cost.
Disclosure of Invention
The embodiment of the invention provides a method and a device for judging the polarity direction of an aluminum electrolytic capacitor, which can quickly identify the polarity direction of the aluminum electrolytic capacitor, improve the judgment efficiency and save the production cost.
In one aspect, an embodiment of the present invention provides a method for determining a polarity direction of an aluminum electrolytic capacitor, including:
acquiring a single-channel gray scale image of the aluminum electrolytic capacitor;
performing thresholding operation on the single-channel gray-scale image to obtain a thresholded image;
generating a ring image of the aluminum electrolytic capacitor according to the outline information of the thresholding image;
counting the pixel gray value of the circular ring image;
and judging the polarity direction of the aluminum electrolytic capacitor according to the statistical result.
Further, the generating a ring image of the aluminum electrolytic capacitor according to the contour information includes:
fitting the contours of the thresholded image into a first circle according to the contour information;
acquiring the circle center and the first radius of the first circle, and generating a second circle according to the circle center and a preset second radius of the first circle; wherein the second radius is greater than the first radius; and generating a ring image of the aluminum electrolytic capacitor according to the area enclosed by the first circle and the second circle.
Further, the counting the gray value of the pixel of the circular ring image includes:
calculating to obtain a gray average value of the ring image according to the gray value of each pixel of the ring image, and counting to obtain a first pixel number and a second pixel number according to the gray average value, wherein the first pixel number is the number of the ring image with the gray value of the pixel larger than the gray average value, and the second pixel number is the number of the ring image with the gray value of the pixel smaller than or equal to the gray average value;
and counting the sum of pixel gray values in the upper direction, the lower direction, the left direction and the right direction of the circular ring according to the pixel gray values of the circular ring image and a preset angle direction to respectively obtain the upper total gray, the lower total gray, the left total gray and the right total gray.
Further, the determining the polarity direction of the aluminum electrolytic capacitor according to the statistical result includes:
comparing the number of the first pixels with the number of the second pixels;
if the number of the first pixels is larger than that of the second pixels, extracting the direction with the minimum numerical value among the upper total gray scale, the lower total gray scale, the left total gray scale and the right total gray scale, and judging that the direction with the minimum numerical value is the polarity direction of the aluminum electrolytic capacitor;
and if the number of the first pixels is less than that of the second pixels, extracting the direction with the maximum numerical value among the upper total gray scale, the lower total gray scale, the left total gray scale and the right total gray scale, and judging that the direction with the maximum numerical value is the polarity direction of the aluminum electrolytic capacitor.
Further, the acquiring a single-channel gray-scale map of the aluminum electrolytic capacitor includes:
and acquiring a three-channel RGB color image of the aluminum electrolytic capacitor, and converting the RGB color image into a single-channel gray-scale image.
Further, the performing a thresholding operation on the single-channel gray-scale map to obtain a thresholded image includes:
respectively calculating to obtain inter-class variance and total variance according to the gray value of each pixel of the single-channel gray image;
calculating and obtaining a critical gray value grade used for the thresholding operation according to the between-class variance and the overall variance;
and setting a threshold value of the single-channel gray-scale image according to the critical gray-scale value level, performing thresholding operation on the single-channel gray-scale image according to the threshold value of the single-channel gray-scale image, and converting the single-channel gray-scale image into a thresholded image.
In another aspect, an embodiment of the present invention provides a polarity direction determination device for an aluminum electrolytic capacitor, including:
the acquisition module is used for acquiring a single-channel gray-scale image of the aluminum electrolytic capacitor;
the thresholding module is used for carrying out thresholding operation on the single-channel gray-scale image to obtain a thresholded image;
the image generation module is used for generating a ring image of the aluminum electrolytic capacitor according to the outline information of the thresholding image;
the statistical module is used for counting the pixel gray value of the circular ring image;
and the judging module is used for judging the polarity direction of the aluminum electrolytic capacitor according to the statistical result.
Further, the image generation module includes:
a circle fitting unit for fitting the contours of the thresholded image into a first circle according to the contour information;
the circular setting unit is used for acquiring the circle center and the first radius of the first circle and generating a second circle according to the circle center and a preset second radius of the first circle, wherein the second radius is larger than the first radius; and,
and the circular ring generating unit is used for generating a circular ring image of the aluminum electrolytic capacitor according to the area surrounded by the first circle and the second circle, wherein the circular ring image is the area surrounded by the first circle and the second circle.
Further, the statistic module comprises:
the first statistical unit is used for calculating and obtaining a gray average value of the ring image according to the gray value of each pixel of the ring image, and counting and obtaining a first pixel number and a second pixel number according to the gray average value, wherein the first pixel number is the number of the gray value of the pixel of the ring image larger than the gray average value, and the second pixel number is the number of the gray value of the pixel of the ring image smaller than or equal to the gray average value; and,
and the second statistical unit is used for counting the sum of pixel gray values in the upper direction, the lower direction, the left direction and the right direction of the circular ring according to the pixel gray values of the circular ring image and a preset angle direction, and respectively obtaining the upper total gray, the lower total gray, the left total gray and the right total gray.
Further, the determination module includes:
the comparison unit is used for comparing the number of the first pixels with the number of the second pixels; and,
a judging unit, configured to extract a direction in which a numerical value between the upper total gray scale, the lower total gray scale, the left total gray scale, and the right total gray scale is minimum when the comparing unit determines that the number of the first pixels is greater than the number of the second pixels, and judge that the direction in which the numerical value is minimum is a polarity direction of the aluminum electrolytic capacitor; and when the comparison unit determines that the number of the first pixels is smaller than the number of the second pixels, extracting the direction with the largest numerical value among the upper total gray scale, the lower total gray scale, the left total gray scale and the right total gray scale, and judging that the direction with the largest numerical value is the polarity direction of the aluminum electrolytic capacitor.
Therefore, the implementation of the embodiment of the invention has the following beneficial effects:
according to the polarity judgment method of the aluminum electrolytic capacitor, provided by the embodiment of the invention, the aluminum electrolytic capacitor is shot through the camera, a single-channel gray-scale image of the aluminum electrolytic capacitor is obtained, and thresholding operation is carried out on the single-channel gray-scale image. And generating a ring image according to the contour information of the thresholding image, counting the gray value of each pixel in a ring area in the ring image, and judging the polarity direction of the aluminum electrolytic capacitor according to the statistical result. Compared with the traditional method for detecting leakage resistance and leakage current by adopting manual or automatic equipment in the prior art, the method can judge the direction of the aluminum electrolytic capacitor by the shot picture only by adding one camera on the production line, and has the advantages of high judging speed and cost saving.
Drawings
Fig. 1 is a schematic flow chart of an embodiment of a polarity direction determination method for an aluminum electrolytic capacitor according to the present invention;
FIG. 2 is a schematic diagram of a circular ring structure of an embodiment of a circular ring image provided by the present invention;
FIG. 3 is a schematic flow chart of an embodiment of a polarity direction determination apparatus for an aluminum electrolytic capacitor according to the present invention;
FIG. 4 is a schematic structural diagram of an embodiment of an image generation module provided by the present invention;
FIG. 5 is a schematic structural diagram of an embodiment of a statistics module provided by the present invention;
fig. 6 is a schematic structural diagram of an embodiment of a determining module provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
Referring to fig. 1, it is a schematic flow chart of an embodiment of a method for determining a polarity direction of an aluminum electrolytic capacitor provided by the present invention, the method includes the following steps:
step 101: and acquiring a single-channel gray-scale image of the aluminum electrolytic capacitor.
In this embodiment, a picture of the aluminum electrolytic capacitor is obtained by a camera, and the picture can be a three-channel RGB color picture or a single-channel gray scale image directly. If a color camera is used for acquiring pictures to acquire RGB color pictures of three channels, the color pictures need to be converted into a gray scale image of a single channel.
In this embodiment, the RGB color picture is converted into a single-channel grayscale map by the following formula:
Gray=(R×30+G×59+B×11)/100
step 102: and carrying out thresholding operation on the single-channel gray-scale image to obtain a thresholded image.
In this embodiment, before performing the thresholding operation, the single-channel grayscale image needs to be smoothed according to a preset convolution mask to remove noise generated in the image acquisition process, and specifically, the smoothing process may be performed by the following formula.
Wherein F (x, y) is the pixel gray scale value before the smoothing processing, F (x, y) is the pixel gray scale value after the smoothing processing,is a convolution mask for the smoothing process.
In the present embodiment, the thresholding operation is based on the principle of maximizing the inter-class variance, which is to maximize the ratio of the inter-class variance to the global variance. The thresholding operation is specifically: the gray scale value range of the single channel gray scale map is divided into L gray scale levels, and the common gray scale level is 0 to 255. Then defining the number of pixels with the gray value at the ith gray level in the gray level image as niTherefore, the total number of pixels N in the gray-scale image is N1+n2+…+nLProbability of one pixel being at ith gray levelAnd isThus, the thresholding operation can be represented using the following data model:
wherein,
and isWherein,is the inter-class variance for the thresholding operation,is the overall variance for the thresholding operation. The k found is the critical gray value level used for thresholding.
In this embodiment, according to the gray value of each pixel of the single-channel gray image, the inter-class variance and the total variance are respectively obtained through calculation according to the above formula, then the critical gray level for thresholding operation is obtained through calculation according to the inter-class variance and the total variance, the threshold corresponding to the single-channel gray image is set according to the obtained critical gray level, thresholding operation is performed on the single-channel gray image according to the threshold, and the gray value of each pixel of the gray image is adjusted, so that the single-channel gray image is converted into a thresholded image.
Step 103: and generating a circular ring image of the aluminum electrolytic capacitor according to the outline information of the thresholding image.
In this embodiment, after obtaining the thresholded image, extracting profile information of the thresholded image, fitting the profile of the thresholded image into a first circle according to the profile information, obtaining a circle center and a first radius of the first circle, and generating a second circle according to the circle center and a preset second radius of the first circle, where the second radius is greater than the first radius. And finally, generating a circular ring image of the aluminum electrolytic capacitor according to the area enclosed by the first circle and the second circle. In this embodiment, the extracted contour is fitted to the first circle by using a least square method, wherein the fitting formula is:wherein (x-a)2+(y-b)2=r2And (a, b) are coordinates of the circle center after fitting, and r is the radius of the circle after fitting.
Step 104: and counting the pixel gray value of the circular ring image, and judging the polarity direction of the aluminum electrolytic capacitor according to the counting result.
In this embodiment, the counting the pixel gray values of the circular ring image includes: number statistics and region statistics. Wherein, the number statistics specifically are: and calculating to obtain the gray average value of the annular image according to the gray value of each pixel of the annular image, and counting to obtain the number of the first pixels and the number of the second pixels according to the gray average value. The first number of pixels is the number of the gray value of the pixels of the annular image larger than the average value of the gray values, and the second number of pixels is the number of the gray value of the pixels of the annular image smaller than or equal to the average value of the gray values.
In this embodiment, the gray level average value can be calculated by using the following formula:
wherein v ismeanThe total number n of pixel gradations of the annular image is n as the gradation average value1+n2,n1Is the first pixel number, n2The number of the second pixels.
In this embodiment, the region statistics specifically include: and according to the gray value of each pixel of the circular ring image, counting the sum of the gray values of the pixels in the upper, lower, left and right directions of the circular ring according to a preset angle direction, and respectively obtaining the upper total gray, the lower total gray, the left total gray and the right total gray.
In this embodiment, as shown in fig. 2, the preset angular directions may be, but are not limited to, 45 degrees, 135 degrees, 225 degrees, and 315 degrees, the annular image is divided into four regions, an upper region, a lower region, a left region, a right region, and a left region, the sum of the gray-level values of the pixels in the four regions is calculated and recorded as Sup,Sdown,Sl,Sr
Step 105: and judging the polarity direction of the aluminum electrolytic capacitor according to the statistical result.
In the present embodiment, the aluminum electrolytic capacitor is caused by the polarity direction thereofThe difference between the gray value sum of the area where the aluminum electrolytic capacitor is located and the gray value sum of other areas is larger, so that the number of the first pixels and the number of the second pixels can be compared, if the number of the first pixels is larger than the number of the second pixels, the area with the minimum gray value sum is the polarity direction of the aluminum electrolytic capacitor, and then the comparison S is carried outup,Sdown,Sl,SrThe direction of the minimum value is the polarity direction of the aluminum electrolytic capacitor. If the number of the first pixels is less than the number of the second pixels, the area with the maximum sum of the gray values is the polarity direction of the aluminum electrolytic capacitor, and the comparison S is carried outup,Sdown,Sl,SrThe direction of the maximum value is the polarity direction of the aluminum electrolytic capacitor.
As can be seen from the above, in the polarity determination method for an aluminum electrolytic capacitor provided in the embodiment of the present invention, the aluminum electrolytic capacitor is photographed by the camera, a single-channel grayscale image of the aluminum electrolytic capacitor is obtained, and the thresholding operation is performed on the single-channel grayscale image. And generating a ring image according to the contour information of the thresholding image, counting the gray value of each pixel in a ring area in the ring image, and judging the polarity direction of the aluminum electrolytic capacitor according to the statistical result. Compared with the traditional method for detecting leakage resistance and leakage current by adopting manual or automatic equipment in the prior art, the method can judge the direction of the aluminum electrolytic capacitor by the shot picture only by adding one camera on the production line, and has the advantages of high judging speed and cost saving.
In the scene of the automatic optical inspection element of the PCB, the direction of the aluminum electrolytic capacitor can be judged by giving the collected picture of the aluminum electrolytic capacitor, and whether the aluminum electrolytic capacitor is inserted reversely or not can be detected by comparing the direction with the required direction, so that the product quality is improved. In addition, according to the technical scheme of the invention, only one camera is required to be additionally arranged on the production line, other mechanical processes are not required to be added, the original production process is not influenced, and the application range is wide.
Example 2
Referring to fig. 3, fig. 3 is a schematic flow chart of an embodiment of a polarity direction determination apparatus for an aluminum electrolytic capacitor according to the present invention. The determination device includes: an acquisition module 301, a thresholding module 302, an image generation module 303, a statistics module 304, and a decision module 305.
An obtaining module 301, configured to obtain a single-channel grayscale map of the aluminum electrolytic capacitor.
And the thresholding module 302 is electrically connected with the acquisition module 301 and is used for performing thresholding operation on the single-channel gray-scale image to obtain a thresholded image.
And the image generation module 303 is electrically connected with the thresholding module 302 and is used for generating a circular ring image of the aluminum electrolytic capacitor according to the outline information of the thresholding image.
And the counting module 304 is electrically connected with the image generating module 303 and is used for counting the pixel gray value of the annular image.
And the judging module 305 is electrically connected with the counting module 304 and is used for judging the polarity direction of the aluminum electrolytic capacitor according to the counting result.
In this embodiment, referring to fig. 4, fig. 4 is a schematic structural diagram of an embodiment of the image generation module 303 provided in the present invention. As shown in fig. 4, the image generation module 303 includes: a circle fitting unit 3031 for fitting the contours of the thresholded image into a first circle according to the contour information; the circle setting unit 3032 is configured to obtain a circle center and a first radius of the first circle, and generate a second circle according to the circle center and a preset second radius of the first circle, where the second radius is greater than the first radius; and a circular ring generating unit 3033 configured to generate a circular ring image of the aluminum electrolytic capacitor according to a region surrounded by the first circle and the second circle.
In this embodiment, referring to fig. 5, fig. 5 is a schematic structural diagram of an embodiment of the statistics module 304 provided in the present invention. As shown in fig. 5, the statistics module 304 includes: a first statistical unit 3041, configured to calculate and obtain a gray average value of the ring image according to the gray value of each pixel of the ring image, and obtain the number of the first pixels and the number of the second pixels according to the gray average value; the number of the first pixels is the number that the gray value of the pixels of the annular image is larger than the average value of the gray values, and the number of the second pixels is the number that the gray value of the pixels of the annular image is smaller than or equal to the average value of the gray values; the second statistical unit 3042 is configured to, according to the gray value of each pixel of the ring image, perform statistics on the sum of the gray values of the pixels in the upper, lower, left, and right directions of the ring according to the preset angle direction, so as to obtain an upper total gray, a lower total gray, a left total gray, and a right total gray, respectively.
In this embodiment, referring to fig. 6, fig. 6 is a schematic structural diagram of an embodiment of the determining module 305 provided in the present invention. As shown in fig. 6, the determination module 305 includes: a comparing unit 3051, configured to compare the number of the first pixels with the number of the second pixels; a determination unit 3052, configured to, when the comparison unit determines that the number of the first pixels is greater than the number of the second pixels, extract a direction in which a value between the upper total grayscale, the lower total grayscale, the left total grayscale, and the right total grayscale is the smallest, and determine that the direction in which the value is the smallest is a polarity direction of the aluminum electrolytic capacitor; and when the comparison unit determines that the number of the first pixels is smaller than that of the second pixels, extracting the direction with the largest numerical value among the upper total gray scale, the lower total gray scale, the left total gray scale and the right total gray scale, and judging that the direction with the largest numerical value is the polarity direction of the aluminum electrolytic capacitor.
In this embodiment, the obtaining module 301 is further configured to obtain a three-channel RGB color image of the aluminum electrolytic capacitor, and convert the RGB color image into a single-channel grayscale image.
In this embodiment, the threshold module 302 is specifically configured to: respectively calculating to obtain inter-class variance and total variance according to the gray value of each pixel of the single-channel gray image; calculating to obtain a critical gray value grade for thresholding operation according to the between-class variance and the overall variance; and setting a threshold value of the single-channel gray-scale image according to the critical gray-scale value level, performing thresholding operation on the single-channel gray-scale image according to the threshold value of the single-channel gray-scale image, and converting the single-channel gray-scale image into a thresholded image.
The detailed implementation flow and operation principle of this embodiment can refer to the related contents described in embodiment 1, but not limited thereto.
As can be seen from the above, in the polarity direction determination apparatus for an aluminum electrolytic capacitor provided in this embodiment, the single-channel grayscale image of the aluminum electrolytic capacitor is obtained by the obtaining module 301, the thresholding module 302 converts the single-channel grayscale image into a thresholded image, the image generating module generates a ring image of the aluminum electrolytic capacitor according to the contour information of the thresholded image, the statistical module performs statistics on the pixel grayscale values of the ring image, and finally the determination module determines the polarity direction of the aluminum electrolytic capacitor according to the statistical result. Compared with the traditional method for detecting leakage resistance and leakage current by adopting manual or automatic equipment in the prior art, the method can judge the direction of the aluminum electrolytic capacitor by the shot picture only by adding one camera on the production line, and has the advantages of high judging speed and cost saving.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (8)

1. A method for determining a polarity direction of an aluminum electrolytic capacitor, comprising:
acquiring a single-channel gray scale image of the aluminum electrolytic capacitor;
performing thresholding operation on the single-channel gray-scale image to obtain a thresholded image;
generating a ring image of the aluminum electrolytic capacitor according to the outline information of the thresholding image;
counting the pixel gray value of the circular ring image;
judging the polarity direction of the aluminum electrolytic capacitor according to the statistical result;
generating a ring image of the aluminum electrolytic capacitor according to the contour information of the thresholding image, comprising:
fitting the outline of the thresholded image into a first circle according to the outline information of the thresholded image;
acquiring the circle center and the first radius of the first circle, and generating a second circle according to the circle center and a preset second radius of the first circle; wherein the second radius is greater than the first radius;
and generating a ring image of the aluminum electrolytic capacitor according to the area enclosed by the first circle and the second circle.
2. The method for determining the polarity direction of the aluminum electrolytic capacitor according to claim 1, wherein the step of counting the gray-scale values of the pixels of the circular ring image comprises:
calculating to obtain a gray average value of the ring image according to the gray value of each pixel of the ring image, and counting to obtain a first pixel number and a second pixel number according to the gray average value, wherein the first pixel number is the number of the ring image with the gray value of the pixel larger than the gray average value, and the second pixel number is the number of the ring image with the gray value of the pixel smaller than or equal to the gray average value;
and counting the sum of pixel gray values in the upper direction, the lower direction, the left direction and the right direction of the circular ring according to the pixel gray values of the circular ring image and a preset angle direction to respectively obtain the upper total gray, the lower total gray, the left total gray and the right total gray.
3. The method for determining the polarity direction of the aluminum electrolytic capacitor according to claim 2, wherein the determining the polarity direction of the aluminum electrolytic capacitor according to the statistical result comprises:
comparing the number of the first pixels with the number of the second pixels;
if the number of the first pixels is larger than that of the second pixels, extracting the direction with the minimum numerical value among the upper total gray scale, the lower total gray scale, the left total gray scale and the right total gray scale, and judging that the direction with the minimum numerical value is the polarity direction of the aluminum electrolytic capacitor;
and if the number of the first pixels is less than that of the second pixels, extracting the direction with the maximum numerical value among the upper total gray scale, the lower total gray scale, the left total gray scale and the right total gray scale, and judging that the direction with the maximum numerical value is the polarity direction of the aluminum electrolytic capacitor.
4. The method for determining the polarity direction of the aluminum electrolytic capacitor according to any one of claims 1 to 3, wherein the acquiring a single-channel gray-scale map of the aluminum electrolytic capacitor comprises:
and acquiring a three-channel RGB color image of the aluminum electrolytic capacitor, and converting the RGB color image into a single-channel gray-scale image.
5. The method for determining the polarity direction of the aluminum electrolytic capacitor according to any one of claims 1 to 3, wherein the thresholding operation on the single-channel gray-scale map to obtain a thresholded image comprises:
respectively calculating to obtain inter-class variance and total variance according to the gray value of each pixel of the single-channel gray image;
calculating and obtaining a critical gray value grade used for the thresholding operation according to the between-class variance and the overall variance;
and setting a threshold value of the single-channel gray-scale image according to the critical gray-scale value level, performing thresholding operation on the single-channel gray-scale image according to the threshold value of the single-channel gray-scale image, and converting the single-channel gray-scale image into a thresholded image.
6. A polarity direction determination device for an aluminum electrolytic capacitor, comprising:
the acquisition module is used for acquiring a single-channel gray-scale image of the aluminum electrolytic capacitor;
the thresholding module is used for carrying out thresholding operation on the single-channel gray-scale image to obtain a thresholded image;
the image generation module is used for generating a ring image of the aluminum electrolytic capacitor according to the outline information of the thresholding image;
the statistical module is used for counting the pixel gray value of the circular ring image;
the judging module is used for judging the polarity direction of the aluminum electrolytic capacitor according to the statistical result;
the image generation module includes:
a circle fitting unit for fitting the contours of the thresholded image into a first circle according to the contour information of the thresholded image;
the circular setting unit is used for acquiring the circle center and the first radius of the first circle and generating a second circle according to the circle center and a preset second radius of the first circle, wherein the second radius is larger than the first radius; and,
and the circular ring generating unit is used for generating a circular ring image of the aluminum electrolytic capacitor according to the area surrounded by the first circle and the second circle.
7. The polarity direction determination device of an aluminum electrolytic capacitor according to claim 6, wherein the statistical module comprises:
the first statistical unit is used for calculating and obtaining a gray average value of the ring image according to the gray value of each pixel of the ring image, and counting and obtaining a first pixel number and a second pixel number according to the gray average value, wherein the first pixel number is the number of the gray value of the pixel of the ring image larger than the gray average value, and the second pixel number is the number of the gray value of the pixel of the ring image smaller than or equal to the gray average value; and,
and the second statistical unit is used for counting the sum of pixel gray values in the upper direction, the lower direction, the left direction and the right direction of the circular ring according to the pixel gray values of the circular ring image and a preset angle direction, and respectively obtaining the upper total gray, the lower total gray, the left total gray and the right total gray.
8. The polarity direction determination device for aluminum electrolytic capacitors according to claim 7, wherein the determination module comprises:
the comparison unit is used for comparing the number of the first pixels with the number of the second pixels; and,
a judging unit, configured to extract a direction in which a numerical value between the upper total gray scale, the lower total gray scale, the left total gray scale, and the right total gray scale is minimum when the comparing unit determines that the number of the first pixels is greater than the number of the second pixels, and judge that the direction in which the numerical value is minimum is a polarity direction of the aluminum electrolytic capacitor; and when the comparison unit determines that the number of the first pixels is smaller than the number of the second pixels, extracting the direction with the largest numerical value among the upper total gray scale, the lower total gray scale, the left total gray scale and the right total gray scale, and judging that the direction with the largest numerical value is the polarity direction of the aluminum electrolytic capacitor.
CN201410784101.2A 2014-12-16 2014-12-16 Polarity direction determination method and device for aluminum electrolytic capacitor Active CN104537650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410784101.2A CN104537650B (en) 2014-12-16 2014-12-16 Polarity direction determination method and device for aluminum electrolytic capacitor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410784101.2A CN104537650B (en) 2014-12-16 2014-12-16 Polarity direction determination method and device for aluminum electrolytic capacitor

Publications (2)

Publication Number Publication Date
CN104537650A CN104537650A (en) 2015-04-22
CN104537650B true CN104537650B (en) 2017-11-03

Family

ID=52853169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410784101.2A Active CN104537650B (en) 2014-12-16 2014-12-16 Polarity direction determination method and device for aluminum electrolytic capacitor

Country Status (1)

Country Link
CN (1) CN104537650B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105513046B (en) * 2015-11-23 2019-03-01 广州视源电子科技股份有限公司 Electronic component polarity identification method and system, and labeling method and system
CN105631893A (en) * 2016-03-09 2016-06-01 中国矿业大学 Method and device for detecting whether capacitor is correctly mounted through photographing
CN106204542B (en) * 2016-06-29 2019-04-19 上海晨兴希姆通电子科技有限公司 Visual identity method and system
CN109870141B (en) * 2017-12-05 2021-07-06 英业达科技有限公司 Method and system for judging polarity of electrolytic capacitor by using image
CN109870469A (en) * 2017-12-05 2019-06-11 英业达科技有限公司 The method and system of printed circuit board of the detection with electrolytic capacitor
CN109632798A (en) * 2019-01-17 2019-04-16 鲁班嫡系机器人(深圳)有限公司 Device for detecting polarity and its method based on image procossing
CN110333240B (en) * 2019-07-03 2022-01-07 珠海格力智能装备有限公司 Method and device for detecting appearance of capacitor, storage medium and processor
CN111007441B (en) * 2019-12-16 2022-12-02 深圳市振邦智能科技股份有限公司 Electrolytic capacitor polarity detection method and detection system
CN112378908A (en) * 2020-11-09 2021-02-19 日立楼宇技术(广州)有限公司 Capacitor polarity installation detection device and detection method
CN117197248B (en) * 2023-11-08 2024-01-26 成都数之联科技股份有限公司 Electrolytic capacitor direction judging method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6310985B1 (en) * 1998-07-29 2001-10-30 Electroglas, Inc. Measuring angular rotation of an object
CN101114335A (en) * 2007-07-19 2008-01-30 南京大学 Full angle rapid fingerprint identification method
CN101118263A (en) * 2006-08-04 2008-02-06 华硕电脑股份有限公司 Polar direction automatic detection method of polar element
CN103675588A (en) * 2013-11-20 2014-03-26 中国矿业大学 Printed circuit element polarity machine vision detection method and device
CN103745475A (en) * 2014-01-22 2014-04-23 哈尔滨工业大学 Detection and positioning method used for spherical pin element

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6310985B1 (en) * 1998-07-29 2001-10-30 Electroglas, Inc. Measuring angular rotation of an object
CN101118263A (en) * 2006-08-04 2008-02-06 华硕电脑股份有限公司 Polar direction automatic detection method of polar element
CN101114335A (en) * 2007-07-19 2008-01-30 南京大学 Full angle rapid fingerprint identification method
CN103675588A (en) * 2013-11-20 2014-03-26 中国矿业大学 Printed circuit element polarity machine vision detection method and device
CN103745475A (en) * 2014-01-22 2014-04-23 哈尔滨工业大学 Detection and positioning method used for spherical pin element

Also Published As

Publication number Publication date
CN104537650A (en) 2015-04-22

Similar Documents

Publication Publication Date Title
CN104537650B (en) Polarity direction determination method and device for aluminum electrolytic capacitor
CN107705288B (en) Infrared video detection method for dangerous gas leakage under strong interference of pseudo-target motion
CN103345766B (en) A kind of signal lamp recognition methods and device
CN116309579A (en) Transformer welding seam quality detection method using image processing
CN113313677B (en) Quality detection method for X-ray image of wound lithium battery
CN105405142A (en) Edge defect detection method and system for glass panel
CN109034017A (en) Head pose estimation method and machine readable storage medium
CN109413411B (en) Black screen identification method and device of monitoring line and server
CN108133216B (en) Nixie tube reading identification method capable of realizing decimal point reading based on machine vision
CN108596062B (en) Face picture real-time highlight removal method and device based on deep learning
CN106251333B (en) Element reverse detection method and system
CN105139391B (en) A kind of haze weather traffic image edge detection method
CN109376740A (en) A kind of water gauge reading detection method based on video
CN103413311A (en) Edge-based fuzzy detection method
CN103971135A (en) Human body target detection method based on head and shoulder depth information features
CN103925893A (en) Quality detection method of battery cells
CN111047624A (en) Image dim target detection method, device, equipment and storage medium
CN106651831B (en) Bamboo block defect detection method and system
CN113487563B (en) EL image-based self-adaptive detection method for hidden cracks of photovoltaic module
CN105760869B (en) Examination paper marking method based on image gray level recognition and processing
CN104463134A (en) License plate detection method and system
Hou et al. Welding image edge detection and identification research based on canny operator
CN104574312A (en) Method and device of calculating center of circle for target image
CN106709952A (en) Automatic calibration method of display screen
CN114581446A (en) Battery core abnormity detection method and system of laminated battery

Legal Events

Date Code Title Description
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20181031

Address after: 510663 3, 310, No. 192, Ke Zhu Road, Guangzhou high tech Industrial Development Zone, Guangdong

Patentee after: GUANGZHOU SHIKUN ELECTRONICS Co.,Ltd.

Address before: 510663, 4, No. 192, Ke Zhu Road, science and Technology City, Guangzhou high tech Industrial Development Zone, Guangdong

Patentee before: Guangzhou Shiyuan Electronic Technology Company Limited

TR01 Transfer of patent right