Online detection and analysis method for perimeter of cigarette
Through the real -time collection and analysis of the image of the cigarette paper in real time, the cigarette branch is calculated to calculate the cigarette branch period, which solves the problem that existing technology cannot track the changes in cigarettes in real time, and achieves high -efficiency and accurate cigarettes perimeter testing.
Patent Information
- Application Number
- CN202310883374.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-18
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art cannot track the changes in the circumference of the cigarette support in real time, resulting in defects in the quality of cigarette products, and traditional photoelectric detection methods are prone to misjudgment of data due to deformation of the cigarette strips.
Using an online detection and analysis method based on machine vision, the camera collects real-time images of the overlap of the cigarette paper, obtains the upper and lower edge line segments of the overlap, calculates the overlap width, and thereby determines the circumference of the cigarette.
The real -time online testing of the cigarette branches is realized, the detection error caused by the deformation and beating of the smoke branches can be eliminated. It can quickly collect the diameter of the cigarette branch, suitable for online high -speed production, and has good robustness.
Smart Images

Figure CN119338887A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of digital image processing, and in particular to an online detection and analysis method for the circumference of a cigarette. Background Art
[0002] The circumference of cigarettes is an important indicator in the cigarette production process. At present, the detection method for the circumference of cigarettes is: offline detection, the operator conducts random inspections on cigarettes, and measures the circumference of cigarettes through instruments such as comprehensive testers or cigarette measuring trays. The offline detection method cannot detect the fluctuation of the circumference of cigarettes in time, and the quality cannot be tracked in real time, which is easy to cause quality defects of cigarette products, and seriously restricts the improvement of physical indicators of cigarettes. Another detection method is: after the cigarettes are rolled and formed, the width of the cross-section of the cigarette is judged by the photoelectric detection switch. Because the cigarette rod may be squeezed by the soldering iron body during the actual production movement, the circumference length does not change, but its cross-section becomes an ellipse within the range permitted by the process standard. If only the ellipse in one direction is measured, it is very easy to cause data misjudgment, so the measurement result of this method is inaccurate. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and provide an online detection and analysis method for the circumference of a cigarette based on image acquisition and image analysis. The method uses machine vision technology to capture the image of the overlap of cigarette paper in real time, obtains the overlap width of each cigarette according to a new method, and then obtains the circumference of the cigarette from the cigarette paper width and the overlap width.
[0004] The online detection and analysis method for cigarette circumference provided by the present invention has the following technical solutions:
[0005] An online detection and analysis method for cigarette circumference comprises the following steps:
[0006] (1) Image preprocessing: After collecting the image of the overlapped part of the cigarette paper in real time through the camera, the pixel grayscale value is adjusted;
[0007] (2) Obtain the equation of the upper edge segment, set multiple rectangular detection frames of the same height and width on the upper edge of the overlap, and obtain the coordinate set (X t [n],Y t [n]), the point coordinate set is fitted with a straight line through Hough transform to obtain the equation of the upper edge segment A t x+B t y+C t =0, A t , B t , C t are fitting coefficients, x and y are point coordinate set variables;
[0008] (3) Obtain the equation of the lower edge segment, set multiple rectangular detection frames of the same height and width at the lower edge of the overlap, and obtain the coordinate set (X b [n],Y b [n]), the point coordinate set is fitted with a straight line through Hough transform to obtain the equation of the lower edge segment A b x+B b y+C b =0, A b , B b , C b are fitting coefficients, x and y are point coordinate set variables;
[0009] (4) Find the center point of the line segment (x) based on the upper edge line segment mid ,y mid ), and then calculate the vertical distance between the center point and the lower edge segment according to the following formula,
[0010]
[0011] The vertical distance is the overlap width in pixels W pix ;
[0012] (5) According to the formula W = W pix *ratio calculates the actual physical width of the interface, where ratio is the ratio coefficient between physical coordinates and pixel coordinates;
[0013] (6) Calculate the circumference of the cigarette = cigarette paper width - physical width of the overlap. The width of the cigarette paper for each brand of cigarette is a known fixed value.
[0014] Furthermore, the camera that captures the image is illuminated by low-angle strip light.
[0015] Furthermore, an air blowing channel is provided at the lens or the window glass of the camera.
[0016] Furthermore, in step (1), the pixel grayscale range of the image grayscale value [80, 150] is transformed to [0, 255].
[0017] The implementation of the present invention includes the following technical effects:
[0018] The present invention discloses an online detection and analysis method for the circumference of a cigarette, which uses a low-angle strip light for lighting and uses a camera to collect images of the overlap area of the cigarette paper in real time. First, the overlap contrast is enhanced by image grayscale transformation, and then the upper and lower edge line segments of the overlap are obtained. The center point of the line segment is obtained through the upper edge line segment, and then the vertical distance from the center point to the lower edge line is calculated to obtain the overlap width of the cigarette paper. The detection errors caused by cigarette deformation, jumping, etc. can be effectively eliminated, and the cigarette diameter can be quickly collected online to meet the needs of online high-speed production. The method proposed by the present invention has good robustness to the situation where the cigarette is tilted and jittered when the image is captured, and can detect the overlap width more stably than the morphological processing method. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Schematic diagram of the process flow of the online detection and analysis method for the circumference of a cigarette according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The present invention will be described in detail below in conjunction with embodiments and drawings. It should be pointed out that the described embodiments are only intended to facilitate the understanding of the present invention and do not have any limiting effect on the present invention.
[0021] See also Figure 1 As shown, this embodiment provides an online detection and analysis method for cigarette circumference, comprising the following steps:
[0022] (1) Image preprocessing: After the camera captures the image of the overlapped part of the cigarette paper in real time, the pixel grayscale range of the image grayscale value [80, 150] is converted to [0, 255];
[0023] (2) Obtain the equation of the upper edge segment, set multiple rectangular detection frames of the same height and width on the upper edge of the overlap, and obtain the coordinate set (X t [n],Y t [n]), the point coordinate set is fitted with a straight line through Hough transform to obtain the equation of the upper edge segment A t x+B t y+C t =0, A t , B t , C t are fitting coefficients, x and y are point coordinate set variables;
[0024] (3) Obtain the equation of the lower edge segment, set multiple rectangular detection frames of the same height and width at the lower edge of the overlap, and obtain the point coordinate set (X b [n],Y b[n]), the point coordinate set is fitted with a straight line through Hough transform to obtain the equation of the lower edge segment A b x+B b y+C b =0, A b , B b , C b are fitting coefficients, x and y are point coordinate set variables;
[0025] (4) Find the center point of the line segment (x) based on the upper edge line segment mid ,y mid ), and then calculate the vertical distance between the center point and the lower edge segment according to the following formula,
[0026]
[0027] The vertical distance is the overlap width in pixels W pix ;
[0028] (7) According to the formula W = W pix *ratio calculates the actual physical width of the interface, where ratio is the ratio coefficient between physical coordinates and pixel coordinates;
[0029] (8) Calculate the circumference of the cigarette = cigarette paper width - physical width of the overlap. The width of the cigarette paper for each brand of cigarette is a known fixed value.
[0030] Since the cigarette rod needs to be glued during the forming process, and the buckle part has double-layer cigarette paper, the method of the present invention can clearly see the image difference between the overlap part and other parts. By using image recognition technology, the edge pattern of the overlap can be obtained, and the width of the overlap can be analyzed. According to this width, it can be known how much the cigarette paper overlaps during the forming of the cigarette rod, and then the circumference of the cigarette rod can be calculated according to the width of the cigarette paper.
[0031] Specifically, the camera that takes the image uses low-angle strip light for lighting, which can meet the amount of light entering while avoiding glare and achieving uniform brightness. An air blowing channel is set at the lens or window glass of the camera to achieve a dust removal function, which can blow away impurities adhering to the window plate or lens to avoid false detection.
[0032] The present invention discloses an online detection and analysis method for the circumference of a cigarette, which uses a low-angle strip light for lighting and uses a camera to collect images of the overlap area of the cigarette paper in real time. First, the overlap contrast is enhanced by image grayscale transformation, and then the upper and lower edge line segments of the overlap are obtained. The center point of the line segment is obtained through the upper edge line segment, and then the vertical distance from the center point to the lower edge line is calculated to obtain the overlap width of the cigarette paper. The detection errors caused by cigarette deformation and vibration can be effectively eliminated, and the cigarette diameter can be quickly collected online to meet the needs of online high-speed production. The method has good robustness to the situation where the cigarette is tilted and jittered when the image is captured, and can detect the overlap width more stably than the morphological processing method.
[0033] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention, rather than to limit the scope of protection of the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the essence and scope of the technical solution of the present invention.
Claims
1. A method for online detection and analysis of cigarette circumference, characterized in that: The following steps are involved: (1) Image preprocessing: After collecting the image of the overlapped part of the cigarette paper in real time through the camera, the pixel grayscale value is adjusted; (2) Obtain the equation of the upper edge segment, set multiple rectangular detection frames of the same height and width on the upper edge of the overlap, and obtain the coordinate set (X t [n],Y t [n]), the point coordinate set is fitted with a straight line through Hough transform to obtain the equation of the upper edge segment A t x+B t y+C t =0, A t , B t , C t are fitting coefficients, x and y are point coordinate set variables; (3) Obtain the equation of the lower edge segment, set multiple rectangular detection frames of the same height and width at the lower edge of the overlap, and obtain the coordinate set (X b [n],Y b [n]), the point coordinate set is fitted with a straight line through Hough transform to obtain the equation of the lower edge segment A b x+B b y+C b =0, A b , B b , C b are fitting coefficients, x and y are point coordinate set variables; (4) Find the center point of the line segment (x) based on the upper edge line segment mid ,y mid ), and then calculate the vertical distance between the center point and the lower edge segment according to the following formula, The vertical distance is the overlap width in pixels W pix ; (5) According to the formula W = W pix *ratio calculates the actual physical width of the interface, where ratio is the ratio coefficient between physical coordinates and pixel coordinates; (6) Calculate the circumference of the cigarette = cigarette paper width - physical width of the overlap. The width of the cigarette paper for each brand of cigarette is a known fixed value.
2. The method for online detection and analysis of cigarette circumference according to claim 1, characterized in that: The camera that captured the image was lit with a low-angle strip light.
3. The method for online detection and analysis of cigarette circumference according to claim 1, characterized in that: An air blowing channel is arranged at the lens or the window glass of the camera.
4. The method for online detection and analysis of cigarette circumference according to claim 1, characterized in that: In step (1), the pixel grayscale range of the image grayscale value [80, 150] is transformed to [0, 255].