A method for identifying defects in electronic cigarettes

Through RGB image processing and watershed segmentation technology, combined with HSV image analysis, the problem of the inability to accurately detect oil leakage defects of electronic cigarette cartridges in the existing technology is solved, and efficient and accurate oil leakage detection is achieved.

CN115690025BActive Publication Date: 2025-08-15洛阳墨潇网络科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211307807.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2025-08-15
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

In the prior art, the threshold segmentation of the maximum inter-class variance method cannot accurately distinguish the condensate and oil leakage at the bottom of the electronic cigarette cartridge, making it difficult to detect whether the cigarette cartridge has oil leakage defects.

Method used

The RGB image processing method is adopted to calculate the reflection intensity of each pixel point and the reflection intensity of neighboring pixel points, obtain the minimum value points, perform watershed segmentation, flood the suspected oil leakage area, and judge the oil leakage defect based on the HSV image analysis brightness.

Benefits of technology

It improves the accuracy and efficiency of oil leakage defect detection, reduces the calculation amount, and enhances the segmentation accuracy of oil leakage areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115690025B_ABST
    Figure CN115690025B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing, and particularly to an electronic cigarette defect identification method. The method comprises the following steps: obtaining an RGB image of the bottom surface of a cigarette cartridge, obtaining the reflection intensity of each pixel point based on the first-order color moment of each pixel point, obtaining the possibility of the pixel point serving as a minimum point for watershed segmentation based on the reflection intensity and the reflection intensity of the pixel point's neighboring pixels, taking the pixel point with a probability greater than a possibility threshold as the minimum point, obtaining the neighboring pixels of each minimum point, flooding the neighboring pixels according to the reflection intensity to obtain a first segmentation area, and obtaining the degree of complementarity of the reflection intensities of the two adjacent rows of pixels on both sides of an edge line based on the reflection intensities of the two adjacent rows of pixels on both sides. Judging whether a dam needs to be constructed for the edge line based on the degree of complementarity, flooding the edge line where no dam is constructed to obtain a second segmentation area, and judging whether the cigarette cartridge has an oil leakage defect based on the brightness of the pixels in each second segmentation area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a method for identifying defects in electronic cigarettes. Background Art

[0002] The e-cigarette cartridge is the mouthpiece of the e-cigarette. Most cartridges are integrated with heating wire, cotton and oil tank to store a certain amount of e-liquid. When the e-cigarette is working, the e-liquid in the cartridge is atomized into gas under the action of the atomizer, thus forming smoke like real cigarettes.

[0003] During the production process of e-cigarettes, atomization detection is required first to test whether the atomization function of the cartridge is normal, and then the cartridge is installed. When installing the cartridge, it is necessary to detect whether the cartridge has oil leakage defects. The current conventional method for detecting whether the cartridge has oil leakage defects is to collect the surface image of the bottom of the cartridge and perform threshold segmentation using the maximum inter-class variance method. However, there may be condensation generated during the atomization detection process at the bottom of the cartridge. Since both condensation and oil are reflective, and the reflection intensity of local areas of different oils is different, the conventional maximum inter-class variance method threshold segmentation cannot distinguish between condensation and oil leakage, making it difficult to accurately detect whether the cartridge has oil leakage defects. Summary of the Invention

[0004] To address the problem that conventional maximum inter-class variance method threshold segmentation cannot distinguish between condensate and oil leakage, and is difficult to accurately detect whether there is an oil leakage defect in the cigarette cartridge, the present invention provides an electronic cigarette defect identification method using the following technical solutions:

[0005] Get the RGB image of the bottom surface of the cigarette cartridge;

[0006] The reflection intensity of each pixel is obtained according to the first-order moment of the color of each pixel in the RGB image;

[0007] According to the reflection intensity of each pixel and the reflection intensity of its neighboring pixels, the possibility of the pixel being the minimum point of watershed segmentation is obtained, and the pixel whose possibility is greater than the possibility threshold is regarded as the minimum point;

[0008] Perform edge detection on the RGB image to obtain edge lines;

[0009] Taking each minimum point in the RGB image as the starting point, flood its neighboring pixels and stop when encountering the edge line to obtain the first segmentation area;

[0010] Obtaining a degree of complementarity of the reflection intensities of the pixels of the first segmented areas adjacent to both sides of the edge line according to the reflection intensities of the pixels of the first segmented areas adjacent to both sides of the edge line;

[0011] Determine whether it is necessary to build a dam on the edge line according to the degree of complementarity, and submerge the edge line that does not need to be built with a dam to obtain a second segmentation area;

[0012] The brightness of the pixels in each second segmented area is used to determine whether the cigarette cartridge has a liquid leakage defect.

[0013] The method for obtaining the reflection intensity of each pixel point according to the first-order moment of the color of each pixel point in the RGB image is:

[0014] Calculate the first-order moment of each pixel in the RGB image, that is, the mean of the color values of the pixel on the R, G, and B channels, and use the mean as the reflection intensity of each pixel.

[0015] The method for obtaining the possibility of the pixel point being the minimum point of watershed segmentation according to the reflection intensity of each pixel point and the reflection intensity of the pixel point's neighboring pixels is:

[0016] Taking each pixel as the center, obtain the difference between the reflection intensity of the pixel's neighboring pixels and the reflection intensity of the pixel itself;

[0017] The average of the difference between the reflection intensity of the neighboring pixels and the reflection intensity of the pixel is taken as the uniformity of the reflection intensity in the neighborhood of the pixel;

[0018] According to the reflection intensity of each pixel and the uniformity of the reflection intensity in the neighborhood of the pixel, the possibility of the pixel being the minimum point of watershed segmentation is obtained.

[0019] The method for obtaining the first segmented area is:

[0020] Get each minimum point in the RGB image, and use the minimum point as the starting point. Submerge the neighboring pixels of the minimum point in the order of reflection intensity from large to small into pixels in the same area until the edge line is encountered. The area corresponding to each minimum point is obtained, that is, the first segmentation area.

[0021] The method for obtaining the complementary degree of the reflection intensity of the pixel points of the first segmented areas adjacent to both sides of the edge line according to the reflection intensity of the pixel points of the first segmented areas adjacent to both sides of the edge line is:

[0022] Obtain two rows of pixel points of the first segmentation area adjacent to both sides of the edge line;

[0023] Calculate the difference between the reflection intensity of each pixel in the first row and the reflection intensity of the corresponding pixel in the second row;

[0024] The average of the difference between the reflection intensity of each pixel in the first row and the reflection intensity of the corresponding pixel in the second row is used as the complementary degree of the reflection intensity of the pixels in the first segmented area adjacent to both sides of the edge line.

[0025] The method for determining whether a dam needs to be built on the edge line based on the degree of complementarity is:

[0026] Setting a threshold for the degree of complementarity;

[0027] If e is used as the base and the degree of complementarity is used as the exponent, an exponential power is constructed. If the reciprocal of the exponential power is less than or equal to the threshold of the degree of complementarity, the edge line does not need to be constructed with a dam.

[0028] Otherwise, the edge line needs to be dammed.

[0029] The method for judging whether the cigarette cartridge has a leakage defect according to the brightness of the pixel points in each second segmented area is:

[0030] Obtain an HSV image of each second segmented area;

[0031] Get the brightness value of each pixel in the HSV image of each second segmentation area, and calculate the probability that the current second segmentation area is the smoke oil area as follows:

[0032]

[0033] Where F is the probability that the current second segmentation area is the smoke oil area, 53 is the brightness value of light yellow, 7 is the brightness value of dark brown, m is the number of pixels in the current second segmentation area, H i is the brightness value of the i-th pixel in the current second segmentation area;

[0034] If the probability F that the current second segmented area is the smoke oil area ≤ the possibility threshold, the current second segmented area is the smoke oil area; otherwise, it is the condensate area; if the smoke oil area exists, the smoke cartridge has a smoke oil leakage defect.

[0035] The beneficial effects of the present invention are:

[0036] (1) Obtain an RGB image of the bottom surface of the cigarette cartridge, obtain the reflection intensity of each pixel according to the first-order moment of the color of each pixel in the RGB image, obtain the possibility of the pixel as the minimum point of watershed segmentation according to the reflection intensity of each pixel and the reflection intensity of its neighboring pixels, and take the pixel with a probability greater than the possibility threshold as the minimum point; compared with the conventional watershed algorithm, this method only selects the pixel with large reflection intensity as the minimum point, instead of placing the minimum point on the entire image, which greatly reduces the amount of calculation.

[0037] (2) Obtain the neighboring pixel points of each minimum point, and submerge the neighboring pixel points into the same area according to the reflection intensity from large to small until the edge line is encountered, and the first segmentation area is obtained; according to the reflection intensity of each pixel point in the two rows of pixel points in the first segmentation area adjacent to both sides of the edge line, the degree of complementarity of the reflection intensity of the two rows of pixel points in the first segmentation area adjacent to both sides of the edge line is obtained; according to the degree of complementarity, it is judged whether it is necessary to build a dam for the edge line, and the edge line that does not need to be built is submerged to obtain the second segmentation area; this method does not build dams for all edge lines, but only submerges the edge lines of the reflective area (suspected oil smoke area), and builds dams for the reflective area and the non-reflective area (suspected oil smoke area and non-oil smoke area), which greatly improves the accuracy of segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.

[0039] Figure 1 This is a flow chart of a method for identifying defects in an electronic cigarette according to the present invention;

[0040] Figure 2 This is a schematic diagram of oil leakage at the bottom of a cigarette cartridge in the process of an electronic cigarette defect identification method of the present invention. DETAILED DESCRIPTION

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0042] An embodiment of an electronic cigarette defect identification method of the present invention is as follows: Figure 1 Shown, including:

[0043] Step 1: Obtain an RGB image of the bottom surface of the cigarette cartridge; obtain the reflection intensity of each pixel based on the first-order moment of the color of each pixel in the RGB image;

[0044] The purpose of this step is to collect the image of the bottom of the cigarette cartridge, preprocess the image to obtain the target image, and analyze the reflection intensity of each pixel in the image.

[0045] The method for obtaining the RGB image of the bottom surface of the cigarette cartridge is as follows:

[0046] The cigarette cartridges are placed evenly spaced on the conveyor belt, with the bottoms facing upward. A CCD camera is placed directly above the conveyor belt, aiming vertically downward to capture images of the bottoms of the cigarette cartridges, one image per cartridge. Because the captured images include background areas such as the conveyor belt, semantic segmentation is performed on the captured images, converting the pixel values of the background areas to 255 while retaining the original pixel values of the cigarette cartridge areas. This results in an RGB image of the cigarette cartridge bottom.

[0047] Among them, the method of obtaining the reflection intensity of each pixel point according to the first-order moment of the color of each pixel point in the RGB image is:

[0048] Calculate the mean of the color values on the R, G, and B channels of each pixel, and use the mean as the reflection intensity of each pixel. The first-order color moment of the RGB image reflects the brightness of the image and the reflection intensity of the bottom surface of the current cartridge. The reflection intensity of the pixel on the surface of the cartridge is calculated based on the color of each channel of each pixel:

[0049]

[0050] Where, f a is the reflection intensity of the a-th pixel, H R 、H G 、H B are the three color channel values of the ath pixel in the image. Since the brightness of the entire image is closely related to the color values of the three channels, the first-order color moments of the three channels of each pixel are summed and averaged to represent the first-order color moment of the pixel. Then the first-order color moments of all pixels are summed and averaged to represent the reflective intensity of the pixel on the surface of the cigarette cartridge. When f a The larger the value, the stronger the reflection intensity of the pixel point, and vice versa.

[0051] Step 2: Based on the reflection intensity of each pixel and the reflection intensity of its neighboring pixels, the probability of the pixel being the minimum point of watershed segmentation is obtained, and the pixels whose probability is greater than the probability threshold are regarded as minimum points; edge detection is performed on the RGB image to obtain edge lines; taking each minimum point in the RGB image as the starting point, pixel flooding is performed on its neighboring pixels, and stopping when an edge line is encountered to obtain the first segmentation area;

[0052] The purpose of this step is to analyze the uniformity of the reflection intensity distribution of neighboring pixels based on the reflection intensity of the pixel point, and select the minimum value point to flood its neighboring pixels according to the reflection intensity.

[0053] Among them, the method for obtaining the possibility of the pixel point being the minimum point of watershed segmentation based on the reflection intensity of each pixel point and the reflection intensity of the pixel point's neighboring pixels is:

[0054] (1) Taking each pixel as the center, obtain the difference between the reflection intensity of the neighboring pixels of the pixel and the reflection intensity of the pixel, f a -f j , where f j is the reflection intensity of the jth neighboring pixel of the ath pixel;

[0055] (2) The average of the difference between the reflection intensity of the neighboring pixels and the reflection intensity of the pixel is taken as the uniformity of the reflection intensity in the neighborhood of the pixel;

[0056]

[0057] In the formula, F a is the uniformity of the reflection intensity within the neighborhood of the a-th pixel, and j is the j-th neighboring pixel of the a-th pixel. In addition to a large reflection intensity, the minimum point also needs a small gradient to allow surrounding water to flow to the minimum. Therefore, the smoothness of the pixel is calculated based on the reflection intensity. The uniformity of the reflection intensity of the pixels in the eight neighborhoods of each pixel area is calculated. The uniformity of the reflection intensity in the neighborhood of the current pixel is reflected by the average reflection intensity of the central pixel and each neighboring pixel.

[0058] (3) According to the reflection intensity of each pixel and the uniformity of the reflection intensity in the neighborhood of the pixel, the possibility of the pixel being the minimum point of watershed segmentation is obtained;

[0059] Since the uniformity of the non-reflective area is also very high, the probability of a pixel being a minimum cannot be obtained by relying solely on the uniformity of the pixel neighborhood. Instead, pixels with relatively uniform neighborhoods should be found in areas with high reflective intensity. Therefore, the probability of a pixel being a minimum is calculated as:

[0060]

[0061] In the formula, j a is the possibility of the a-th pixel as the minimum value of watershed segmentation, exp is the exponential function with e as the base, and the reflection intensity f a The larger the value, the greater the neighborhood uniformity F a The smaller, The smaller the value, the smaller the j a The larger the value of , the ratio of uniformity to reflection intensity is used as the possibility of the current pixel being a minimum point; the purpose of using the exp exponential function is to normalize the possibility and facilitate the subsequent selection of a suitable threshold. In this embodiment, j is selected.a The empirical threshold is 0.8, and the pixel points with a probability greater than 0.8 are regarded as the minimum points of watershed segmentation.

[0062] It should be noted that after determining the minimum point, it is necessary to set a flooding criterion for an area to ensure that flooding is performed according to the same criterion and order; however, conventional flooding will build a dam and stop flooding after reaching a watershed, while the suspected smoke oil area on the surface of the cigarette cartridge is partly highly reflective and partly non-luminous, so there is an obvious watershed between the two. The present invention customizes the criterion for building a dam so that the connected suspected smoke oil areas are flooded into the same area.

[0063] Among them, edge detection is performed on the RGB image to obtain edge lines; each minimum point in the RGB image is used as the starting point, and its neighboring pixels are flooded, and the method of stopping when encountering the edge line is used to obtain the first segmentation area.

[0064] First, perform edge detection on the image to obtain the edge lines in the image, and then start watershed segmentation. Since we have placed the minimum point on the smooth part of the strong reflective area, the submergence criterion of the present invention also needs to be formulated according to the reflective intensity of the strong reflective area:

[0065] Set the flooding to start from the minimum point and follow the order of reflection intensity from large to small. That is, first flood the points in the 3×3 neighborhood of the minimum point in the order of reflection intensity from large to small. The flooded points and the minimum point form the same area.

[0066] When the 3×3 neighborhood is flooded, the unflooded points in the 5×5 neighborhood are flooded in descending order of reflection intensity until an edge line is encountered. The flooding stops and the dam is not constructed. The first segmentation area is obtained at this time, and the next step of analysis and judgment is carried out first.

[0067] Step 3: Based on the reflection intensities of the pixels of the first segmented area adjacent to both sides of the edge line, a degree of complementarity of the reflection intensities of the pixels of the first segmented area adjacent to both sides of the edge line is obtained; based on the degree of complementarity, whether a dam needs to be constructed for the edge line is determined, and the edge line that does not need to be dammed is submerged to obtain a second segmented area;

[0068] The purpose of this step is to set a flooding rule to flood the highly reflective areas (suspected vape juice areas) and a dam-building rule to flood areas connected to the highly reflective areas, that is, other areas within the highly reflective areas. Conventional watershed segmentation constructs dams when encountering a distinct edge line. However, due to the varying reflective intensities of the vape juice area, the same vape juice area can have several distinct edge lines. This edge line divides the suspected vape juice area into a highly reflective suspected vape juice area and a non-reflective suspected vape juice area. Furthermore, a distinct edge line exists between the suspected vape juice area and the non-vape juice area. Therefore, we treat these two types of edge lines differently. The edge line within the suspected vape juice area does not require a dam, while the edge line between the suspected vape juice area and the non-vape juice area does require a dam.

[0069] The method for obtaining the complementary degree of the reflection intensity of the pixel points of the first segmented areas adjacent to the edge line on both sides thereof is as follows:

[0070] (1) Obtain the pixel points of the first segmentation area in two rows adjacent to the edge line on both sides, and divide them into the first row and the second row;

[0071] (2) Calculate the difference between the reflection intensity of each pixel in the first row and the reflection intensity of the corresponding pixel in the second row

[0072] (3) The average of the difference between the reflection intensity of each pixel in the first row and the reflection intensity of the corresponding pixel in the second row is taken as the degree of complementarity of the reflection intensities of the two rows of pixels adjacent to each other on both sides of the edge line, as follows:

[0073]

[0074] In the formula, H i is the complementary degree of the reflection intensity of the two rows of pixels adjacent to each other on both sides of the i-th edge line, k is the k-th pixel, n is the total number of pixels in each row, is the reflection intensity of the kth pixel in the first row of pixels, is the reflection intensity of the kth pixel in the second row of pixels. The difference between the two rows of pixels on both sides of the edge line represents the degree of complementarity of the reflection intensity of this group of pixels. The sum and average represent the degree of complementarity of the overall reflection intensity of the two rows of pixels adjacent to the edge line. When H i The larger the value, the greater the degree of complementarity, which means that the difference in reflection intensity of pixels on both sides of the edge line is large; conversely, the smaller the degree of complementarity, the smaller the reflection intensity of pixels on both sides of the edge line is.

[0075] It should be noted that there is a difference between the edge line inside the smoke oil area and the edge line between the smoke oil and non-smoke oil areas, such as Figure 2 As shown in the figure, the pixels on both sides of the internal edge line show two extremes, one with strong reflection and the other with no reflection. The pixels on both sides of the edge line between the e-liquid area and the non-e-liquid area show different reflection intensities, one with strong reflection and the other with weak reflection. Therefore, based on the above a priori conditions, when an edge line is drawn during watershed segmentation, the degree of complementarity of the reflection intensities of the pixels on both sides of the edge line is analyzed. That is, starting from the edge line, two adjacent rows of pixels on both sides of the edge line are selected, the reflection intensities of these pixels are obtained, and the degree of complementarity between the reflection intensities of the two rows of pixels is analyzed.

[0076] Among them, the method for judging whether it is necessary to build a dam on the edge line according to the degree of complementarity is:

[0077] Set the complementarity threshold H;

[0078] If e is used as the base, the complementary degree of the reflection intensity of the two rows of pixels adjacent to each other on both sides of the edge line is H i For the exponent, construct the exponential power The exponential power The reciprocal of If the complementarity threshold H is less than or equal to the threshold, the edge line does not need to build a dam;

[0079] Otherwise, the edge line needs to be dammed.

[0080] Furthermore, if the edge line does not need to be dammed, it will be flooded in the order of reflection intensity from large to small, and the same criteria will be used for subsequent flooding until the reflection intensity of the pixels on both sides of the edge line meets the need to build a dam. In this case, the edge line is considered to be the edge line between the smoke oil area and the non-smok oil area, and a dam is constructed on this edge line so that it is not flooded into the same area. That is, the edge line inside the smoke oil is conventionally flooded, and the edge line between the smoke oil and non-smok oil areas is dammed to obtain the second segmented area.

[0081] It should be noted that since the cigarette cartridge itself is made of plastic or metal, it will reflect light. The oil area is often more adherent and dense, so the oil area always appears in the shape of a parallax surface. When the camera is used to capture images, the top of the parallax surface will have a strong reflection, while the flatter surface will not reflect light. On the contrary, due to the smoothness of the smoke oil, the reflection on the top surface is more concentrated, making the other flatter surfaces almost non-reflective and appearing black. Therefore, the above-mentioned complementary degree of reflection intensity H i When H is smaller, it means that this edge line is the edge line between the smoke oil area and the non-smoke oil area; when H iIf it is larger, it means that this edge line is the edge line inside the e-liquid.

[0082] Step 4: Determine whether the cigarette cartridge has a liquid leakage defect based on the brightness of the pixels in each second segmented area.

[0083] The purpose of this step is to determine the oil leakage defect based on the area of suspected oil pollution.

[0084] The method for determining whether the cigarette cartridge has a liquid leakage defect based on the brightness of the pixel points in each second segmented area is as follows:

[0085] (1) Obtaining an HSV image of each second segmented area;

[0086] (2) Obtain the brightness value of each pixel in the HSV image of each second segmented area, and calculate the probability that the current second segmented area is the smoke oil area as follows:

[0087]

[0088] Where p is the probability that the current second segmentation area is the smoke oil area, 53 is the brightness value of light yellow, 7 is the brightness value of dark brown, m is the number of pixels in the current second segmentation area, H i is the brightness value of the i-th pixel in the current second segmentation area, and the brightness value of the segmentation area is normalized using 53-7. is the average brightness value in the segmented area, which is used as the brightness value of the current area;

[0089] It should be noted that since the second segmented area could be a smoke liquid area or condensate, and condensate is dark brown while smoke liquid is light yellow, the color of the pixels in the segmented area can be used to further determine whether there is a smoke liquid leak. Since dark brown and light yellow both fall into the yellow category, the HSV map of the segmented area is obtained, and the H value (i.e., brightness value) of the pixels in the segmented area is obtained. The probability p of the H value approaching yellow is calculated and used as the probability that the current second segmented area is a smoke liquid area.

[0090] (3) If the probability p of the current second segmented area being the smoke oil area is less than or equal to the probability threshold, the current second segmented area is the smoke oil area; otherwise, it is the condensate area; if p is smaller, it means that the current area is closer to light yellow, and the possibility that it is smoke oil is greater. In the present invention, a probability threshold of 0.4 is set. When p is less than or equal to 0.4, the current area is considered to be the smoke oil area. Conversely, when p is greater than or equal to 0.4, the current area is considered to be the condensate area; if there is a smoke oil area, the smoke cartridge has an oil leakage defect; if there is no smoke oil area, the smoke cartridge does not have an oil leakage defect.

[0091] 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 spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for identifying defects in electronic cigarettes, characterized in that: The method includes: Get the RGB image of the bottom surface of the cigarette cartridge; The reflection intensity of each pixel is obtained according to the first-order moment of the color of each pixel in the RGB image; According to the reflection intensity of each pixel and the reflection intensity of its neighboring pixels, the possibility of the pixel being the minimum point of watershed segmentation is obtained, and the pixel whose possibility is greater than the possibility threshold is regarded as the minimum point; Perform edge detection on the RGB image to obtain edge lines; Taking each minimum point in the RGB image as the starting point, flood its neighboring pixels and stop when encountering the edge line to obtain the first segmentation area; Obtaining a degree of complementarity of the reflection intensities of the pixels of the first segmented areas adjacent to both sides of the edge line according to the reflection intensities of the pixels of the first segmented areas adjacent to both sides of the edge line; Determine whether it is necessary to build a dam on the edge line according to the degree of complementarity, and submerge the edge line that does not need to be built with a dam to obtain a second segmentation area; Determine whether the cigarette cartridge has a liquid leakage defect based on the brightness of the pixel points in each second segmented area; The method for obtaining the complementary degree of the reflection intensity of the pixel points of the first segmented areas adjacent to both sides of the edge line according to the reflection intensity of the pixel points of the first segmented areas adjacent to both sides of the edge line is: Obtain two rows of pixel points of the first segmentation area adjacent to both sides of the edge line; Calculate the difference between the reflection intensity of each pixel in the first row and the reflection intensity of the corresponding pixel in the second row; The average of the difference between the reflection intensity of each pixel in the first row and the reflection intensity of the corresponding pixel in the second row is used as the complementary degree of the reflection intensity of the pixels in the first segmented area adjacent to both sides of the edge line; The method for determining whether a dam needs to be built on the edge line based on the degree of complementarity is: Setting a threshold for the degree of complementarity; If e is used as the base and the degree of complementarity is used as the exponent, an exponential power is constructed. If the reciprocal of the exponential power is less than or equal to the threshold of the degree of complementarity, the edge line does not need to be constructed with a dam. Otherwise, the edge line needs to be dammed; The method for judging whether the cigarette cartridge has a leakage defect according to the brightness of the pixel points in each second segmented area is: Obtain an HSV image of each second segmented region; Get the brightness value of each pixel in the HSV image of each second segmentation area, and calculate the probability that the current second segmentation area is the smoke oil area as follows: Where, is the probability that the current second segmented area is the smoke oil area, 53 is the brightness value of light yellow, 7 is the brightness value of dark brown, m is the number of pixels in the current second segmented area, is the brightness value of the i-th pixel in the current second segmentation area; If the second segmented area is the possibility of the smoke oil area When the possibility threshold is exceeded, the second segmented area is the smoke oil area, otherwise, it is the condensate area; if the smoke oil area exists, the smoke cartridge has a leaking defect.

2. The electronic cigarette defect identification method according to claim 1, characterized in that: The method for obtaining the reflection intensity of each pixel point according to the first-order moment of the color of each pixel point in the RGB image is: Calculate the first-order moment of each pixel in the RGB image, that is, the mean of the color values of the pixel on the R, G, and B channels, and use the mean as the reflection intensity of each pixel.

3. The electronic cigarette defect identification method according to claim 1, characterized in that: The method for obtaining the possibility of the pixel point being the minimum point of watershed segmentation according to the reflection intensity of each pixel point and the reflection intensity of the pixel point's neighboring pixels is: Taking each pixel as the center, obtain the difference between the reflection intensity of the pixel's neighboring pixels and the reflection intensity of the pixel itself; The average of the difference between the reflection intensity of the neighboring pixels and the reflection intensity of the pixel is taken as the uniformity of the reflection intensity in the neighborhood of the pixel; According to the reflection intensity of each pixel and the uniformity of the reflection intensity in the neighborhood of the pixel, the possibility of the pixel being the minimum point of watershed segmentation is obtained.

4. The electronic cigarette defect identification method according to claim 1, characterized in that: The method for obtaining the first segmented area is: Get each minimum point in the RGB image, and use the minimum point as the starting point. Submerge the neighboring pixels of the minimum point in the order of reflection intensity from large to small into pixels in the same area until the edge line is encountered. The area corresponding to each minimum point is obtained, that is, the first segmentation area.

Citation Information

Patent Citations

  • Polarized SAR image classification method combining polarization feature and watershed

    CN103870842A

  • Electronic cigarette piece detection device and method based on machine vision technology

    CN110451035A