Method and system for identifying electronic cigarette assembly parts

By adjusting the weight factor in the bilateral filtering algorithm, the problem of noise impact in the identification of electronic cigarette assembly parts is solved, the recognition accuracy and robustness are improved, and more efficient product quality monitoring is achieved.

CN118587436BActive Publication Date: 2024-12-06GUANGDONG FUWO INTELLIGENT MFG CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410633604.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-12-06
Estimated Expiration
2044-05-21

AI Technical Summary

Technical Problem

In the prior art, in the identification of electronic cigarette assembly parts, the bilateral filtering algorithm is not accurate enough to calculate the weight of noise pixels, resulting in low recognition accuracy and cannot achieve efficient product quality monitoring.

Method used

By calculating the grayscale feature quantity and similarity of the pixel points to be filtered, the weight factor in the bilateral filtering algorithm is adjusted, the image denoising process is optimized, and the recognition accuracy and robustness are enhanced.

Benefits of technology

Improve image noise removal effect, enhance the accuracy and reliability of component identification, and ensure the effectiveness of product quality monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587436B_ABST
    Figure CN118587436B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image data processing technology, and mainly to a method and system for identifying electronic cigarette assembly parts. The identification method includes performing semantic segmentation processing on a processed image to extract a component area in the processed image; calculating the representativeness of the pixel to be filtered in the component area according to the product of the grayscale feature quantity of the pixel to be filtered, and calculating the representativeness correction coefficient according to the similarity between the pixel to be filtered and the surrounding pixels; determining the weight factor of the surrounding pixels according to the product of the representativeness corresponding to the surrounding pixels of the pixel to be filtered in the filter window and the representativeness correction coefficient; using the weight factor to update the pixel weight in the bilateral filtering algorithm, and denoising the processed image; and identifying the electronic cigarette assembly parts on the denoised image. According to the solution of the present invention, the problem of low accuracy in the current recognition process of electronic cigarette assembly parts is solved.
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 technology, and more specifically, to a method and system for identifying electronic cigarette assembly parts. Background Art

[0002] As the e-cigarette market continues to expand, ensuring the safety and reliability of e-cigarette products has become an important task. By identifying components, the quality of the product manufacturing process can be effectively monitored, product quality can be improved, and user health can be protected. It also helps prevent imitations and counterfeit products from entering the market. The quality inspection of e-cigarette products mainly includes the inspection of e-cigarette components. At present, conventional quality inspection methods mainly rely on manual labor, which is inefficient, and in the face of a large number of products, it is mainly carried out through random inspections, and product quality cannot be guaranteed. In order to save manpower, engineers also try to identify and detect the assembly parts of e-cigarette products through image processing to determine the quality of e-cigarette products.

[0003] However, when collecting images of electronic assembly parts, due to the interference of light conditions, image transmission efficiency, and environmental vibration, a large amount of noise will be present in the collected images, which will greatly affect the accurate recognition of parts in the image. The existing algorithm for image denoising is the bilateral filtering algorithm, which can well preserve the edge information of the image by considering the spatial distance between pixels and the similarity between pixels, so that the image edges are still clear while denoising.

[0004] For example, in the Chinese invention patent with the publication number CN114463225A and the invention name of bilateral filtering method and device, it is disclosed that the bilateral filtering weight of the current central pixel and its neighboring pixels is determined based on the difference of the Gaussian filtering value of the current central pixel and its neighboring pixels, and the bilateral filtering value of the current central pixel is calculated based on the bilateral filtering weight and pixel value of the current central pixel and its neighboring pixels to realize the image filtering process. The problem with this prior art is that when a certain pixel point in the image is filtered using bilateral filtering, the pixel point may be a noise pixel point, and the pixel points in its window may also be noise pixels. Then, according to the filtering logic that the pixel points close to the grayscale value of the target pixel point in the existing algorithm will be given more weights, the grayscale value of the target pixel point after filtering obtained by the final weighted calculation will still be inaccurate, which will lead to incomplete filtering. This will also directly lead to low accuracy of the recognition process when identifying the assembly parts of the electronic cigarette, and it is impossible to achieve efficient product quality monitoring.

[0005] Based on this, how to solve the problem of low accuracy in the current identification process of electronic cigarette assembly parts is the key to effectively monitoring product manufacturing quality. Summary of the invention

[0006] In order to solve the above technical problems, the present invention provides solutions in the following aspects.

[0007] In the first aspect, the present invention provides a method for identifying electronic cigarette assembly parts, comprising: obtaining an image to be processed containing electronic cigarette assembly parts; performing semantic segmentation processing on the image to be processed to extract the part area in the image to be processed; calculating the representativeness of the pixel to be filtered in the part area according to the product of the grayscale feature quantities of the pixel to be filtered, wherein the grayscale feature quantity includes the grayscale value difference between the pixel to be filtered and its neighborhood pixels, the proportion of pixels with consistent grayscale in all pixels, and the distance value between pixels; obtaining a representative correction coefficient according to the similarity between the pixel to be filtered and the surrounding pixels; determining the weight factor of the surrounding pixels according to the product of the representativeness corresponding to the surrounding pixels of the pixel to be filtered in the filtering window and the representative correction coefficient; using the weight factor to update the pixel weight in the bilateral filtering algorithm, and denoising the image to be processed; and identifying electronic cigarette assembly parts on the denoised image.

[0008] The effect of the present invention is that by analyzing the grayscale features of each pixel point in the component area in the image, the weight factor of each surrounding pixel point in its window is determined when filtering a pixel point. In this way, the weight occupied by the pixel point with high noise possibility in the filtering window can be reduced when filtering the target pixel point, which will make the filtering result of the pixel point in the component image area more accurate. At the same time, by analyzing the similarity of each pixel point to be filtered and the pixel point in its window, the weight of the pixel point with high similarity to the pixel point to be filtered can be adaptively adjusted when filtering the pixel points in different areas of the component image, thereby controlling the filtering degree of the pixel point to be filtered. By optimizing the adjustment factor bilateral filtering algorithm, the component image after filtering has stronger texture details, which is convenient for subsequent recognition. It will also make the usability and accuracy of the bilateral filtering algorithm in this scene stronger, and make the system have better robustness.

[0009] In one embodiment, a representative calculation formula for the pixel to be filtered in the component area is: In the formula, Q x Indicates the representativeness of the x-th pixel in the component image area; H x Represents the gray value of the x-th pixel; H x,l Represents the average gray value of the pixels in the 8-neighborhood of the x-th pixel; C x Indicates the number of pixels in the component image that have the same grayscale value as the xth pixel; C allRepresents the number of all pixels in the component image; D x,min It represents the Euclidean distance between the pixel closest to the xth pixel and the xth pixel among the pixels with the same gray value as the nth pixel. If there is no pixel with the same gray value, let D x,min =1.

[0010] The beneficial effect of the present invention is that the noise pixels can be accurately determined by the representativeness of the pixel to be filtered and its surrounding pixels in the component area, thereby weakening the influence of the noise pixels and improving the image denoising effect.

[0011] In one embodiment, a representative correction coefficient is calculated based on the similarity between the pixel to be filtered and the surrounding pixels, including: calculating the similarity between the pixel to be filtered and each surrounding pixel in the filter window; and constructing a representative correction coefficient of the surrounding pixels corresponding to the pixel to be filtered in the component image area in combination with the texture density of the area surrounding the pixel to be filtered.

[0012] The beneficial effect of the present invention is that by calculating the representative correction coefficients of different types of surrounding pixels using the texture density, different types of case processing can be achieved, and the adaptability of the algorithm in image processing can be improved. In the actual filtering process of noise pixels, the integrity of the detailed texture area of ​​the parts can be guaranteed.

[0013] In one embodiment, the formula for calculating texture density includes: x,m =norm[S x ×|H x,max -H x,min |]; where T x,m Indicates the density of texture in the surrounding area when filtering the x-th pixel; S x H represents the information entropy value of the grayscale value of the pixel in the filter window when the x-th pixel is filtered; x,max and H x,min They respectively represent the maximum grayscale value and the minimum grayscale value within the filter window when filtering the x-th pixel.

[0014] In one embodiment, in combination with the texture density of the area surrounding the pixel to be filtered, a representative correction coefficient of the surrounding pixels corresponding to the pixel to be filtered in the component image area is constructed, including: in response to the texture density being greater than or equal to a set threshold, it is determined to be a texture-dense area, and a representative correction coefficient corresponding to the texture-dense area is constructed; in response to the texture density being less than the set threshold, it is determined to be a texture-sparse area, and a representative correction coefficient corresponding to the texture-sparse area is constructed.

[0015] The beneficial effect of the present invention is that by dividing the texture-dense area and the texture-sparse area, the representative correction coefficient can be calculated according to different situations, thereby improving the accuracy and reliability of the image filtering process.

[0016] In one embodiment, the calculation formula of the representative correction coefficient corresponding to the texture-dense area is: x,m =exp{-[|Q x -Q x,m |×(|Q x -Q a |×|Q x,m -Q a |)]}; The calculation formula of the representative correction coefficient corresponding to the sparse texture area is: W x,m =exp{-exp{-[|Q x -Q x,m |×(|Q x -Q a |×|Q x,m -Q a |)]}}; where W x,m It represents the representative correction coefficient of the mth surrounding pixel point in the filter window in the component image area when filtering the xth pixel point; Q x Indicates the representativeness of the x-th pixel in the component image area; Q x,m Indicates the representativeness of the mth surrounding pixel in the window in the component image area when filtering the xth pixel; Q a represents the average representative value of all pixels in the component area image; T x,m Indicates the density of the texture in the area around the x-th pixel when filtering.

[0017] In one embodiment, the weight factor is calculated as follows: x,m =norm(Q x,m ×W x,m 0; where F x,m represents the weight factor of the mth surrounding pixel in the filter window corresponding to the xth pixel; Q x,m W represents the representativeness of the mth surrounding pixel point in the filter window corresponding to the xth pixel point in the component image area; x,m It represents the representative correction coefficient of the mth surrounding pixel point in the filter window corresponding to the xth pixel point in the component image area.

[0018] In one embodiment, the weight factor is used to update the pixel weight in the bilateral filtering algorithm and denoise the image to be processed, including: setting the filter window size and determining the spatial domain standard deviation and the grayscale domain standard deviation; constructing a weight function of pixel distance based on the spatial domain standard deviation; constructing a weight function of pixel grayscale value difference based on the grayscale domain standard deviation; multiplying the weight function of pixel distance, the weight function of pixel grayscale value difference and the weight factor as a comprehensive weight; and filtering the image to be processed using the comprehensive weight to complete denoising.

[0019] The beneficial effect of the present invention is that the weights in the bilateral filtering algorithm are updated through the calculated weight factors, and the optimized filtering algorithm can be used for image denoising, thereby effectively improving the image quality and making the subsequent image recognition process more accurate.

[0020] In one embodiment, filtering the image to be processed using the comprehensive weight includes: calculating a weighted average of pixel values ​​of surrounding pixels using the comprehensive weight, and using the weighted average as the pixel value of the pixel to be filtered.

[0021] In a second aspect, the present invention further provides an identification system for electronic cigarette assembly parts, comprising: a processor; a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the identification method for electronic cigarette assembly parts as described in one or more embodiments above is implemented.

[0022] The present invention analyzes the grayscale characteristics of each pixel in the component image area and obtains the weight factor of each surrounding pixel in the window when filtering a pixel, so that the filtering result of each pixel is more accurate, effectively improving the accuracy and reliability of image recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0024] Figure 1 is a flow chart schematically illustrating a method for identifying electronic cigarette assembly parts according to an embodiment of the present invention;

[0025] Figure 2 is an image schematically showing the assembly parts of an electronic cigarette according to an embodiment of the present invention;

[0026] Figure 3is a schematic diagram showing an image of electronic cigarette assembly parts after image denoising according to an embodiment of the present invention;

[0027] Figure 4 Schematically shows a structural block diagram of an identification system for electronic cigarette assembly parts according to this embodiment. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0029] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0030] Figure 1 FIG. 1 is a flow chart schematically illustrating a method 100 for identifying electronic cigarette assembly parts according to an embodiment of the present invention.

[0031] like Figure 1 As shown, in step S101, an image to be processed is obtained. Specifically, an image containing electronic cigarette assembly parts can be obtained by an industrial camera as the image to be processed to achieve image processing and identification of electronic cigarette assembly parts.

[0032] At step S102, the component region is extracted. Specifically, semantic segmentation is performed on the image to be processed to extract the component region in the image to be processed. In some embodiments, an existing convolutional neural network algorithm can be used to extract the component region.

[0033] In step S103, the representativeness of the pixel to be filtered is calculated. Specifically, the representativeness of the pixel to be filtered in the component area is calculated according to the product of the grayscale feature quantity of the pixel to be filtered, wherein the grayscale feature quantity includes the grayscale value difference between the pixel to be filtered and its neighboring pixels, the proportion of pixels with the same grayscale in all pixels, and the distance value between pixels.

[0034] In some embodiments, a representative calculation formula for the pixel to be filtered in the component area is: In the formula, Q x Indicates the representativeness of the x-th pixel in the component image area; H x Represents the gray value of the x-th pixel; H x,l Represents the average gray value of the pixels in the 8-neighborhood of the x-th pixel; C x Indicates the number of pixels in the component image that have the same grayscale value as the xth pixel; Call Represents the number of all pixels in the component image; D x,min It represents the Euclidean distance between the pixel closest to the x-th pixel and the x-th pixel among the pixels with the same grayscale value as the x-th pixel. If there is no pixel with the same grayscale value, let D x,min =1.

[0035] At step S104, a representative correction coefficient is calculated. Specifically, the representative correction coefficient is calculated based on the similarity between the pixel to be filtered and the surrounding pixels. In some embodiments, the similarity between the pixel to be filtered and each surrounding pixel in the filter window can be calculated. Combined with the texture density of the area around the pixel to be filtered, a representative correction coefficient of the surrounding pixels corresponding to the pixel to be filtered in the component image area is constructed.

[0036] The calculation formula of texture density includes: x,m =norm[S x ×|H x,max -H x,min |]; where T x,m Indicates the density of texture in the surrounding area when filtering the x-th pixel; S x H represents the information entropy value of the grayscale value of the pixel in the filter window when the x-th pixel is filtered; x,max and H x,min They respectively represent the maximum grayscale value and the minimum grayscale value within the filter window when filtering the x-th pixel.

[0037] In response to the texture density being greater than or equal to the set threshold, it is determined to be a texture-dense area, and a representative correction coefficient corresponding to the texture-dense area is constructed. The formula is: W x,m =exp{-[|Q x -Q x,m |×(|Q x -Q a |×|Q x,m -Q a |)]}.

[0038] In response to the texture density being less than the set threshold, it is determined to be a texture sparse area, and a representative correction coefficient corresponding to the texture sparse area is constructed. The formula is: W x,m =exp{-exp{-[|Q x -Q x,m |×(|Q x -Q a |×|Q x,m -Q a |)]}}.

[0039] In the above formula, Wx,m It represents the representative correction coefficient of the mth surrounding pixel point in the filter window in the component image area when filtering the xth pixel point; Q x Indicates the representativeness of the x-th pixel in the component image area; Q x,m Indicates the representativeness of the mth surrounding pixel in the window in the component image area when filtering the xth pixel; Q a represents the average representative value of all pixels in the component area image; T x,m Indicates the density of the texture in the area around the x-th pixel when filtering.

[0040] In step S105, the weight factor is calculated. Specifically, the weight factor of the surrounding pixels is determined according to the product of the representativeness of the surrounding pixels corresponding to the pixel to be filtered in the filtering window and the representativeness correction coefficient. The calculation formula of the weight factor is: x,m =norm(Q x,m ×W x,m );where E x,m represents the weight factor of the mth surrounding pixel in the filter window corresponding to the xth pixel; Q x,m W represents the representativeness of the mth surrounding pixel point in the filter window corresponding to the xth pixel point in the component image area; x,m It represents the representative correction coefficient of the mth surrounding pixel point in the filter window corresponding to the xth pixel point in the component image area.

[0041] In step S106, the image is denoised. Specifically, the pixel weights in the bilateral filtering algorithm are updated using the weight factors, and the image to be processed is denoised.

[0042] In some embodiments, an optimized bilateral filtering algorithm can be obtained by updating pixel weights. First, the filter window size is set, and the spatial domain standard deviation and the grayscale domain standard deviation are determined. Then, a weight function of pixel distance is constructed based on the spatial domain standard deviation. Next, a weight function of pixel grayscale value difference is constructed based on the grayscale domain standard deviation. Furthermore, the weight function of pixel distance, the weight function of pixel grayscale value difference, and the weight factor are multiplied together as a comprehensive weight. Finally, the image to be processed is filtered using the comprehensive weight to complete denoising. In the specific operation steps of the denoising process, the weighted average of the pixel values ​​of the surrounding pixels can be calculated using the comprehensive weight, and the weighted average is used as the pixel value of the pixel to be filtered.

[0043] In step S107, image recognition is performed. Specifically, the denoised image is subjected to electronic cigarette assembly component recognition. For example, a recognition model obtained by training an existing convolutional neural network can be used for the recognition process. Since this is a prior art, it will not be described in detail.

[0044] Next, the above scheme will be elaborated in detail in combination with the specific implementation process.

[0045] Step 1: Obtain images of electronic cigarette assembly parts. You can use a high-definition camera to capture images of electronic cigarette assembly parts and perform grayscale processing, such as Figure 2 The image of electronic cigarette assembly parts with noise captured by a high-definition camera is shown in .

[0046] Step 2: Based on the grayscale characteristics of each pixel in the component area, obtain the weight factor of each surrounding pixel in the window when filtering a pixel.

[0047] The core purpose of the present invention is to use an improved bilateral filtering algorithm to perform image denoising on the component image area. The bilateral filtering algorithm is optimized by calculating the weight factor of each surrounding pixel point in the window when filtering a pixel point. The main step is to analyze the grayscale characteristics of each pixel point in the component image area. Therefore, after obtaining the weight factor of each surrounding pixel point in the window when filtering a pixel point, the present invention subsequently denoises the image according to the optimized bilateral filtering algorithm, and then identifies the electronic cigarette components.

[0048] The present invention analyzes the weight factor of each surrounding pixel in the window when filtering each pixel:

[0049] (1) Use semantic segmentation method to extract the component area in the entire captured image.

[0050] In order to facilitate the analysis of pixel points in the component area in the entire image captured by a high-definition camera or an industrial camera, in this embodiment, a U-Net (U-Net Convolutional Network) convolutional neural network is used to extract the component area in the entire image. This method is a well-known technology and will not be described in detail here.

[0051] (2) Based on the grayscale value of each pixel in the component area, the representativeness of each pixel in the component image area is obtained. It is necessary to analyze the grayscale value of each pixel in the component area to obtain the representativeness of each pixel in the component image area. The grayscale value expression includes pixel grayscale consistency, pixel distance, etc.

[0052] According to the characteristics of noise in the image, the distribution of noise pixels in the image is relatively sparse, and the number of pixels with the same grayscale value as the noise pixels in the image is also relatively rare. Then the pixels with the above two characteristics will have a lower representativeness in the component image, the stronger the possibility of noise, and the smaller the corresponding weight factor. Therefore, based on the above reasons, the representativeness of each pixel in the component image area can be calculated:

[0053] In the formula, Q x Indicates the representativeness of the x-th pixel in the component image area; H x Represents the gray value of the x-th pixel; H x,l Represents the average gray value of the pixels in the 8-neighborhood of the x-th pixel; C x Indicates the number of pixels in the component image that have the same grayscale value as the xth pixel; C all Represents the number of all pixels in the component image; D x,min It represents the Euclidean distance between the pixel closest to the x-th pixel and the x-th pixel among the pixels with the same grayscale value as the x-th pixel. If there is no pixel with the same grayscale value, let D x,min =1.

[0054] In the above formula, |H x -H x,l | represents the difference between the grayscale value of the x-th pixel and the average grayscale value of the pixels in its 8-neighborhood. The smaller the value, the smaller the difference between the two. Then the x-th pixel will be more representative in the image, the less likely it is to be noise, and the larger the corresponding weight factor. It indicates the ratio of the number of pixels with the same gray value as the xth pixel in the component image to the total number of pixels. The larger the value, the more representative the xth pixel is in the image, the less likely it is to be noise, and the larger the corresponding weight factor. x,min The smaller it is, the closer the pixel with the same grayscale value as the x-th pixel is to it, so the credibility of the number of pixels with the same grayscale value will be greater, the representativeness of the pixel in the image will be greater, the possibility of it being noise will be smaller, and the weight factor will be larger.

[0055] (3) Based on the similarity between each pixel to be filtered and each surrounding pixel in its window, and combined with the texture density of the area around each pixel to be filtered, a representative correction coefficient of each pixel in the component image area is obtained.

[0056] Through the above steps, the representativeness of each pixel in the component image area can be obtained. However, in the actual filtering process of noise pixels, the integrity of the detail texture area of ​​the component needs to be guaranteed at the same time. Therefore, in this embodiment, the similarity between each pixel to be filtered and each surrounding pixel in its window is calculated, and combined with the texture density of the area around the pixel to be filtered, the representative correction coefficient of each pixel in the component image area is obtained.

[0057] When the texture density of the area around the pixel to be filtered is greater, a greater weight is given to the pixel with greater similarity in its window, that is, a certain degree of positive compensation is performed on the representativeness of the pixel with greater similarity to the pixel to be filtered, so that more original detail information is retained as much as possible during filtering. When the texture density of the area around the pixel to be filtered is smaller, a greater weight is given to the pixel with less similarity in its window, that is, a certain degree of reverse compensation is performed on the representativeness of the pixel with less similarity to the pixel to be filtered, so that when filtering, the pixel to be filtered is filtered to a greater extent as much as possible.

[0058] In order to achieve the above process, this embodiment needs to select a 7*7 area of ​​pixels around each pixel to be filtered for texture density analysis. At the same time, a 5*5 area of ​​pixels around the pixel to be filtered is selected as a filtering window for analysis.

[0059] First, calculate the texture density of the area around each pixel to be filtered:

[0060] T x,m =norm[S x ×|H x,max -H x,min |], where T x,m Indicates the density of texture in the surrounding area when filtering the x-th pixel; S x H represents the information entropy value of the grayscale value of the pixel in the filter window when the x-th pixel is filtered; x,max and H x,min They respectively represent the maximum grayscale value and the minimum grayscale value within the filter window when filtering the x-th pixel.

[0061] In the above formula, S x The larger it is, the greater the information entropy value of the grayscale value of the pixel in the window when the pixel to be filtered is filtered, which means that the grayscale value of the pixel in the window has more different grayscale levels, and the texture density in the window will be greater. x,max -H x,minThe larger | is, the greater the polarization degree of the grayscale value of the pixels in the window is, the greater the possibility of the existence of a strong edge and the greater the texture density.

[0062] After obtaining the texture density of the area around each pixel, a threshold is set to determine the texture density. For example, the threshold θ can be set to 0.5. x,m ≥θ, the area will be identified as a dense texture area, otherwise, it will be identified as a sparse texture area.

[0063] Then, according to the texture features of the area around each pixel to be filtered, when filtering each pixel, the representative correction coefficient of each surrounding pixel in the window in the component image area is established to establish different calculation formulas: x,m When ≥θ, W x,m =exp{-[|Q x -Q x,m |×(|Q x -Q a |×|Q x,m -Q a |)]}. When T x,m <θ, W x,m =exp{-exp{-[|Q x -Q x,m |×(|Q x -Q a |×|Q x,m -Q a |)]}}.

[0064] Where W x,m It represents the representative correction coefficient of the mth surrounding pixel point in the filter window in the component image area when filtering the xth pixel point; Q x Indicates the representativeness of the x-th pixel in the component image area; Q x,m Indicates the representativeness of the mth surrounding pixel in the window in the component image area when filtering the xth pixel; Q a represents the average representative value of all pixels in the component area image; T x,m Indicates the density of texture in the surrounding area when filtering the x-th pixel. x , Q x,m The calculation logic is the same as the above Q n Consistent.

[0065] In the above formula, |Q x -Q x,m| represents the difference between the representativeness of the x-th pixel in the component image area and the representativeness of the m-th surrounding pixel in its window in the component image area. The smaller the value, the greater the similarity. |Q x -Q a |with|Q x,m -Q a | respectively represent the representativeness of the x-th pixel in the component image area and the difference between the representativeness of the m-th surrounding pixel in its window in the component image area and the average representativeness of all pixels in the component area image. The smaller these two values ​​are, the more |Q x -Q x,m The greater the credibility of |, the greater the similarity. x -Q x,m |×(|Q x -Q a |×|Q x,m -Q a |)]} represents the similarity between the xth pixel to be filtered and the mth surrounding pixel in the window. According to the detailed logic of step b, when T x,m ≥θ, the greater the similarity, the greater the representativeness correction coefficient; otherwise, the smaller it is.

[0066] (4) Based on the representativeness of each pixel in the component image area and its representativeness correction coefficient, a weight factor of each surrounding pixel in the window when filtering a pixel is obtained.

[0067] Detailed logic: Through the analysis of the above steps, the representativeness of each pixel in the component image area and its representativeness correction coefficient have been obtained. At the same time, since the representativeness of each pixel in the component image area in this scheme represents its weight in the filtering process. Specifically, the stronger the representativeness of each pixel in the component image area, the greater its weight. In this step, the representativeness of each pixel in the component image area is corrected using the representativeness correction coefficient of each pixel in the component image area, and the weight factor when filtering the central pixel to be filtered can be obtained. According to the above logic, the weight factor of each surrounding pixel in the window when filtering a pixel is calculated:

[0068] E x,m =noem(Q x,m ×W x,m )

[0069] In the formula, E x,m represents the weight factor of the mth surrounding pixel in the filter window corresponding to the xth pixel; Q x,mW represents the representativeness of the mth surrounding pixel point in the filter window corresponding to the xth pixel point in the component image area; x,m It represents the representative correction coefficient of the mth surrounding pixel point in the filter window corresponding to the xth pixel point in the component image area. Finally, norm() is used to control the value range of the weight factor to [0,1].

[0070] Step 3: Use the optimized bilateral filtering algorithm to denoise the image of electronic cigarette assembly parts and identify the electronic cigarette assembly parts.

[0071] First, the image of the electronic cigarette assembly parts is denoised. The specific steps are as follows:

[0072] 1. The filter window size of each pixel in the component image area is specified to be 5*5;

[0073] 2. Determine the standard deviation of the spatial domain and the standard deviation of the grayscale domain;

[0074] 3. According to the spatial domain standard deviation, a weight function about the distance between pixels is constructed to measure the similarity between pixels;

[0075] 4. According to the standard deviation of the grayscale domain, a weight function about the difference between pixel grayscale values ​​is constructed to measure the similarity between pixel grayscale values;

[0076] 5. For each pixel, the weight function of the spatial domain and the grayscale domain is multiplied with the weight factor of each surrounding pixel obtained in this embodiment to obtain a comprehensive weight, which is applied to the surrounding pixels to calculate the weighted average value for filtering. Specifically, the weighted average value of the pixel values ​​of the surrounding pixels is calculated using the comprehensive weight, and the weighted average value is used as the pixel value of the pixel to be filtered.

[0077] 6. The image of the electronic cigarette assembly parts after image denoising is as follows Figure 3 shown.

[0078] Then, a convolutional neural network (CNN) is used to identify the electronic cigarette assembly parts image after image denoising. CNN is an existing well-known technology and will not be described in detail here.

[0079] Figure 4 Schematically shows a structural block diagram of an identification system for electronic cigarette assembly parts according to this embodiment.

[0080] The present invention also provides an identification system for electronic cigarette assembly parts. Figure 4As shown, the system includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the identification method for electronic cigarette assembly parts described above is implemented.

[0081] The system also includes other components familiar to those skilled in the art, such as a communication bus and a communication interface, whose configuration and functions are known in the art and thus will not be described in detail here.

[0082] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that may be used to store the required information and may be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.

[0083] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0084] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A method for identifying electronic cigarette assembly parts, characterized in that: include: Acquire an image to be processed containing electronic cigarette assembly parts; Performing semantic segmentation processing on the image to be processed to extract the component area in the image to be processed; The representativeness of the pixel to be filtered in the component area is calculated based on the product of the grayscale feature quantities of the pixel to be filtered, where the grayscale feature quantities include the grayscale value difference between the pixel to be filtered and its neighboring pixels, the proportion of pixels with the same grayscale in all pixels, and the distance value between pixels; The representative correction coefficient is calculated based on the similarity between the pixel to be filtered and the surrounding pixels; Determine the weight factor of the surrounding pixels according to the product of the representativeness corresponding to the surrounding pixels of the pixel to be filtered in the filtering window and the representativeness correction coefficient; Using the weight factor to update the pixel weight in the bilateral filtering algorithm, and denoising the image to be processed; Identify electronic cigarette assembly parts on the denoised image; The representative calculation formula of the pixel to be filtered in the component area is: ; In the formula, Indicates the representativeness of the x-th pixel in the component image area; Represents the gray value of the x-th pixel; Represents the average gray value of the pixels in the 8-neighborhood of the x-th pixel; Indicates the number of pixels in the component image that have the same grayscale value as the xth pixel; Indicates the number of all pixels in the component image; It represents the Euclidean distance between the pixel closest to the x-th pixel and the x-th pixel among the pixels with the same gray value as the x-th pixel. If there is no pixel with the same gray value, let ; The representative correction coefficient is calculated based on the similarity between the pixel to be filtered and the surrounding pixels, including: For the filtered pixel, calculate the similarity between it and each surrounding pixel in the filter window; Combined with the texture density of the area around the pixel to be filtered, a representative correction coefficient of the surrounding pixels corresponding to the pixel to be filtered in the component image area is constructed; The calculation formula of texture density includes: ; In the formula, Indicates the density of texture in the surrounding area when filtering the x-th pixel; Indicates the information entropy value of the grayscale value of the pixel in the filter window when the x-th pixel is filtered; and They respectively represent the maximum grayscale value and the minimum grayscale value in the filter window when filtering the x-th pixel; Combined with the texture density of the area around the pixel to be filtered, the representative correction coefficients of the surrounding pixels corresponding to the pixel to be filtered in the component image area are constructed, including: In response to the texture density being greater than or equal to a set threshold, determining that the area is a texture-dense area, and constructing a representative correction coefficient corresponding to the texture-dense area; In response to the texture density being less than a set threshold, determining that the area is a sparse texture area, and constructing a representative correction coefficient corresponding to the sparse texture area; The calculation formula for the representative correction coefficient corresponding to the texture-dense area is: ; The calculation formula of the representative correction coefficient corresponding to the sparse texture area is: ; In the formula, It represents the representative correction coefficient of the mth surrounding pixel point in the filter window in the component image area when filtering the xth pixel point; Indicates the representativeness of the x-th pixel in the component image area; Indicates the representativeness of the mth surrounding pixel in the window in the component image area when filtering the xth pixel; Indicates the average representative value of all pixels in the component area image; Indicates the density of texture in the surrounding area when filtering the x-th pixel; The calculation formula of the weight factor is: ; In the formula, Represents the weight factor of the mth surrounding pixel point in the filter window corresponding to the xth pixel point; Indicates the representativeness of the mth surrounding pixel point in the filter window corresponding to the xth pixel point in the component image area; It represents the representative correction coefficient of the mth surrounding pixel point in the filter window corresponding to the xth pixel point in the component image area.

2. The method for identifying electronic cigarette assembly parts according to claim 1, characterized in that: The pixel weight in the bilateral filtering algorithm is updated by using the weight factor, and the image to be processed is denoised, including: Set the filter window size and determine the standard deviation in the spatial domain and the grayscale domain; Construct a weight function of pixel distance based on the standard deviation in the spatial domain; Construct a weight function of pixel gray value difference according to gray domain standard deviation; The weight function of pixel distance, the weight function of pixel gray value difference and the weight factor are multiplied together as the comprehensive weight; The image to be processed is filtered using the comprehensive weight to achieve denoising.

3. The method for identifying electronic cigarette assembly parts according to claim 2, characterized in that: Filtering the image to be processed by using the comprehensive weight includes: The weighted average of the pixel values ​​of the surrounding pixels is calculated using the comprehensive weight, and the weighted average is used as the pixel value of the pixel to be filtered.

4. A recognition system for electronic cigarette assembly parts, characterized in that: include: processor; A memory storing computer program instructions, wherein when the computer program instructions are executed by the processor, the method for identifying electronic cigarette assembly parts according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Bilateral filtering method and device

    CN114463225A

  • Non-local TV image de-noising method based on independent component analysis and singular value decomposition

    CN106897971A

  • Industrial part pose recognition method and device, electronic equipment and storage medium

    CN113192097A