CN114140417A - Cigarette filter stick identification method and system based on machine vision - Google Patents

Cigarette filter stick identification method and system based on machine vision Download PDF

Info

Publication number
CN114140417A
CN114140417A CN202111417889.XA CN202111417889A CN114140417A CN 114140417 A CN114140417 A CN 114140417A CN 202111417889 A CN202111417889 A CN 202111417889A CN 114140417 A CN114140417 A CN 114140417A
Authority
CN
China
Prior art keywords
filter stick
image
edge
filter
circle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111417889.XA
Other languages
Chinese (zh)
Inventor
王征勇
曾赛
周德祥
姜宇卉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Tobacco Guangdong Industrial Co Ltd
Original Assignee
China Tobacco Guangdong Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Tobacco Guangdong Industrial Co Ltd filed Critical China Tobacco Guangdong Industrial Co Ltd
Priority to CN202111417889.XA priority Critical patent/CN114140417A/en
Publication of CN114140417A publication Critical patent/CN114140417A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/168Segmentation; Edge detection involving transform domain methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/181Segmentation; Edge detection involving edge growing; involving edge linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20061Hough transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30242Counting objects in image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of image recognition, and provides a cigarette filter stick recognition method and system based on machine vision, wherein the method comprises the following steps: collecting a vertical section image of the cigarette filter stick; preprocessing the acquired image and intercepting a filter stick area in the image; identifying the filter stick based on the intercepted filter stick area, acquiring the edge, the circle center and the radius of the filter stick through edge detection and circle detection, and labeling the edge and the circle center of the filter stick in the filter stick area image; performing abnormal removal on the identified filter stick; and calculating the number of the circle centers and/or the filter stick profiles in the filter stick area images through image detection to obtain the counting result of the cigarette filter sticks. The invention can obtain the accurate cigarette filter stick position and counting result without a large amount of manual correction operation.

Description

Cigarette filter stick identification method and system based on machine vision
Technical Field
The invention relates to the technical field of image recognition, in particular to a cigarette filter stick recognition method and system based on machine vision.
Background
At present, there are two main types of image-based filter stick counting methods in the industry, one is area myopia estimation, for example, a machine vision-based cigarette filter stick on-line counting and quality detection method proposed by zhanghui et al, and a filter stick counting method and device based on image acquisition and recognition proposed by royal qi et al. However, the essence of the area method is an estimation method, the accuracy is low, and the accuracy cannot be corrected by later-stage manual work, so that the cost for evaluating the accuracy is high. The recognition algorithm based on machine learning is also provided, for example, a round-like object recognition counting detection algorithm based on machine vision and deep learning and a cigarette filter stick counting method based on AA R2Unet and HMM, which are proposed by Zhang 22531et al, the algorithm accuracy is 98.7%, the method has the advantages that the correction can be carried out in the later period, but the number of filter sticks of each filter stick container is about 4000-10000 in the actual use process, the number of the filter sticks needing manual marking is also 40-100 according to the accuracy rate of 99.0%, and the use requirement under the actual use scene cannot be met.
Disclosure of Invention
In order to overcome the defects that a large number of data samples need to be marked manually and the working efficiency is low in the prior art, the invention provides a cigarette filter stick identification method based on machine vision and a cigarette filter stick identification system based on machine vision.
In order to solve the technical problems, the technical scheme of the invention is as follows:
a cigarette filter stick identification method based on machine vision comprises the following steps:
s1, collecting vertical section images of the cigarette filter stick;
s2, preprocessing the acquired image and intercepting a filter stick area in the image;
s3, identifying the filter stick based on the intercepted filter stick area, obtaining the edge, the circle center and the radius of the filter stick through edge detection and circle detection, and marking the edge and the circle center of the filter stick in the filter stick area image;
s4, performing abnormal rejection according to the identified filter stick;
and S5, calculating the number of the circle centers and/or the filter stick outlines in the filter stick area images through image detection to obtain the cigarette filter stick counting result.
According to the technical scheme, the filter stick area is firstly identified and intercepted, noise interference outside the filter stick area in an image is removed, the edge, the circle and the radius of the filter stick in the filter stick area are identified through an edge detection method and a circle detection method based on machine vision, then an abnormal identification result is further removed, and finally the image subjected to identification and abnormal removal is counted to obtain the accurate cigarette filter stick position and the accurate counting result.
The invention further provides a cigarette filter stick recognition system based on machine vision, which is applied to the cigarette filter stick recognition method based on machine vision provided by any scheme. The image acquisition module is used for acquiring a vertical section image of the cigarette filter stick; the preprocessing module is used for preprocessing the acquired image; the filter stick region extraction module is used for intercepting a filter stick region image in the image; the filter stick identification module is used for identifying the filter stick, acquiring the edge, the circle center and the radius of the filter stick through edge detection and circle detection, and annotating the edge and the circle center of the filter stick in the filter stick area image; the abnormal removing module is used for performing abnormal removing according to the identified filter stick; the filter stick counting module is used for calculating the number of circle centers and/or filter stick outlines in the filter stick area images through image detection and outputting cigarette filter stick counting results.
As a preferred scheme, the system also comprises a human-computer interaction module, wherein the human-computer interaction module is used for displaying the image marked with the edge and the center of the filter stick and the counting result of the cigarette filter stick, and is used for manually marking the false identification and missing identification labels.
Compared with the prior art, the technical scheme of the invention has the beneficial effects that:
according to the invention, the filter stick area is firstly identified and intercepted, so that the noise interference outside the filter stick area in the image is removed, and the influence of the noise interference on the accuracy of the identification result in the filter stick identification process can be effectively reduced;
according to the invention, the edge, the circle and the radius of the filter stick in the filter stick area are identified through the edge detection method and the circle detection method based on machine vision, so that a large amount of identification data do not need to be corrected manually, the accurate cigarette filter stick position and counting result can be obtained, and the operating efficiency of filter stick counting is effectively improved;
the invention also eliminates the abnormal recognition result, can avoid the false recognition of the holes between the filter sticks and further improves the accuracy of the filter stick recognition.
Drawings
Fig. 1 is a flowchart of a cigarette filter rod recognition method based on machine vision according to embodiment 1.
Fig. 2 is a vertical sectional image of the cigarette filter rod collected in example 1.
Fig. 3 is a schematic diagram showing the detection result of the edge of the filter stick region in example 1.
Figure 4 is a schematic diagram of the plug zone expansion process of example 1.
Figure 5 is a filter rod image of a slim cigarette of example 1.
Figure 6 is an edge detection diagram of a filter rod according to example 1.
Figure 7 is a schematic representation of edge detection of the particulate filter rod of example 1.
Figure 8 is a schematic diagram of the location of a misidentified hole in an image of a filter rod region of example 1.
Fig. 9 is an architecture diagram of a cigarette filter rod recognition system based on machine vision of example 3.
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the patent;
for the purpose of better illustrating the embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product;
it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The technical solution of the present invention is further described below with reference to the accompanying drawings and examples.
Example 1
The present embodiment proposes a method for identifying a cigarette filter stick based on machine vision, which is a flowchart of the method for identifying a cigarette filter stick based on machine vision according to the present embodiment, as shown in fig. 1.
The cigarette filter stick recognition method based on machine vision provided by the embodiment comprises the following steps:
and S1, collecting the vertical section image of the cigarette filter stick.
In this embodiment, an industrial camera is used to obtain a vertical cross-sectional image of a cigarette filter rod of fixed focal length and fixed pixel size.
As shown in fig. 2, this is a vertical sectional image of the cigarette filter rod collected in the present example. Wherein the rectangular box content is noise interference outside the container.
And S2, preprocessing the acquired image and intercepting a filter stick area in the image.
In this embodiment, the steps of preprocessing the acquired image and intercepting the filter stick region in the image include:
s2.1, graying the image to obtain a grayscale image;
s2.2, obtaining the edge of the filter stick area in the gray scale image by a canny edge detection method;
s2.3, connecting the edges of the filter stick areas through expansion treatment;
s2.4, searching the contour through a contour tracking algorithm, taking the maximum contour in the image as the contour of the filter stick region, and intercepting according to the external rectangle of the contour of the filter stick region to obtain the image of the filter stick region.
In this embodiment, the filter stick region is first identified and intercepted, which is intended to directly remove noise interference outside the filter stick region in the image. In the embodiment, the obvious edge exists between the filter stick and the container for placing the filter stick, so that the filter stick area is taken as an overall profile to be extracted, and the overall filter stick area is detected and identified through edge detection to obtain the image of the filter stick area.
As shown in fig. 3, a schematic diagram of the edge detection result of the filter rod area in the present embodiment is shown. As can be seen from the figure, a plurality of noise interferences exist outside the container, and the accuracy of the identification result is influenced by directly applying the edge detection result to the filter stick identification.
Further, since there are discontinuous pixels at the edge of the filter rod area, the embodiment performs expansion processing by a partition method of the OpenCV library to connect the edges of the filter rod area.
As shown in fig. 4, a schematic diagram of the expansion processing of the plug region in the present embodiment is shown. In the embodiment, the image is expanded to obtain the complete edge of the filter stick region, so that the filter stick region can be further identified and intercepted.
In another embodiment, the method further comprises the step of judging whether the target filter stick is a fine cigarette or a non-fine cigarette. Specifically, the center coordinates and the circle radius of the filter stick edge obtained by canny edge detection are obtained by primary circle detection, and whether the type of the filter stick is a fine filter stick or not is judged according to the radius of the main circle.
Further, when the filter stick type is a non-fine cigarette, executing the step S3; when the filter type is a fine cigarette, the brightness of the image is equalized, and then step S3 is executed.
As shown in fig. 5, in the embodiment, in consideration of the fact that the requirement for image brightness is high in filter rod recognition of a slim cigarette, the image is subjected to brightness equalization and then further filter rod recognition in the case that the slim cigarette is used as a filter rod recognition target, so that the accuracy of filter rod recognition can be effectively improved, and the recognition effect is prevented from being influenced by too low brightness or uneven brightness.
S3, identifying the filter stick based on the intercepted filter stick area, obtaining the edge, the circle center and the radius of the filter stick through edge detection and circle detection, and marking the edge and the circle center of the filter stick in the filter stick area image.
In this step, the step of identifying the filter stick includes:
s3.1, adjusting an edge detection threshold value of a canny edge detection method through the canny edge detection method to obtain the edge of each filter stick in the filter stick area image;
s3.2, removing the particle edges of the filter stick edge representation by searching a small outline to obtain the filter stick edge representation with clear circumference;
and S3.3, detecting the edge, the circle center and the radius of the filter stick according to the preset radius range parameters by using a Hough circle detection method, and labeling the edge and the circle center of the filter stick. Wherein the radius range parameter includes a minimum distance between centers of the circles, the minimum distance between centers of the circles being set to twice the minimum radius.
In the embodiment, after the filter stick area image is obtained, the filter stick is in a regular circle shape, so that the circle and the radius of the filter stick are obtained by circle detection, and the identification and the positioning of the filter stick are further realized. As shown in fig. 6, this is a filter rod edge detection diagram of the present embodiment.
Further, for the particle filter stick, the embodiment also proposes to remove the particle edge by searching the small outline to obtain the filter stick edge representation with clear circumference. As shown in fig. 7, the edge detection of the granular filter stick is schematically shown. For the edge detection image of the particle filter stick, the circumferential edge needs to be preserved, but the particle edge needs to be removed at the same time, which cannot be achieved if the parameters are adjusted by the edge detection alone. Therefore, the present embodiment retains as much edge information as possible by lowering the edge detection threshold, so that the circumferential edge is retained as much as possible. And removing the particle edges by searching for small outlines of the remaining particle edges, so as to obtain a clear edge image of the particle filter stick circumference.
And S4, performing abnormal rejection according to the identified filter stick.
In this step, the step of removing the filter stick abnormally comprises:
s4.1, obtaining the gray level of a neighborhood pixel of the circle center of the filter stick, then calculating an average value, and removing a gray level abnormal circle according to a Lauda criterion;
and S4.2, removing the filter stick objects beyond the edge range of the filter stick area according to the filter stick area edge obtained in the step S2.
In this embodiment, considering that the overall technical solution is to perform filter rod recognition by circle recognition, the hole position in the filter rod region may also be erroneously recognized in the actual recognition process, as shown in fig. 8, which is a schematic diagram of the hole position erroneously recognized in the filter rod region image. Since the color difference between the holes and the normal filter sticks is obvious and can be distinguished through the gray scale, the gray scale abnormal circle is eliminated by taking the average value of the gray scale of the neighborhood pixels of the circle center and using the Lauda criterion.
Furthermore, in the process of cutting the rectangular frame, a part of the frame of the filter stick container is cut, which may cause a "pseudo-circle" noise formed by a part of the container and the edge of the filter stick, so that the filter stick object beyond the edge of the filter stick area is removed based on the selected area of the filter stick area profile in the embodiment.
And S5, calculating the number of the circle centers and/or the filter stick outlines in the filter stick area images through image detection to obtain the cigarette filter stick counting result.
In another embodiment, the method further comprises the following steps: and carrying out manual marking of error identification and missing identification on the marked filter stick. Further, in the embodiment, it is considered that the user needs to acquire an accurate number of filter rods from the viewpoint of metering, and therefore the filter rods need to be manually marked for false recognition (false positive) and false negative recognition (false negative).
In the embodiment, the filter stick area is firstly identified and intercepted, noise interference outside the filter stick area in the image is removed, the edge, the circle and the radius of the filter stick in the filter stick area are identified through an edge detection method and a circle detection method based on machine vision, then the abnormal identification result is further removed, and finally counting is carried out based on the identified and abnormally removed image, so that a large amount of manual correction is not needed, and the accurate cigarette filter stick identification image and the accurate filter stick counting result can be obtained.
Example 2
In this embodiment, the method for identifying a cigarette filter stick based on machine vision and the method for detecting the number of filter sticks based on canny operator, which are provided in embodiment 1, are adopted to respectively identify a cigarette filter stick from a common filter stick, a granular filter stick and a fine filter stick which are commonly found in the market.
The section of the common filter stick is pure, the diameter of the common filter stick is about 7.66mm, and the number of the filter sticks per screen is about 4300-5000. The section of the filter stick of the particle filter stick contains particles, the diameter is about 7.66mm, and the number of the particles per screen is about 4500-5000. The section of the filter stick of the fine filter stick is pure color, the diameter of the filter stick is about 5.35mm, and the number of the filter sticks per screen is about 9150-9350.
Firstly, for a common filter stick, the machine vision-based cigarette filter stick identification method provided by the embodiment and the currently common Canny operator-based filter stick quantity detection method are adopted to perform cigarette filter stick identification (Caoweilin, Li Jie, Sun Shunqi, etc.. Canny operator-based filter stick quantity detection method [ J ] tobacco technology, 2020,53(1):7.), and the accuracy, the precision, the recall rate and the F1 score are calculated as evaluation criteria, and specific detection data are shown in the following table 1.
Table 1 detection data of filter stick quantity detection method based on canny operator
Figure BDA0003375803530000061
Figure BDA0003375803530000071
Figure BDA0003375803530000081
TABLE 2 test data using the present invention
Figure BDA0003375803530000082
Figure BDA0003375803530000091
Figure BDA0003375803530000101
As can be seen from the above table, the number of the manual marks required in the average case is reduced from 40 (4.9+37.4 ═ 42.3) per container to 3 (0.6+1.7) per container. In the worst case, the number of needed manual marks is reduced from 86 (15+71 ═ 86) to less than 9 (3+6) per container.
Further comparing the average performance and the worst performance of the detection data of the cigarette filter rod identification by using the cigarette filter rod identification method based on machine vision and the currently common filter rod quantity detection method based on canny operator, and obtaining the comparison results shown in the following tables 3 and 4.
Table 3 average performance comparison results
Figure BDA0003375803530000102
Figure BDA0003375803530000111
TABLE 4 worst-performing comparative results
Figure BDA0003375803530000112
As can be seen from the above table, in the embodiment, the accuracy and recall rate of the filter stick recognition of the common filter stick image under the conditions of average performance and worst performance are both obviously improved, the number of the required manual marks is obviously reduced, and the use conditions of the actual scene are completely met.
Further, for the particle filter rod, the detection data of the cigarette filter rod identification by using the cigarette filter rod identification method based on machine vision provided by the invention is shown in the following table 5.
TABLE 5 identification and testing data for granular filter rods using the present invention
Figure BDA0003375803530000113
Figure BDA0003375803530000121
Figure BDA0003375803530000131
As can be seen from the above table, the number of the manual marks required is 8.1 (2.7+5.4) per container in the average case, and 31 in the worst case (11+20 — 31). Therefore, the accuracy rate of the filter stick identification of the particle filter stick image is 99.83 percent under the average expression condition, the recall rate is 99.78 percent, the number of the needed manual marks is 8.1 on average, and the method and the device basically have the use conditions of actual scenes.
The detection data of the cigarette filter rod recognition of the thin filter rod by the cigarette filter rod recognition method based on the machine vision provided by the invention is shown in the following table 6.
TABLE 6 identification and detection data of ramuscule filter rods using the present invention
Figure BDA0003375803530000132
Figure BDA0003375803530000141
As can be seen from the above table, the number of the manual marks required is 8.4 (2.2+6.2) per container in the average case, and 15 (5+10) in the worst case. Therefore, the accuracy rate of the filter stick identification of the particle filter stick image is 99.91 percent under the average expression condition, the recall rate is 99.93 percent, the number of the needed manual marks is 8.4 on average, and the method completely meets the use conditions of the actual scene.
Example 3
The embodiment provides a cigarette filter stick recognition system based on machine vision, and the cigarette filter stick recognition method based on machine vision provided in embodiment 1 is applied. Fig. 9 is a schematic diagram of the cigarette filter rod recognition system based on machine vision according to the present embodiment.
In the cigarette filter rod recognition system based on machine vision provided by this embodiment, the system includes:
the image acquisition module 1 is used for acquiring a vertical section image of the cigarette filter stick;
the preprocessing module 2 is used for preprocessing the acquired image;
the filter stick region extraction module 3 is used for intercepting a filter stick region image in the image;
the filter stick identification module 5 is used for identifying the filter stick, acquiring the edge, the circle center and the radius of the filter stick through edge detection and circle detection, and marking the edge and the circle center of the filter stick in the filter stick area image;
the abnormal removing module 6 is used for performing abnormal removing according to the identified filter stick;
and the filter stick counting module 7 is used for calculating the number of the circle centers and/or the filter stick profiles in the filter stick area images through image detection and outputting cigarette filter stick counting results.
In the specific implementation process, firstly, the cigarette filter stick to be detected is placed in a container, and the image acquisition module 1 is adopted to acquire the image of the vertical section of the cigarette filter stick placed in the container.
The image acquisition module 1 transmits the acquired image back to the preprocessing module 2, and the preprocessing module 2 preprocesses the received image. Specifically, the preprocessing module 2 grays the image to obtain a grayscale map, and performs brightness equalization processing on the image.
The preprocessing module 2 transmits the preprocessed image to the filter stick region extraction module 3, the filter stick region extraction module 3 obtains the filter stick region edge in the gray scale image through a canny edge detection method, then connects the filter stick region edges through expansion processing, finally carries out contour searching through a contour tracking algorithm, takes the maximum contour in the image as the filter stick region contour, and intercepts according to the circumscribed rectangle of the filter stick region contour to obtain the filter stick region image.
The filter stick region extraction module 3 transmits the intercepted filter stick region image to the filter stick recognition module 5, the filter stick recognition module 5 obtains the edge of each filter stick in the filter stick region image by a canny edge detection method and adjusting the edge detection threshold of the canny edge detection method, then removes the particle edge of the filter stick edge representation by searching a small outline to obtain the filter stick edge representation with clear circumference, detects the edge, the circle center and the radius of the filter stick according to the preset radius range parameters by a Hough circle detection method, and marks the edge and the circle center of the filter stick to finish the filter stick recognition.
The filter stick recognition module 5 transmits the recognized filter stick edge and circular image marked with the filter stick to the abnormal removal module 6, the abnormal removal module 6 calculates the average value after taking the gray level of pixels in the neighborhood of the center of the filter stick, removes gray level abnormal circles according to the Lauda criterion, removes filter stick objects exceeding the edge range of the filter stick area according to the edge of the filter stick area, and obtains the filter stick recognition image with abnormal removal.
And the abnormal elimination transmits the filter stick identification image subjected to the abnormal elimination to the filter stick counting module 7, the filter stick counting module 7 calculates the number of the circle centers and/or the filter stick profiles in the filter stick area image through image detection, and outputs the cigarette filter stick counting result.
In another embodiment, the system further comprises a human-computer interaction module, wherein the human-computer interaction module is used for displaying the filter stick identification result picture, manually correcting the false identification and the missing identification, and finally outputting the accurate filter stick identification image marked with the edge and the center of the filter stick and the cigarette filter stick counting result.
The same or similar reference numerals correspond to the same or similar parts;
the terms describing positional relationships in the drawings are for illustrative purposes only and are not to be construed as limiting the patent;
it should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.

Claims (10)

1. A cigarette filter stick identification method based on machine vision is characterized by comprising the following steps:
s1, collecting vertical section images of the cigarette filter stick;
s2, preprocessing the acquired image and intercepting a filter stick area in the image;
s3, identifying the filter stick based on the intercepted filter stick area, obtaining the edge, the circle center and the radius of the filter stick through edge detection and circle detection, and marking the edge and the circle center of the filter stick in the filter stick area image;
s4, performing abnormal rejection according to the identified filter stick;
and S5, calculating the number of the circle centers and/or the filter stick outlines in the filter stick area images through image detection to obtain the cigarette filter stick counting result.
2. The machine-vision-based cigarette filter rod recognition method according to claim 1, wherein the step of preprocessing the captured image and intercepting the filter rod region in the image in the step of S2 includes:
s2.1, graying the image to obtain a grayscale image;
s2.2, obtaining the edge of the filter stick area in the gray scale image by a canny edge detection method;
s2.3, connecting the edges of the filter stick areas through expansion treatment;
s2.4, searching the contour through a contour tracking algorithm, taking the maximum contour in the image as the contour of the filter stick region, and intercepting according to the external rectangle of the contour of the filter stick region to obtain the image of the filter stick region.
3. The machine vision-based cigarette filter rod recognition method according to claim 2, further comprising the steps of:
s2.5, obtaining the center coordinates and the circle radius through the primary circle detection of the filter stick edge obtained through canny edge detection, and judging whether the filter stick type is a slim filter stick according to the radius of the main circle.
4. A machine vision based cigarette filter rod recognition method according to claim 3, further comprising the steps of:
s2.5, when the filter stick type is a non-fine filter stick, executing the step S3; when the filter type is a fine filter, the brightness of the image is equalized, and then step S3 is executed.
5. The machine-vision-based cigarette filter rod recognition method according to any one of claims 1 to 4, wherein the step of recognizing the filter rod in the step S3 includes:
s3.1, adjusting an edge detection threshold value of a canny edge detection method through the canny edge detection method to obtain the edge of each filter stick in the filter stick area image; wherein, in the edge detection threshold, the high threshold is set to be 1.5-3 times of the low threshold;
s3.2, removing the particle edges of the filter stick edge representation by searching a small outline to obtain the filter stick edge representation with clear circumference;
and S3.3, detecting the edge, the circle center and the radius of the filter stick according to the preset radius range parameters by using a Hough circle detection method, and labeling the edge and the circle center of the filter stick.
6. A machine vision-based cigarette filter rod recognition method according to claim 5, wherein in the step S3.3, the radius range parameter includes an inter-circle minimum distance, and the inter-circle minimum distance is set to be twice the minimum radius.
7. The machine-vision-based cigarette filter rod recognition method according to claim 1, wherein the step of performing abnormal elimination on the filter rod in the step S4 includes:
s4.1, obtaining the gray level of a neighborhood pixel of the circle center of the filter stick, then calculating an average value, and removing a gray level abnormal circle according to a Lauda criterion;
and S4.2, removing the filter stick objects beyond the edge range of the filter stick area according to the filter stick area edge obtained in the step S2.
8. The machine-vision-based cigarette filter rod recognition method according to claim 7, wherein the step of S4 further comprises the steps of: and carrying out manual marking of error identification and missing identification on the marked filter stick.
9. A cigarette filter stick recognition system based on machine vision, which is applied to the cigarette filter stick recognition method based on machine vision according to any one of claims 1 to 8, and is characterized by comprising the following steps:
the image acquisition module is used for acquiring a vertical section image of the cigarette filter stick;
the preprocessing module is used for preprocessing the acquired image;
the filter stick region extraction module is used for intercepting a filter stick region image in the image;
the filter stick identification module is used for identifying the filter stick, acquiring the edge, the circle center and the radius of the filter stick through edge detection and circle detection, and labeling the edge and the circle center of the filter stick in the filter stick area image;
the abnormal removing module is used for performing abnormal removing according to the identified filter stick;
and the filter stick counting module is used for calculating the number of the circle centers and/or the filter stick profiles in the filter stick area images through image detection and outputting cigarette filter stick counting results.
10. The machine-vision-based cigarette filter stick recognition system of claim 9, further comprising a human-computer interaction module for displaying images marked with the edges and centers of the filter sticks, cigarette filter stick counting results, and for manually marking false and missing recognition labels.
CN202111417889.XA 2021-11-25 2021-11-25 Cigarette filter stick identification method and system based on machine vision Pending CN114140417A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111417889.XA CN114140417A (en) 2021-11-25 2021-11-25 Cigarette filter stick identification method and system based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111417889.XA CN114140417A (en) 2021-11-25 2021-11-25 Cigarette filter stick identification method and system based on machine vision

Publications (1)

Publication Number Publication Date
CN114140417A true CN114140417A (en) 2022-03-04

Family

ID=80387790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111417889.XA Pending CN114140417A (en) 2021-11-25 2021-11-25 Cigarette filter stick identification method and system based on machine vision

Country Status (1)

Country Link
CN (1) CN114140417A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114594102A (en) * 2022-03-29 2022-06-07 吉安易巴克电子科技有限公司 Machine vision-based data line interface automatic detection method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114594102A (en) * 2022-03-29 2022-06-07 吉安易巴克电子科技有限公司 Machine vision-based data line interface automatic detection method

Similar Documents

Publication Publication Date Title
CN109785316B (en) Method for detecting apparent defects of chip
CN110163853B (en) Edge defect detection method
CN101995223B (en) Chip appearance detection method and system
CN110047063B (en) Material drop detection method, device, equipment and storage medium
CN109741314A (en) A kind of visible detection method and system of part
CN105139391B (en) A kind of haze weather traffic image edge detection method
CN110310275B (en) Chain conveyor belt defect detection method based on image processing
CN106483129B (en) A method of the leukorrhea trichomonad based on motion estimate detects automatically
WO2021000948A1 (en) Counterweight weight detection method and system, and acquisition method and system, and crane
CN110348461A (en) A kind of Surface Flaw feature extracting method
CN108268841A (en) A kind of rolled steel plate thermal jet character string identification and verification system and method
CN111476804A (en) Method, device and equipment for efficiently segmenting carrier roller image and storage medium
CN111242888A (en) Image processing method and system based on machine vision
CN112669295A (en) Lithium battery pole piece defect detection method based on secondary threshold segmentation theory
CN110648330A (en) Defect detection method for camera glass
CN113706566A (en) Perfuming spray performance detection method based on edge detection
CN114140417A (en) Cigarette filter stick identification method and system based on machine vision
CN111768455A (en) Image-based wood region and dominant color extraction method
CN108537815B (en) Video image foreground segmentation method and device
CN114581658A (en) Target detection method and device based on computer vision
CN111563869B (en) Stain test method for quality inspection of camera module
CN109886912A (en) A kind of thrust bearing retainer detection method of surface flaw
CN113762276A (en) Method for detecting angle of ladder in electric power operation
KR20040026905A (en) Evaluation apparatus and method of image quality for realtime iris recognition, and storage media having program thereof
CN107967479B (en) Character recognition method and system with stained bill

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination