Visual identification and measurement method for cigarette segment length
By using a high-resolution CCD camera and a watershed algorithm to segment cigarette images, the problems of low efficiency and subjective factors of traditional cigarette length measurement methods are solved, and high-precision measurement and identification of cigarette segment lengths are achieved.
Patent Information
- Application Number
- CN202411377796.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
AI Technical Summary
Traditional cigarette length measurement methods require manual operation, are inefficient and susceptible to subjective factors, making it difficult to accurately measure cigarette segment length.
Make cigarettes with high -resolution surface CCD cameras and plane light sources. Through monocular visual calibration and image pre -processing, cigarette images are divided into different regions with watershed algorithms to measure the length of each segment.
It achieves accurate measurement and identification of cigarette segment lengths. It has high measurement accuracy, high efficiency and easy operation. It is suitable for quality control and detection in the cigarette production process.
Smart Images

Figure CN119359787A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of computer vision, and in particular to a method for visually identifying and measuring the length of cigarette segments. Background Art
[0002] With the rapid development of the cigarette industry, the requirements for cigarette quality in cigarette production are getting higher and higher. Traditional length measurement methods usually require manual operation, which is not only inefficient but also easily affected by subjective factors. The length of cigarette segments is one of the important indicators for measuring cigarette quality. Too long or too short cigarette segment length will affect the smoking experience and smoke emissions. Therefore, it is of great significance to propose an automated, machine vision-based cigarette segment length recognition and measurement method. Invention patent content
[0003] The present invention provides a method for visually identifying and measuring the length of cigarette segments. The method comprises the following steps:
[0004] S1. Use a high-resolution area array CCD camera and a plane light source to photograph the cigarette placed on the measuring platform to obtain an image of the entire length of the cigarette;
[0005] S2, performing monocular visual calibration and image preprocessing on the preprocessed cigarette image, wherein the image preprocessing includes steps such as grayscale and brightness adjustment, image filtering and denoising, etc.;
[0006] S3, using a watershed algorithm to segment the cigarette image, and segmenting the cigarette into a cigarette core segment and a filter segment, wherein the cigarette filter segment is divided into a hollow segment, a polylactic acid segment, and a acetate segment;
[0007] S4. Measure and identify the segment lengths of the cigarette according to the segmented areas, and calculate the length ratio of the cigarette part and the filter part.
[0008] The image preprocessing step mainly adjusts the grayscale and brightness of the original cigarette image loaded into the processing program and performs image filtering and denoising, with the purpose of highlighting the area where the cigarette is located and distinguishing the background part, so as to facilitate the subsequent accurate positioning of the edge contour pixels of the cigarette.
[0009] The visual recognition and measurement method of cigarette segment length provided by the present invention adopts machine vision technology and watershed algorithm to accurately measure and recognize the segment length of cigarettes. The method has the advantages of high measurement accuracy, high efficiency, and simple operation, and can be widely used in the field of quality control and detection in the cigarette production process. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a schematic diagram of cigarette segmentation;
[0011] Figure 2It is a flow chart of cigarette segment length measurement;
[0012] Figure 3 It is the image processing flow chart;
[0013] Figure 4 It is a schematic diagram of the length watershed of cigarette images;
[0014] Figure 5 This is a diagram showing the effect of measuring the length of cigarette segments. DETAILED DESCRIPTION
[0015] The present invention is further described in detail below with reference to the embodiments and accompanying drawings:
[0016] In this embodiment, if Figure 1 As shown, the cigarette is identified and segmented, and the segments are divided into a core segment, a hollow segment, a polylactic acid segment, and a acetate fiber segment.
[0017] In this embodiment, if Figure 2 As shown, a high-resolution industrial camera is used to obtain an image of a cigarette, and then the image is subjected to grayscale transformation and filtering denoising to highlight the cigarette area. The watershed algorithm is then used to segment the cigarette image into different areas, and finally the length of each segment is measured based on the segmentation result.
[0018] In this embodiment, if Figure 3 As shown, the original image is converted into a grayscale image to simplify subsequent processing; a filter is applied to remove noise in the image; a gradient detection operator (such as the Sobel operator) is used for edge detection; the image is segmented using a watershed algorithm to extract the boundaries of each cigarette segment; and the length of the segmented area is calculated.
[0019] In this embodiment, if Figure 4 As shown, the watershed algorithm is used to regard the image as terrain and divide the image into different regions through the simulation process of water flow. The steps include: gradient calculation, region growing, and region marking.
[0020] In this implementation, a high-resolution industrial camera equipped with an optical lens and LED backlight source is used to ensure that the acquired image has high quality and clarity. The image processing software converts the image into a grayscale image, and after filtering and edge detection, the watershed algorithm is used for image segmentation. Figure 5 As shown in the figure, the effect diagram after measurement is shown. After image processing and segmentation, the pixel distance of each segment is calculated, converted into actual length and the length of each segment is marked on the figure by image superposition.
[0021] The experimental results show that the method of the present invention has high accuracy and small error in measuring the length of cigarette segments, and can meet the quality control requirements in the cigarette production process. By comparing the manual measurement results, it is found that the maximum relative error is 1.614%, which shows the accuracy and reliability of the method.
[0022] The above examples are only used to help understand the core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for visually identifying and measuring the length of a cigarette segment, comprising the following steps: S1. Obtain images of cigarette samples using a high-resolution industrial camera; S2, performing grayscale transformation and filtering denoising on the acquired image to highlight the cigarette area; S3, using the watershed algorithm to segment the preprocessed image and identify different segmented areas of the cigarette; S4, measuring the pixel length of each segmented area and converting it into an actual length to obtain the length of each segment of the cigarette.
2. The method according to claim 1, wherein: The grayscale transformation includes converting a color image into a grayscale image to simplify subsequent processing steps; the filtering and denoising process includes using a Sobel operator to perform edge detection to remove noise in the image and highlight the edge contour of the cigarette.
3. The method according to claim 1, wherein: The watershed algorithm includes the following steps: calculating the gradient of each pixel in the image; starting regional growth from the pixel with the largest gradient and gradually expanding to the low-gradient region to form a segmentation line; and marking the segmented different regions.
4. The method according to claim 1, wherein: The length measurement step includes: calculating the pixel length of each segmented area; and converting the pixel length into an actual length by unit conversion.
5. The method according to claim 1, further comprising calibrating the visual sensor using a checkerboard calibration plate before collecting the cigarette image to improve the measurement accuracy.
6. The method according to claim 1, wherein: The measurement of the cigarette segments includes the length measurement of the core segment, the hollow segment, the polylactic acid segment and the acetate segment.