A visual detection method and system for electronic cigarette heating wire defects

By processing the grayscale image of the electronic cigarette heating wire, screening and analyzing the component signals of the pixel column, the accuracy problem of traditional methods in detecting fancy heating wires is solved, and more efficient and accurate defect detection is achieved.

CN118229666BActive Publication Date: 2024-10-18SHENZHEN IMPETUS TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410515626.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-26
Publication Date
2024-10-18
Estimated Expiration
2044-04-26

AI Technical Summary

Technical Problem

The traditional adaptive threshold segmentation algorithm is difficult to accurately process images of fancy heating wires, resulting in a decrease in the accuracy of electronic cigarette heating wire defect detection.

Method used

The grayscale image processing method is used to filter the pixel columns of the heating wire, calculate the periodicity possibility of the component signal, obtain the periodic and noise component signals, and then determine the probability of the pixel being located in the defective area to achieve visual inspection of the electronic cigarette heating wire.

Benefits of technology

The efficiency and accuracy of electronic cigarette heating wire defect detection are improved, and defective areas can be identified more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118229666B_ABST
    Figure CN118229666B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image data processing, and specifically to a method and system for visually detecting defects in electronic cigarette heating wires, including: collecting grayscale images of electronic cigarette heating wires, screening out multiple heating wire pixel columns, calculating the possibility that several component signals of each heating wire pixel value segment are periodic signals according to the heating wire pixel columns, obtaining the probability that each pixel point on each heating wire pixel value segment is located in a defective area according to a periodic component signal and several noise component signals of the heating wire pixel value segment of each heating wire pixel column, and obtaining the visual detection result of the surface of the electronic cigarette heating wire according to the probability that each pixel point on each heating wire pixel value segment is located in a defective area. The present invention improves the accuracy of detecting defects in the electronic cigarette heating wire by judging that the pixel points on the electronic cigarette heating wire image are located in the defective area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image data processing, and in particular to a method and system for visually detecting defects in heating wires of electronic cigarettes. Background Art

[0002] As an electronic device that replaces traditional tobacco, electronic cigarettes have rapidly risen in recent years and have become one of the most popular consumer products worldwide. One of the core components of electronic cigarettes is the heating wire, which is responsible for heating the e-liquid to produce atomization, thereby generating smoke. As an improved heating wire, the fancy heating wire has a unique structural design that makes heating more uniform and temperature control more precise, avoiding overheating or overcooling, improving the safety of electronic cigarettes, and providing electronic cigarettes with better performance.

[0003] Although fancy heating wires bring many advantages, their special structure also brings some difficulties and technical problems in detection. When processing images of fancy heating wires, the traditional adaptive threshold segmentation algorithm often has large grayscale differences on its surface due to its complex structure. This makes it difficult for the traditional threshold adaptive algorithm to distinguish the changes on its surface for segmentation and defect areas, making it difficult to accurately determine the threshold, resulting in difficulty in identifying defects and reducing the accuracy of visual detection of electronic cigarette heating wire defects. Summary of the invention

[0004] The present invention provides a method and system for visually detecting defects in an electronic cigarette heating wire, so as to solve the existing problems.

[0005] The electronic cigarette heating wire defect visual detection method and system of the present invention adopts the following technical solutions:

[0006] The present invention proposes a method for visually detecting defects in an electronic cigarette heating wire, the method comprising the following steps:

[0007] Collect grayscale images of the heating wire of the electronic cigarette;

[0008] In each column of the grayscale image of the electronic cigarette heating wire, a plurality of heating wire pixel columns are screened out;

[0009] According to the heating wire pixel columns, several component signals of the heating wire pixel value segment of each heating wire pixel column are obtained; according to the frequency domain information of the several component signals of the heating wire pixel value segment of each heating wire pixel column, the possibility that the several component signals of each heating wire pixel value segment are periodic signals is calculated; according to the possibility that the several component signals of each heating wire pixel value segment are periodic signals, a periodic component signal and several noise component signals of each heating wire pixel column are obtained from the several component signals of each heating wire pixel value segment;

[0010] According to a periodic component signal and a plurality of noise component signals of the heating wire pixel value segment of each heating wire pixel column, the probability that each pixel point on each heating wire pixel value segment is located in the defect area is obtained;

[0011] According to the probability that each pixel point on each heating wire pixel value segment is located in the defect area, the visual inspection result of the electronic cigarette heating wire surface is obtained.

[0012] Furthermore, the method of screening out a plurality of heating wire pixel columns according to the grayscale image of the electronic cigarette heating wire includes the following specific steps:

[0013] In the grayscale image of the electronic cigarette heating wire, the grayscale values ​​of all pixels in each column are recorded as a grayscale value sequence, and the pixels in each grayscale value sequence whose grayscale values ​​exceed the preset grayscale threshold Y are recorded as main pixels, and the grayscale value sequence in which the number of main pixels in the grayscale value sequence exceeds the preset target number x is recorded as a heating wire pixel column.

[0014] Furthermore, the method of obtaining a plurality of component signals of the heating wire pixel value segment of each heating wire pixel column according to the heating wire pixel column includes the following specific steps:

[0015] A plane rectangular coordinate system is constructed with the vertex of the lower left corner of the grayscale image of the electronic cigarette heating wire as the origin, the horizontal rightward as the horizontal axis, and the vertical upward as the vertical axis, to obtain the ordinate value of each pixel point in each heating wire pixel column in the grayscale image of the electronic cigarette heating wire, and the target point with the smallest ordinate in each heating wire pixel column is recorded as the starting point, and the target point with the largest ordinate is recorded as the end point, and the data segment composed of the grayscale values ​​of all pixel points on the straight line segment from the starting point to the end point is recorded as the heating wire pixel value segment;

[0016] Perform EMD decomposition on the heating wire pixel value segment of each heating wire pixel column to obtain a plurality of component signals of the heating wire pixel value segment in each heating wire pixel column.

[0017] Furthermore, the possibility of calculating the number of component signals of each heating wire pixel value segment being a periodic signal according to the number of component signals of the heating wire pixel value segment of each heating wire pixel column includes the following specific steps:

[0018] Obtain the frequency and power of each data point on each component signal of the heating wire pixel value segment of each heating wire pixel column by Fourier transforming each component signal of the heating wire pixel value segment of each heating wire pixel column;

[0019] Using the K-means clustering algorithm to cluster each component signal of the heating wire pixel value segment of each heating wire pixel column, and obtaining the cluster center of each component signal of the heating wire pixel value segment of each heating wire pixel column;

[0020] The difference between the power of each data point in each component signal of the heating wire pixel value segment of each heating wire pixel column and the power of the cluster center in each component signal of the heating wire pixel value segment of each heating wire pixel column is recorded as the first difference, and the difference between the frequency of each data point of each component signal of the heating wire pixel value segment of each heating wire pixel column and the frequency of the cluster center data point in the frequency domain information of each component signal of each heating wire pixel column is recorded as the second difference. According to the first difference, the second difference and the covariance of the heating wire pixel value segment of each heating wire pixel column and each component signal of the heating wire pixel value segment of each heating wire pixel column, the possibility that several component signals of the heating wire pixel value segment of each heating wire pixel column are periodic signals is obtained.

[0021] Furthermore, the possibility that several component signals of the heating wire pixel value segment of each heating wire pixel column are periodic signals is obtained according to the first difference, the second difference, and the covariance of each component signal of the heating wire pixel value segment of each heating wire pixel column and the heating wire pixel value segment of each heating wire pixel column, including the specific formula as follows:

[0022]

[0023] Among them, P a,k Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k is the possibility of a periodic signal, sigmoid() represents the sigmoid function, ln() represents the logarithmic function based on the natural logarithm, cov(S a ,IMF1 a,k ) indicates S a and IMF1 a,k The covariance between a Indicates the ath heating wire pixel column G a The pixel value segment of the heating wire inside, IMF1 a,k Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The corresponding k-th component signal segment, F a,k,z Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The frequency of the zth data point in a,k,z Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,kThe power of the zth data point in , Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The frequency of the cluster center data point z0, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The power of the cluster center z0 in the frequency domain information, Z a,k Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The number of data points in , || is the absolute value function, The ath heating wire pixel column G a The heating wire pixel value segment S a The first difference of the kth component signal, The ath heating wire pixel column G a The heating wire pixel value segment S a Further, according to the possibility that the several component signals of each heating wire pixel value segment are periodic signals, a periodic component signal and several noise component signals of each heating wire pixel column are obtained from the several component signals of each heating wire pixel value segment, including the following specific steps:

[0024] The component signal of the heating wire pixel value segment of each heating wire pixel column that is most likely to be a periodic signal is recorded as the periodic component signal of each heating wire pixel column, and all component signals before the periodic component signal of each heating wire pixel column are recorded as the noise component signal of each heating wire pixel column.

[0025] Furthermore, the probability of each pixel point on each heating wire pixel value segment being located in the defective area is obtained according to a periodic component signal and a plurality of noise component signals of the heating wire pixel value segment of each heating wire pixel column, and the specific steps include the following:

[0026] The signal amplitude of each data point in each noise component signal in each heating wire pixel value segment and the average signal amplitude in each noise component signal in each heating wire pixel value segment are recorded as the first ratio, and the difference between the frequency of each data point in each component signal of each heating wire pixel value segment and the frequency of the cluster center in the periodic component signal of each heating wire pixel value segment is recorded as the third difference. According to the third difference and the first ratio, the probability that each pixel point on each heating wire pixel value segment is located in the defect area is obtained.

[0027] Further, the pixel value of each pixel point on each heating wire pixel value segment is obtained based on the third difference and the first ratio.

[0028] The probability of defective area, including the specific formula is as follows:

[0029]

[0030] Among them, P a,i Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The probability that the i-th pixel is located in the defect area, F a ′ ,i Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The frequency of the i-th data point in the periodic component signal, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The frequency of the cluster center z0 in the periodic component signal, IMF1 ′ a,y,i Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The signal amplitude of the i-th data point in the y-th noise component signal, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The average signal amplitude of the yth noise component signal in , Norm() represents the normalization function, and n represents the ath heating wire pixel column G a The heating wire pixel value segment S a The number of noise component signals in the equation, || is the absolute value function, ln() represents the logarithmic function based on the natural logarithm, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The first ratio of the i-th data point in the y-th noise component signal, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The third difference of the i-th data point in the periodic component signal.

[0031] Furthermore, the method of obtaining the visual inspection result of the surface of the electronic cigarette heating wire according to the probability that each pixel point on each heating wire pixel value segment is located in the defective area includes the following specific steps:

[0032] Among all the pixels on the heating wire pixel value segment of each heating wire pixel column, the pixel whose probability of being located in the defective area exceeds a preset probability threshold ∈ is recorded as a defective pixel;

[0033] When there are defective pixels, the electronic cigarette heating wire is judged to be unqualified;

[0034] When there are no defective pixels, the electronic cigarette heating wire is determined to be qualified.

[0035] The present invention also proposes a visual detection system for electronic cigarette heating wire defects, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of any one of the methods for visual detection of electronic cigarette heating wire defects.

[0036] The technical solution of the present invention has the following beneficial effects: collecting a grayscale image of an electronic cigarette heating wire, screening out a plurality of heating wire pixel columns according to the grayscale image of the electronic cigarette heating wire, and obtaining a plurality of component signals of a heating wire pixel value segment of each heating wire pixel column according to the heating wire pixel columns; calculating the possibility that the plurality of component signals of each heating wire pixel value segment are periodic signals according to the plurality of component signals of the heating wire pixel value segment of each heating wire pixel column, thereby improving the efficiency of defect detection; obtaining a periodic component signal and a plurality of noise component signals of each heating wire pixel column from the plurality of component signals of each heating wire pixel value segment according to the possibility that the plurality of component signals of each heating wire pixel value segment are periodic signals, obtaining a probability that each pixel point on each heating wire pixel value segment is located in a defective area according to a periodic component signal and a plurality of noise component signals of the heating wire pixel value segment of each heating wire pixel column, and obtaining a visual detection result of the electronic cigarette heating wire surface according to the probability that each pixel point on each heating wire pixel value segment is located in a defective area, thereby improving the accuracy of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 This is a flowchart of the steps of a method for visually detecting defects in an electronic cigarette heating wire according to the present invention;

[0039] Figure 2 This is a grayscale image of the heating wire of an electronic cigarette collected in this embodiment. DETAILED DESCRIPTION

[0040] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the electronic cigarette heating wire defect visual detection method and system proposed by the present invention, its specific implementation, structure, characteristics and effects in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0041] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0042] The specific scheme of the electronic cigarette heating wire defect visual detection method and system provided by the present invention is described in detail below with reference to the accompanying drawings.

[0043] See also Figure 1 , which shows a flowchart of a method for visually detecting defects in an electronic cigarette heating wire provided by an embodiment of the present invention, the method comprising the following steps:

[0044] Step S001: Collecting a grayscale image of the heating wire of an electronic cigarette.

[0045] It should be noted that the heating wire of the electronic cigarette is one of the core components of the electronic cigarette. It is responsible for heating the smoke oil and converting it into mist for users to inhale. The heating wire is usually made of metal materials, such as stainless steel, nickel-chrome alloy, etc., which has good conductivity and high temperature resistance. Its working principle is to pass electric current to the heating wire to generate heat, so that the nearby smoke oil evaporates to form mist. According to the structure of the electronic cigarette, the heating wire is placed horizontally, and then a fixed industrial camera is installed. The surface image of the fancy heating wire is collected by the industrial camera, and it is grayed to obtain a grayscale image, such as Figure 2 shown.

[0046] At this point, a grayscale image of the electronic cigarette heating wire is obtained.

[0047] Step S002: In each column of the grayscale image of the electronic cigarette heating wire, a plurality of heating wire pixel columns are screened out.

[0048] It should be noted that before processing the grayscale image of the electronic cigarette heating wire, it is necessary to first obtain the area of ​​the heating wire. There is a relatively obvious grayscale difference between the heating wire area and the background area in the grayscale image of the electronic cigarette heating wire. This feature can be used to obtain the heating wire area. From the above analysis, it can be seen that the periodic characteristics of the heating wire are mainly manifested in the longitudinal axis direction of the grayscale image of the electronic cigarette heating wire. In order to facilitate the calculation of subsequent steps, this embodiment performs preprocessing in the longitudinal axis direction of the grayscale image of the electronic cigarette heating wire.

[0049] Specifically, in the grayscale image of the electronic cigarette heating wire, the grayscale values ​​of each column of the electronic cigarette heating wire grayscale image are extracted from top to bottom, and the grayscale values ​​of all the pixels in each column are recorded as a grayscale value sequence, and the jth grayscale value sequence is recorded as G j , it is regarded as a digital signal, and the average grayscale of the background is obtained by analyzing the grayscale image collection background of the electronic cigarette heating wire. The grayscale threshold Y=50 preset in this embodiment is described as an example. Other implementations can be set to other values, which are not limited in this embodiment. For the jth grayscale value sequence G j A preset grayscale threshold Y is used for judgment, and the pixel points whose grayscale values ​​exceed the preset grayscale threshold Y are marked and recorded as main pixel points. The number of pixel points exceeding the preset grayscale threshold Y in the jth grayscale value sequence is counted. The preset target number x=20 in this embodiment is described as an example. Other implementation methods can be set to other values, which are not limited in this embodiment. The grayscale value sequence in which the number of main pixels exceeds the preset target number x is regarded as containing fancy heating wires, which are recorded as heating wire pixel columns. According to the above method, it is judged whether all grayscale value sequences contain fancy heating wires, and all heating wire pixel columns are obtained. Then, in each heating wire pixel column, the gradient values ​​of all pixels in each heating wire pixel column are obtained, and the average gradient value of each heating wire pixel column is calculated. The pixel points in each heating wire pixel column whose gradient values ​​are greater than the gradient average value of the heating wire pixel column to which they belong are marked and recorded as target points.

[0050] Furthermore, a plane rectangular coordinate system is constructed with the vertex in the lower left corner of the grayscale image of the electronic cigarette heating wire as the origin, the horizontal direction to the right as the horizontal axis, and the vertical direction upward as the vertical axis to obtain the vertical coordinate value of each pixel point in each heating wire pixel column in the grayscale image of the electronic cigarette heating wire, and the target point with the smallest vertical coordinate in each heating wire pixel column is recorded as the starting point, and the target point with the largest vertical coordinate is recorded as the end point. The data segment composed of the grayscale values ​​of all pixel points on the straight line segment from the starting point to the end point is recorded as the heating wire pixel value segment, and the heating wire pixel value segment is the heating wire surface area data segment in each heating wire pixel column.

[0051] At this point, the heating wire pixel value segments of all heating wire pixel columns are obtained.

[0052] Step S003: According to the heating wire pixel columns, several component signals of the heating wire pixel value segments of each heating wire pixel column are obtained; according to the several component signals of the heating wire pixel value segments of each heating wire pixel column, the possibility that the several component signals of each heating wire pixel value segment are periodic signals is calculated; according to the possibility that the several component signals of each heating wire pixel value segment are periodic signals, a periodic component signal and several noise component signals of each heating wire pixel column are obtained from the several component signals of each heating wire pixel value segment.

[0053] It should be noted that, from the above analysis process, the grayscale value will show periodicity on the vertical axis of the fancy heating wire image, and the periodicity can be calculated through the periodicity of the grayscale value, so as to identify defects by the degree of periodic destruction. However, due to the uneven distribution of light and the curvature change of the heating wire surface, the grayscale on the heating wire surface has an overall grayscale change trend. When calculating the grayscale distribution periodicity of the heating wire surface, the overall grayscale distribution trend of the heating wire surface grayscale will affect the calculation of the periodicity, so it is necessary to extract the periodicity of the surface grayscale distribution.

[0054] Specifically, the heating wire pixel value segment of each heating wire pixel column is regarded as a digital signal and input into the EMD signal decomposition algorithm. The EMD signal decomposition algorithm is a well-known technology and the specific method is not introduced here. The a-th heating wire pixel column G is obtained by the EMD signal decomposition algorithm. a The nth component signal of the heating wire pixel value segment is recorded as IMF1 a,n , each data point in each component signal corresponds to a signal amplitude, in the ath heating wire pixel column G a The nth component signal IMF1 of the heating wire pixel value segment a,n Extract the periodic information of the image, and in the nth component signal IMF1 a,n In the example, the first component signal usually shows the heating wire pixel column G a However, due to the poor quality of the grayscale image of the electronic cigarette heating wire, noise will cause high-frequency noise signals to appear in the first component signal. Therefore, it is necessary to screen the component signal. In the component signal, the smaller the sequence of the component signal, the more likely it is to show the periodic information of the electronic cigarette heating wire image. The stronger the periodicity of the component signal, the more likely it is that the component signal will show the periodic information of the grayscale value sequence of the electronic cigarette heating wire image. Therefore, the a-th heating wire pixel column G a The heating wire pixel value segment S a Each component signal is Fourier transformed to obtain the frequency domain information of each component signal, and the frequency domain information is the heating wire pixel value segment S aThe power and frequency corresponding to each data point on each component signal in the frequency domain are calculated, and k-means clustering is performed in the frequency domain information. The number of clusters k preset in this embodiment is 1, which is described as an example. Other implementations can be set to other values, which are not limited in this embodiment. The k-means clustering algorithm is a well-known technology, and the specific method is not introduced here. The cluster center z0 of each component signal is obtained, and then the frequency power concentration degree in its frequency is used to represent its periodicity. The component signal and the heating wire pixel column G m The more consistent the signal distribution is, the more likely the component signal is to represent the periodic information of the grayscale image of the heating wire of the electronic cigarette. The difference between the power of each data point in each component signal of the heating wire pixel value segment of each heating wire pixel column and the power of the cluster center in each component signal of the heating wire pixel value segment of each heating wire pixel column is recorded as the first difference, and the difference between the frequency of each data point of each component signal of the heating wire pixel value segment of each heating wire pixel column and the frequency of the cluster center data point in the frequency domain information of each component signal of each heating wire pixel column is recorded as the second difference. According to the first difference, the second difference and the covariance of the heating wire pixel value segment of each heating wire pixel column and each component signal of the heating wire pixel value segment of each heating wire pixel column, the possibility that several component signals of the heating wire pixel value segment of each heating wire pixel column are periodic signals is obtained.

[0055] Furthermore, the specific formula for calculating the possibility of each component signal being a periodic signal is as follows:

[0056]

[0057] Among them, P a,k Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k is the possibility of a periodic signal, sigmoid() represents the sigmoid function, k represents the sequence number of the component signal, ln() represents the logarithmic function based on the natural logarithm, cov(S a ,IMF1 a,k ) indicates S a and IMF1 a,k The covariance between a Indicates the ath heating wire pixel column G a The pixel value segment of the heating wire inside, IMF1 a,k Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The corresponding k-th component signal segment, F a,k,z Indicates the ath heating wire pixel column G a The heating wire pixel value segment Sa The kth component signal IMF1 a,k The frequency of the zth data point in a,k,z Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The power of the zth data point in , Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The frequency of the cluster center data point z0, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The power of the cluster center z0 in the frequency domain information, Z a,k Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The number of data points in , || is the absolute value function, The ath heating wire pixel column G a The heating wire pixel value segment S a The first difference of the kth component signal, The ath heating wire pixel column G a The heating wire pixel value segment S a The second difference of the kth component signal.

[0058] Furthermore, by screening the possibility that each component signal is a periodic signal, the possibility P of each component signal being a periodic component signal is extracted. a,k The largest component signal in the periodic component is IMF1. a,x , the component signals before the periodic signal are all noise component signals, denoted as IMF1 a,y , where 0 <y<x。

[0059] According to the above method, a periodic component signal and several noise component signals are obtained for each heating wire pixel column.

[0060] At this point, a periodic component signal and several noise component signals are obtained for each heating wire pixel column.

[0061] Step S004: according to a periodic component signal and a plurality of noise component signals of the heating wire pixel value segment of each heating wire pixel column, obtain the probability that each pixel point on each heating wire pixel value segment is located in the defective area.

[0062] It should be noted that, through the above analysis, if the difference between the periodicity of a certain point signal and the overall periodicity is greater, then the degree of damage to the periodicity is greater, and it is more likely to be a defective area on the surface of the heating wire. At the same time, since the periodic signal component may not be the first signal component, its signal performance will also be distributed in the previous signal components. When the periodic signal component is not the first signal component, then the signal component before it is a noise component. The performance of the defect signal in the noise component is mainly in terms of amplitude. Therefore, the larger the amplitude of the signal in the noise component, the more likely it is a defective area on the surface of the heating wire.

[0063] Specifically, in the periodic signal component IMF1 a,x In this embodiment, the preset window size q=7 is used as an example for description. Other implementations may be set to other values, which are not limited in this embodiment. On the data sequence on the heating wire pixel column, a linear window with a length of q is constructed with each data point as the center. The frequency F of the data point i is obtained by performing a short-time Fourier transform on the data in the window. a,k,i , where short-time Fourier transform is a well-known technology, and the specific method is not introduced here. The frequency F of this point a,k,i and periodic signal component IMF1 a,x The greater the difference in frequency of the frequency domain information cluster center z0, the greater the difference between the periodicity of the point and the overall periodicity, the more abnormal the periodicity of the data point is, and the more likely the data point is a defect area. In addition, in the noise component signal IMF1 a,y In the equation, the larger the amplitude of data point i is, the more abnormal the gray value of the data point is, and the more likely the point is to be a defective area. Therefore, the signal amplitude of each data point in each noise component signal in each heating wire pixel value segment and the average signal amplitude in each noise component signal in each heating wire pixel value segment are recorded as the first ratio, and the difference between the frequency of each data point in each component signal of each heating wire pixel value segment and the frequency of the cluster center in the periodic component signal of each heating wire pixel value segment is recorded as the third difference. According to the third difference and the first ratio, the probability of each pixel point in each heating wire pixel value segment being located in the defective area is obtained.

[0064] Furthermore, the calculation formula for the probability that each pixel point on the heating wire pixel value segment is located in the defect area is as follows:

[0065]

[0066] Among them, Pa,i Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The probability that the i-th pixel is located in the defect area, F a ′ ,i Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The frequency of the i-th data point in the periodic component signal, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The frequency of the cluster center z0 in the periodic component signal, IMF1 ′ a,y Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The y-th noise component signal, IMF1 ′ a,y,i Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The signal amplitude of the i-th data point in the y-th noise component signal, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The average signal amplitude of the yth noise component signal in , Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The first ratio of the ith data point in the yth noise component signal. The larger the first ratio, the greater the abnormality of the signal amplitude. Norm() represents the normalization function, and n represents the pixel column G of the ath heating wire. a The heating wire pixel value segment S a The number of noise component signals in the , || is the absolute value function, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The third difference of the i-th data point in the periodic component signal.

[0067] According to the above method, the probability that each pixel point on each heating wire pixel column is located in the defective area is obtained.

[0068] At this point, the probability that each pixel point on each heating wire pixel column is located in the defective area is obtained.

[0069] Step S005: Obtain the visual inspection result of the surface of the electronic cigarette heating wire according to the probability that each pixel point on each heating wire pixel value segment is located in the defect area.

[0070] Specifically, the preset probability threshold ∈=0.85 in this embodiment is described as an example. It can be set to other values ​​in other implementation modes. This embodiment does not limit it. Among all the pixels on the heating wire pixel column, the pixel whose probability of being located in the defective area exceeds the preset probability threshold is recorded as a defective pixel.

[0071] When there are defective pixels, the electronic cigarette heating wire is judged to be unqualified;

[0072] When there are no defective pixels, the electronic cigarette heating wire is determined to be qualified;

[0073] By screening all the pixels and marking them in the image, the surface visual inspection results of the electronic cigarette heating wire can be obtained. The inspection results are sent to the system or inspectors, and the robot or inspectors will detect the defective parts.

[0074] At this point, the visual inspection of electronic cigarette heating wire defects is completed.

[0075] The present invention also provides a visual detection system for electronic cigarette heating wire defects, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program stored in the memory to implement the steps of the aforementioned visual detection method for electronic cigarette heating wire defects.

[0076] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A visual inspection method for defects in electronic cigarette heating wires, characterized in that: The method comprises the following steps: Collect grayscale images of the heating wire of the electronic cigarette; In each column of the grayscale image of the electronic cigarette heating wire, a plurality of heating wire pixel columns are screened out; According to the heating wire pixel columns, several component signals of the heating wire pixel value segment of each heating wire pixel column are obtained; according to the frequency domain information of the several component signals of the heating wire pixel value segment of each heating wire pixel column, the possibility that the several component signals of each heating wire pixel value segment are periodic signals is calculated; according to the possibility that the several component signals of each heating wire pixel value segment are periodic signals, a periodic component signal and several noise component signals of each heating wire pixel column are obtained from the several component signals of each heating wire pixel value segment; According to a periodic component signal and a plurality of noise component signals of the heating wire pixel value segment of each heating wire pixel column, the probability that each pixel point on each heating wire pixel value segment is located in the defect area is obtained; According to the probability that each pixel point on each heating wire pixel value segment is located in the defect area, the visual inspection result of the surface of the electronic cigarette heating wire is obtained; The method of calculating the possibility that the component signals of each heating wire pixel value segment are periodic signals according to the component signals of the heating wire pixel value segment of each heating wire pixel column includes the following specific steps: Obtain the frequency and power of each data point on each component signal of the heating wire pixel value segment of each heating wire pixel column by Fourier transforming each component signal of the heating wire pixel value segment of each heating wire pixel column; Using the K-means clustering algorithm to cluster each component signal of the heating wire pixel value segment of each heating wire pixel column, and obtaining the cluster center of each component signal of the heating wire pixel value segment of each heating wire pixel column; The difference between the power of each data point in each component signal of the heating wire pixel value segment of each heating wire pixel column and the power of the cluster center in each component signal of the heating wire pixel value segment of each heating wire pixel column is recorded as a first difference, and the difference between the frequency of each data point in each component signal of the heating wire pixel value segment of each heating wire pixel column and the frequency of the cluster center data point in the frequency domain information of each component signal of each heating wire pixel column is recorded as a second difference; According to the first difference, the second difference, and the covariance of each component signal of the heating wire pixel value segment of each heating wire pixel column and the heating wire pixel value segment of each heating wire pixel column, the possibility that several component signals of the heating wire pixel value segment of each heating wire pixel column are periodic signals is obtained; The possibility that several component signals of the heating wire pixel value segment of each heating wire pixel column are periodic signals is obtained according to the first difference, the second difference, and the covariance of each component signal of the heating wire pixel value segment of each heating wire pixel column and the heating wire pixel value segment of each heating wire pixel column, and the specific formula included is as follows: Among them, P a,k Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k is the possibility of a periodic signal, sigmoid() represents the sigmoid function, ln() represents the logarithmic function based on the natural logarithm, cov(S a ,IMF1 a,k ) indicates S a and IMF1 a,k The covariance between a Indicates the ath heating wire pixel column G a The pixel value segment of the heating wire inside, IMF1 a,k Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The corresponding k-th component signal segment, F a,k,z Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The frequency of the zth data point in a,k,z Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The power of the zth data point in , Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The frequency of the cluster center data point z0, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The power of the cluster center z0 in the frequency domain information, Z a,k Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The kth component signal IMF1 a,k The number of data points in , || is the absolute value function, The ath heating wire pixel column G a The heating wire pixel value segment S a The first difference of the kth component signal, The ath heating wire pixel column G a The heating wire pixel value segment S a a second difference of the kth component signal of ; According to the possibility that the several component signals of each heating wire pixel value segment are periodic signals, a periodic component signal and several noise component signals of each heating wire pixel column are obtained from the several component signals of each heating wire pixel value segment, including the following specific steps: The component signal of the heating wire pixel value segment of each heating wire pixel column that is most likely to be a periodic signal is recorded as the periodic component signal of each heating wire pixel column, and all component signals before the periodic component signal of each heating wire pixel column are recorded as the noise component signal of each heating wire pixel column.

2. According to claim 1, a visual detection method for electronic cigarette heating wire defects is characterized in that: According to the grayscale image of the electronic cigarette heating wire, multiple heating wire pixel columns are screened out, and the specific steps are as follows: In the grayscale image of the electronic cigarette heating wire, the grayscale values ​​of all pixels in each column are recorded as a grayscale value sequence, and the pixels in each grayscale value sequence whose grayscale values ​​exceed the preset grayscale threshold Y are recorded as main pixels, and the grayscale value sequence in which the number of main pixels in the grayscale value sequence exceeds the preset target number x is recorded as a heating wire pixel column.

3. According to claim 1, a visual detection method for electronic cigarette heating wire defects is characterized in that: The method of obtaining a plurality of component signals of the heating wire pixel value segment of each heating wire pixel column according to the heating wire pixel column includes the following specific steps: A plane rectangular coordinate system is constructed with the vertex of the lower left corner of the grayscale image of the electronic cigarette heating wire as the origin, the horizontal rightward as the horizontal axis, and the vertical upward as the vertical axis, to obtain the ordinate value of each pixel point in each heating wire pixel column in the grayscale image of the electronic cigarette heating wire, and the target point with the smallest ordinate in each heating wire pixel column is recorded as the starting point, and the target point with the largest ordinate is recorded as the end point, and the data segment composed of the grayscale values ​​of all pixel points on the straight line segment from the starting point to the end point is recorded as the heating wire pixel value segment; Perform EMD decomposition on the heating wire pixel value segment of each heating wire pixel column to obtain a plurality of component signals of the heating wire pixel value segment in each heating wire pixel column.

4. According to claim 1, a visual detection method for defects in electronic cigarette heating wires is characterized in that: The method of obtaining the probability that each pixel point on each heating wire pixel value segment is located in the defect area according to a periodic component signal and a plurality of noise component signals of the heating wire pixel value segment of each heating wire pixel column includes the following specific steps: The signal amplitude of each data point in each noise component signal in each heating wire pixel value segment and the average signal amplitude in each noise component signal in each heating wire pixel value segment are recorded as the first ratio, and the difference between the frequency of each data point in each component signal of each heating wire pixel value segment and the frequency of the cluster center in the periodic component signal of each heating wire pixel value segment is recorded as the third difference. According to the third difference and the first ratio, the probability that each pixel point on each heating wire pixel value segment is located in the defect area is obtained.

5. According to claim 4, a visual detection method for defects in electronic cigarette heating wires is characterized in that: The probability of each pixel point on each heating wire pixel value segment being located in the defect area is obtained according to the third difference and the first ratio, and the specific formula included is as follows: Among them, P a,i Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The probability that the i-th pixel is located in the defect area, F a ' ,i Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The frequency of the i-th data point in the periodic component signal, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The frequency of the cluster center z0 in the periodic component signal, IMF1′ a,y,i Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The signal amplitude of the i-th data point in the y-th noise component signal, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The average signal amplitude of the yth noise component signal in , Norm() represents the normalization function, and n represents the ath heating wire pixel column G a The heating wire pixel value segment S a The number of noise component signals in the equation, || is the absolute value function, ln() represents the logarithmic function based on the natural logarithm, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The first ratio of the i-th data point in the y-th noise component signal, Indicates the ath heating wire pixel column G a The heating wire pixel value segment S a The third difference of the i-th data point in the periodic component signal.

6. According to claim 1, a visual detection method for defects in electronic cigarette heating wires is characterized in that: The specific steps of obtaining the visual inspection result of the surface of the electronic cigarette heating wire according to the probability that each pixel point on each heating wire pixel value segment is located in the defect area are as follows: Among all the pixels on the heating wire pixel value segment of each heating wire pixel column, the pixel whose probability of being located in the defective area exceeds a preset probability threshold ∈ is recorded as a defective pixel; When there are defective pixels, the electronic cigarette heating wire is judged to be unqualified; When there are no defective pixels, the electronic cigarette heating wire is determined to be qualified.

7. A visual inspection system for defects in electronic cigarette heating wires, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of a method for visually detecting defects in electronic cigarette heating wires as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Complex background image defect detection method and system based on combination of frequency domain and spatial domain

    CN113487569A

  • MEMS acoustic film surface defect detection method based on frequency domain transformation

    CN114219797A

  • Automobile hub defect detection method based on image processing

    CN114972325A

  • Steel wire rope defect detection method

    CN115330783A

  • Magnetic glue inductor irregular appearance defect detection method based on computer vision

    CN117437219A