Advances in Manufacturing  2017, Vol. 5 Issue (2): 177-181

The article information

Cao Jun-Li,Li Ju-Feng,Lu Teng-Da
Roundness measurement of cigarette based on visual information
Advances in Manufacturing, 2017, 5(2): 177-181.
http://dx.doi.org/10.1007/s40436-017-0176-7

Article history

Received: 19 May, 2016
Accepted: 24 April, 2017
Published online: 22 May, 2017
Roundness measurement of cigarette based on visual information
Cao Jun-Li1, Li Ju-Feng1, Lu Teng-Da1     
Received: 19 May, 2016/ Accepted: 24 April, 2017/ Published online: 22 May, 2017
Author: Jun-Li Cao, cao14721565@i.shu.edu.cn
1 School of Mechatronic and Automation Engineering, Shanghai University, Shanghai 200072, People's Republic of China
Abstract: Roundness is defined as the degree that the cross section of an object is close to a theoretical circle. In the cigarette production process, the quality and production efficiency of a cigarette are directly affected by the roundness of the un-cut cigarette. To improve the current measurement method using a charge-coupled device (CCD) sensor and measure the roundness of cigarettes in the production line, a visual detection system composed of an industrial camera and a structural light is developed. The system's roundness-calculation method is closer to the real environment of the cigarette roundness. In this visual system, the line-structure light shines on the cigarette with a fixed angle and height in a longitudinal section, forming a crescent-shaped spot when the industrial camera cannot capture the cigarette's end surface. Then, the spot is analyzed using image-processing techniques, such as a median filter and ellipse fitting, after the industrial camera captures the spot. The system with a non-contact measurement style can meet the requirements of on-line cigarette detection with stable results and high precision.
Key words: Roundness measurement     Ellipse fitting     Image processing     Visual detection system    
1 Introduction

In China, the tobacco industry has always played a very important role as a main source of government tax revenue. Due to our large population and many smokers, the tobacco industry has held eight world records. However, as a large cigarette-manufacturing country, there is a little weak in cigarette detection in China. Most tobacco companies in China still prefer to introduce foreign equipment and improve domestic equipment at the same time [1].

The technological process of cigarette manufacturing in most cigarette factories in China is divided into two parts including the roll-up system and connection. The roll-up system is composed of adding tobacco, delivering the cigarette paper, rolling it up, and cutting the cigarette. In the rolling-up process, the roundness of the cigarette may be changed because of pressure from the roll-up system. In this situation, it is necessary to detect the roundness of the cigarette to ensure production quality. Because of the high speed of the rolling-up process, it is difficult to obtain real-time cigarette parameters, such as roundness. Most tobacco companies choose a detection system with a charge-coupled device (CCD) sensor to solve this problem [2, 3]. Figure 1 shows the working principle of this system.

Fig. 1 Working principle of the CCD system

In this system, the longest length in two vertical directions can be tested by calculating the shadow length on the CCD sensors. One edge of the cigarette paper is coated with glue when it is rolled up to form a cylinder. Then, the cigarette needs a high-temperature ironing and soft pressure by the mechanical head. Because of the pressure, the cross section of a cigarette on the production line is not a standard circle, but a curve that approximates a circle, as shown in Fig. 2, and there are two different diameter values called D and d.

Fig. 2 Roundness measurement system based on CCD sensor

In the CCD-sensor-based measurement system, the prerequisite for calculating the roundness is the curve shown in Fig. 2b, consisting of a semi-circle and a semiellipse. Thus, the roundness P is determined as

(1)

However, the real curve of a cigarette's cross section is not the same as the curve above. There could be a big difference between those two curves to a certain extent. That is to say that the roundness measurement calculated by the system based on CCD sensors is not accurate.

Therefore, this study mainly improves the cigaretteroundness measurement system based on CCD sensors used in the Changde Cigarette Factory, Hunan Province, and introduces a new measurement system based on visual information.

2 Cigarette-roundness measurement based on visual information

Image-processing technology has a very wide range of applications in modern industry [4]. In the visual system introduced in this paper, the line-structure light shines on the cigarette in the longitudinal section, forming a crescentshaped spot. Then, the industrial camera captures the spot and analyzes it using image-processing techniques. Compared with the above CCD-sensor measurement system, the visual system involves calculating more points, and its computing environment is closer to the real environment of the data [5, 6]. During the shooting, because of the highspeed movement of the cigarette and external shocks, inevitable errors occur when fitting points. In this situation, if only the OpenCV cvFitEllipse2 library function is used for ellipse fitting, the number of the error points is large and the fitting result cannot meet the detection requirements [7]. Therefore, a grayscale conversion, image smoothing, and wave filtering are required before the ellipse fitting [8]. Figure 3 shows the roundness measurement of the cigarette, based on visual information.

In Fig. 3, the fixed angle of the line-structure light is 50°. The image processing process is shown in Fig. 4.

Fig. 3 Roundness measurement system based on visual information
Fig. 4 Image pre-processing process
3 Roundness calculation in the visual system

The software platform for this improved system is Microsoft Visual Studio 2013 with OpenCV 2.4.8. cvFitEllipse2 (const cvArr* points) which can provide ellipse-fitting functionality and the fitting procedure is the least squares method. For more information on the least squares method, it could be consulted in Refs. [912] and it will not be discussed in detail in this paper.

In Fig. 4, we can see two contour curves after the image pre-processing. If the two curves directly fit, there will be two ellipses with nearly the same minor axis and a different major axis. To obtain more accurate fitting results, it is necessary to extract the center curve of the two contour curves before ellipse fitting [13].

The OpenCV cvFindContours library function can retrieve all the image contours and go through all the points on the contours. The point coordinates on the two contour curves in the pixel coordinate system can be obtained by cvFindContours. We assume that the coordinates are M1(x1, y1) and M2 (x2, y1). Then, the coordinate of the point between M1 and M2 on the center curve is M0(x0, y1), where

(2)

Then, we fit the ellipse based on the points set Mi (i = 0, 1, 2, ..., N), and the fitting result is shown in Fig. 5.

Fig. 5 Ellipse fitting based on different contour curves

The center curve is extracted in two-dimensional (2D) mode, which is a simplified three-dimensional (3D) mode. The error will be compensated in the following data processing [6].

Minor axis b and major axis a of the fitting ellipse can be obtained using the cvFitEllipse2 function. During the image-processing, a and b must have a fixed error because of the coordinate-system transformation from 3D to 2D. After several tests on standard cigarettes using the ellipsefitting method, the error compensation coefficient k can be obtained. Then, the minor axis of the ellipse is kb and the major axis is ka.

The roundness calculation method is shown in Fig. 6.

Fig. 6 Roundness calculation method

The roundness P is determined according to the following roundness formula

(3)
(4)

The cigarette is qualified if the mean value of P in a test period is within the permitted scope, and vice versa.

4 Application of the cigarette-roundness measurement based on visual information

This project is in cooperation with the Changde Cigarette Factory, Hunan Province, aiming at testing the roundness of the Furongwang series. The blue Furongwang series is taken as an example. The cigarette's diameter is 8 mm, its length 84 mm, and its roundness 0.2 mm. The device parameters are as follows: the industrial camera model is WY3500; the camera pixels are 2 952 9 1 944; the camera exposure is 10 times per second; and the line velocity is 7.8 m/s. In the detection process, the camera focus is fixed. Assuming that there is no distortion of the image captured by the camera, there is a fixed proportional relation between the pixel size and the actual size of the cigarette [8]. The ratio K could be calculated as

(5)

After several tests, K = 23.10.

The experimental prototype of this visual detection system is shown in Fig. 7.

Fig. 7 Experimental prototype for visual system

Table 1 contains 6 000 sets of roundness data tested over 10 min. For statistical convenience, we classify the average value for each 400 data sets as one new data set. Table 1 shows the 15 sets of data.

Table 1 Roundness measurements based on the visual system (unit: mm, k = 1.92)

We compare the above roundness with the results from the CCD sensor system. Figure 8 shows the experimental equipment for the CCD sensor.

Fig. 8 Experimental equipment for the CCD sensor system

In the CCD system, the level signal is converted to a pulse signal; the pulse width is the longest length and is called D and d. Table 2 shows the roundness of the same cigarette measured over 10 min. It contains 3 600 sets of roundness data tested over 10 min. We classify the average value for each 240 data sets as one new data set. Following are the 15 sets of data.

Table 2 Roundness measurement based on the CCD sensor system (unit: mm)

If we analyze these data, there are five bold data values from the allowable roundness values in Table 1, and three bold data values from the allowable roundness values in Table 2, which indicate that the roundness of the cigarette does not qualify in the tested period. This means that the factory should check the production state and find the reason.

The cigarette was the same for both systems. However, we can see that the roundness in Table 1 is more accurate than that in Table 2.

After several on-site commissions, the system can effectively detect the roundness of the cigarette. However, the visual information is especially sensitive to optical noise and external shock, so the system places high demands on the external environment. The actual test result shows that the accuracy of the visual-system-based cigarette-roundness measurement is 19% better than the former measurement method, such as double-CCD sensor detecting, when the ambient light noise and external shock are small and stable.

5 Conclusions

Ellipse-fitting algorithms are widely used in image processing, and are also the most important functions in image-processing technology. The proposed visual system in an industrial setting can determine whether the product's shape, size, location, quality, and category are qualified. The visual system has the advantages of non-contact, full field measurement, and high precision, which are ideal for detecting objects in a production line.

In view of the above characteristics, this article introduced a new cigarette-roundness measurement based on visual information. The actual test results showed that the accuracy of this system was 19% better than the former measurement method with double-CCD sensor detection. This new system was also a direction for our country's own cigarette-testing equipment.

Acknowledgements This project was supported by the Changde Cigarette Factory, Hunan Province. The authors express their sincere appreciation to the anonymous referees for their helpful comments to improve the quality of the paper.
References
1. Wang JN (2011) Research on reform and development of tobacco industry in China. Dissertation, University of Jilin
2. Fen H, Li JF, Zhao JQ (2015) The measurement system of the cigarette surface quality. Dissertation, Shanghai University
3. Han JD, Yang HJ, Lu NG(2011)Automated ellipse detection and location method on 3D visual inspection.Comput Eng Appl 47(17), 169-171
4. Zhang YJ (1999) Image processing and analysis. Tsinghua University Press, Beijing
5. Yan B, Wang B, Li Y(2008)Optimal ellipse fitting method based on least square. J Beijing Univ Aeronaut Astronaut 34(3), 295-298
6. Zhang WG, Han J, Zhou X(2013)Data registration method for multi resolution measurement system with line structured light.Chin J Sci Instrum 7, 2-8
7. Bradski GR, Kaehler A (2008) Learning OpenCV: computer vision with the OpenCV library. O'Reilly Media, California
8. Li L, He MY, Li N(2010)Camera calibration based on the circular pattern and ellipse fitting.J Xidian Univ 6, 1148-1154
9. Zou YM, Wang B(2006)Fragmental ellipse fitting based on least square algorithm.Chin J Sci Instrum 27(7), 808-812
10. Kanatani K, Sugaya Y, Kanazawa Y (2016) Ellipse fitting for computer vision: implementation and applications. Morgan & Claypool, Williston
11. Fitzgibbon A, Pilu M, Fisher RB(1999)Direct least square fitting of ellipses.IEEE Trans Pattern Anal Mach Intell 21(5), 476-480 doi:10.1109/34.765658
12. Xia J (2007) Research on ellipse fitting method. Dissertation, Jinan University
13. Xu JZ (2012) Research on methods and evaluation of stripe center extraction in structured light 3D measurement. Dissertation, Nanjing University