Tobacco shred order rate measuring method and system based on principal component analysis and storage medium
The PCA-based method for analyzing three-dimensional cigarette images accurately quantifies tobacco filler orderliness, addressing inefficiencies and inaccuracies in existing methods, thereby improving cigarette structure evaluation and performance.
Patent Information
- Application Number
- CN202510441847.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-15
AI Technical Summary
In the prior art, the measurement accuracy of the order rate of tobacco is not high and the measurement accuracy is limited. The traditional method is inefficient and difficult to achieve accurate quantization.
Using a method based on principal component analysis, the main direction of tobacco threads is calculated to obtain the order rate by pre-processing, edge detection, connection area extraction and principal component analysis on the three-dimensional reconstruction images of the tobacco thread.
It realizes high-precision quantification of the orderly arrangement rate of tobacco threads, provides a scientific basis for quality evaluation, supports the performance analysis of tobacco branch structure, and improves analysis efficiency and measurement reliability.
Smart Images

Figure CN120318188A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cigarette stick detection, and particularly relates to a method, a system and a storage medium for measuring the orderly rate of cut tobacco based on principal component analysis. Background Art
[0002] The internal structure of a cigarette stick has an important impact on its combustion performance, smoking taste and flue gas release characteristics. Among them, the arrangement mode and the degree of order of the cut tobacco are one of the important indicators for measuring the structural quality of the cigarette stick. Research shows that the orderliness of the cut tobacco (the cut tobacco is oriented in the same direction) has a certain impact on the filling density, combustion performance and heat transfer effect of the cigarette. Generally, during the production of heat-not-burn cigarettes, it is required that the orderly rate of the cut tobacco in the smoking section is greater than 80%. Therefore, accurately measuring the orderly rate of the cut tobacco in the cigarette stick and adjusting the cigarette rolling process parameters accordingly are of great significance for improving the combustion performance of the cigarette.
[0003] Traditional methods for measuring the orderly rate of cut tobacco mainly rely on manual observation or destructive testing. These methods are not only inefficient but also difficult to achieve precise quantification. With the development of computer technology and imaging technology, the method for measuring the orderly rate of cut tobacco based on CT (Computed Tomography) technology has gradually become a research hotspot. CT technology can obtain a complete picture of the internal structure of the cigarette stick through three-dimensional reconstruction without damaging the cigarette stick, providing a new solution for the precise measurement of the orderly rate of the cut tobacco.
[0004] Although significant progress has been made in the method for measuring the orderly rate of cut tobacco based on CT technology, the existing technology still faces problems such as complex data processing, low measurement accuracy and limited measurement accuracy. Summary of the Invention
[0005] One of the purposes of the embodiments of the present invention is to provide a method, a system and a storage medium for measuring the orderly rate of cut tobacco based on principal component analysis. By performing multi-step processing and analysis on the three-dimensional reconstructed image of the cigarette stick, the precise quantification of the arrangement orderliness of the cut tobacco is realized, thereby providing key data support for the quality evaluation of the cigarette stick, so as to solve the technical problems of low measurement accuracy and low measurement accuracy of the orderly rate of cut tobacco in cigarettes in the existing technology.
[0006] To achieve the above purpose, the present invention provides a method for measuring the orderly rate of cut tobacco based on principal component analysis, including:
[0007] Obtaining a three-dimensional reconstructed image of the cigarette stick;
[0008] Performing preprocessing on the three-dimensional reconstructed image;
[0009] Performing three-dimensional edge detection on the preprocessed three-dimensional reconstructed image to obtain the cut tobacco structure features;
[0010] Extracting independent connected regions based on the cut tobacco structure features;
[0011] For each independent connected region, the principal direction of the cut tobacco is determined by using the principal component analysis method to obtain the principal component vector;
[0012] Calculate the order rate according to the principal component vector.
[0013] Optionally, the preprocessing of the three-dimensional reconstruction image includes:
[0014] Performing at least one of normalization processing, threshold segmentation processing, and morphological processing on the three-dimensional reconstruction image.
[0015] Optionally, perform three-dimensional edge detection on the preprocessed three-dimensional reconstruction image to obtain the cut tobacco structure features, including:
[0016] Calculate the gradient values of edge detection in the x-axis, y-axis, and z-axis directions of the preprocessed three-dimensional reconstruction image respectively according to formulas (1) to (3):
[0017]
[0018] Among them, G x is the gradient value of edge detection in the x direction, G y is the gradient value of edge detection in the y direction, G z is the gradient value of edge detection in the z direction, * represents the convolution operation, and I is the preprocessed three-dimensional reconstruction image;
[0019] Calculate the edge strength according to formula (4):
[0020]
[0021] Among them, E is the edge strength.
[0022] Optionally, based on the cut tobacco structure features, extract independent connected regions, including:
[0023] Dilate the detected edge according to formula (5) to obtain an image with continuous edges,
[0024]
[0025] Among them, A is the input image, B is a 3×3×3 cube structure element, is the reflection of the structure element, and z is the pixel position in the image;
[0026] Based on the image with continuous edges, obtain seed points;
[0027] Starting from the seed points, use the priority search method to mark all voxels connected to the seed points as independent connected regions;
[0028] Calculate the areas of different independent connected regions and remove the independent connected regions with areas smaller than a set threshold.
[0029] Optionally, based on the image with edge continuity, obtaining seed points includes:
[0030] Traverse all voxels of the image with edge continuity using 26-neighborhood, and take the voxels with voxel value of 1 and not marked as seed points.
[0031] Optionally, for each connected region, use the principal component analysis method to determine the main direction of cut tobacco to obtain the principal component vector, including:
[0032] Obtain the coordinates of all voxels in each connected region;
[0033] Calculate the mean vector of the voxel coordinates of each connected region according to formulas (6) and (7),
[0034]
[0035] P i =(x i ,y i ,z i ), (7)
[0036] where μ is the mean vector of the voxel coordinates of the connected region, and P i represents the three-dimensional coordinate vector of the i-th voxel in the connected region, i = 1, 2,..., n, and n is the total number of voxels in the connected region;
[0037] Calculate the voxel coordinate centering matrix according to formulas (8) and (9),
[0038] X c =X - μ, (8)
[0039] X = [P1, P2, …, P n , (9)
[0040] where X c is the voxel coordinate centering matrix, and X is the voxel coordinates of the connected region;
[0041] Calculate the covariance matrix of the voxel coordinate centering matrix according to formula (10),
[0042]
[0043] where C is the covariance matrix of the voxel coordinate centering matrix;
[0044] Perform eigenvalue decomposition on the covariance matrix to obtain the principal component vector.
[0045] Optionally, performing eigen - decomposition on the covariance matrix to obtain the principal component vectors includes:
[0046] Performing eigen - decomposition on the covariance matrix according to formula (11),
[0047] Cv j = λ j v j , (j = 1, 2, 3), (11)
[0048] where λ j is the eigenvalue, and v j is the eigenvector;
[0049] Selecting the eigenvector corresponding to the maximum value of the eigenvalue as the principal component vector.
[0050] Optionally, calculating the orderliness rate according to the principal component vector includes:
[0051] Calculating the relative plane angle of the principal component vector in the xOy plane according to formula (12):
[0052] θ = arctan2(v y , v x ), (12)
[0053] where θ is the relative plane angle of the principal component vector in the xOy plane, v x is the component of the principal component vector on the x - axis, v y is the component of the principal component vector on the y - axis, and arctan2 is the two - parameter arctangent function;
[0054] Calculating the cut - tobacco orderliness rate according to formula (13) and formula (14):
[0055]
[0056] orientations = {θ1, θ2, …, θ n}, (14)
[0057] where Orderliness is the cut - tobacco orderliness rate, std(orientations) is the standard deviation of the principal component vector angles of all connected regions, orientations is the relative plane angle of the principal component vectors of all connected regions in the xy plane, and θ i is the relative plane angle of the principal component vector of the i - th connected region in the xy plane, i = 1, 2, …, n.
[0058] On the other hand, the present invention provides a cut - tobacco orderliness rate measurement system based on principal component analysis. The measurement system includes:
[0059] An image processing module for performing normalization processing, threshold segmentation processing, and morphological opening operation processing on the three-dimensional reconstructed image of the cigarette rod;
[0060] An edge detection module for calculating the edge gradient of the three-dimensional reconstructed image to obtain the edge intensity;
[0061] A connected region analysis module for extracting independent connected regions;
[0062] A principal component analysis module for applying principal component analysis to each connected region to calculate the principal direction and determine the relative plane angle;
[0063] An operation module for calculating the order rate of the cut tobacco according to the regional principal direction angle;
[0064] A processor is connected to the image processing module, the edge detection module, the connected region analysis module, the principal component analysis module, and the operation module, and the processor is configured to execute the measurement method described in any one of the above.
[0065] On the other hand, the present invention also provides a computer-readable storage medium, on which instructions are stored, and when the instructions are executed by a processor, the method described in any one of the above is implemented.
[0066] Advantages of the present invention:
[0067] The present invention utilizes high-resolution three-dimensional CT images, accurately extracts the cut tobacco region through threshold segmentation and morphological processing, combines three-dimensional edge detection and connectivity analysis, and effectively identifies and separates the cut tobacco region. By extracting the principal direction of each cut tobacco through principal component analysis (PCA) and combining the statistical analysis of the principal direction angle, a high-precision quantification of the order rate of the cut tobacco arrangement is achieved.
[0068] Based on the relative angle between the principal direction of the cut tobacco and the XOY plane, the present invention calculates the standard deviation of all cut tobacco directions and generates an order rate index through normalization processing. This method can not only quantitatively evaluate the orderliness of the cut tobacco arrangement, but also reflect the overall distribution characteristics of the cut tobacco in the cigarette rod, providing a scientific basis for structural performance analysis.
[0069] The present invention designs a modular system architecture, realizing full-process automated processing from image processing, connected region extraction to principal direction analysis and order rate calculation, reducing manual intervention, improving analysis efficiency, and being applicable to the rapid detection of a large number of cigarette rod samples. Moreover, the system supports dynamic adjustment of image segmentation thresholds and morphological operation parameters, and can adapt to different types and specifications of cigarette rod samples. In addition, the system can batch process cigarette rod samples, generate analysis reports including information such as the order rate and direction distribution of the cut tobacco, facilitating quality control and process optimization.
[0070] The present invention combines multiple algorithms (such as Sobel operator edge detection, PCA principal direction extraction, and standard deviation statistical analysis), improving the robustness of data processing and the reliability of results, and having good measurement repeatability.
[0071] The present invention provides a scientific and systematic solution for the quantitative evaluation of cut tobacco arrangement, which can be widely applied to quality control, product optimization, and process improvement in the tobacco industry, providing important technical support for improving cigarette performance and market competitiveness.
[0072] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] The drawings are used to provide a further understanding of the embodiments of the present invention, and constitute a part of the specification. Together with the following specific implementation, they are used to explain the embodiments of the present invention, but do not constitute a limitation to the embodiments of the present invention. In the drawings:
[0074] Figure 1 is a flowchart of a method for measuring the cut tobacco order rate based on principal component analysis according to an embodiment of the present invention;
[0075] Figure 2 is a flowchart of a method for extracting independent connected regions according to an embodiment of the present invention;
[0076] Figure 3 is a flowchart of a method for obtaining a principal component vector according to an embodiment of the present invention;
[0077] Figure 4 is a schematic diagram for calculating the relative plane angle of the principal component vector according to an embodiment of the present invention;
[0078] Figure 5 is a schematic diagram of the measurement result of the order rate according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0079] The following details the specific implementation of the embodiments of the present invention with reference to the drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the embodiments of the present invention, and is not used to limit the embodiments of the present invention.
[0080] It should be noted that the acquisition, transmission, storage, use, processing, etc. of data in the technical solution of this application all comply with the relevant provisions of national laws and regulations. In the embodiments of this application, certain industry-existing solutions such as software, components, models, etc. may be mentioned, and they should be considered exemplary. The purpose is only to illustrate the feasibility in the implementation of the technical solution of this application, but it does not mean that the applicant has already or necessarily used this solution.
[0081] As Figure 1 shown is a flowchart of a method for measuring the orderly rate of cut tobacco based on principal component analysis according to an embodiment of the present invention. In this Figure 1 measurement method may include the following steps:
[0082] In step S10, obtain a three-dimensional reconstructed image of the cigarette;
[0083] In step S11, preprocess the three-dimensional reconstructed image;
[0084] In step S12, perform three-dimensional edge detection on the preprocessed three-dimensional reconstructed image to obtain cut tobacco structure features;
[0085] In step S13, extract independent connected regions based on the cut tobacco structure features;
[0086] In step S14, for each independent connected region, use the principal component analysis method to determine the main direction of the cut tobacco to obtain the principal component vector;
[0087] In step S15, calculate the orderly rate according to the principal component vector.
[0088] In this as Figure 1 shown in the method for measuring the orderly rate of cut tobacco based on principal component analysis, step S10 is used to obtain a three-dimensional reconstructed image of the cigarette, and then the three-dimensional reconstructed image is preprocessed through step S11. In this embodiment, for the specific method of preprocessing in step S11, it can be various forms known to those skilled in the art. In an example of the present invention, step S11 can be to perform a normalization operation on the three-dimensional reconstructed image of the cigarette. Then apply threshold segmentation to the normalized image to eliminate background noise. Finally, apply morphological opening operation to the thresholded image to remove the tipping paper part of the cigarette. Morphological opening operation mainly includes erosion operation and dilation operation of the image.
[0089] Step S12 is used to perform three-dimensional edge detection on the preprocessed three-dimensional reconstructed image to obtain cut tobacco structure features. Specifically, in this example, the method for performing three-dimensional edge detection in step S12 may include the following steps:
[0090] In step S20, the gradient values of edge detection in the x-axis, y-axis, and z-axis directions of the preprocessed three-dimensional reconstruction image are calculated according to formulas (1) to (3) respectively:
[0091]
[0092] Among them, G x is the gradient value of edge detection in the x direction, G y is the gradient value of edge detection in the y direction, G z is the gradient value of edge detection in the z direction, * represents the convolution operation, and I is the preprocessed three-dimensional reconstruction image;
[0093] In step S21, the edge intensity is calculated according to formula (4):
[0094]
[0095] Among them, E is the edge intensity.
[0096] Step S20 is used to obtain the edge detection gradient. The Sobel operator is used to detect the edges of the image on the three coordinate axes of space, and the maximum projection of all edges is selected to extract the structural features of the cut tobacco. The Sobel operator applies the Sobel operator to the three-dimensional image of the cigarette on the x-axis, y-axis, and z-axis to obtain the gradient in each direction. Step S21 is used to calculate the edge intensity according to the gradients in the x-axis, y-axis, and z-axis directions. By fusing the gradients in three directions, the overall edge intensity is obtained, which can capture the spatial edges more comprehensively and avoid missing detection in a single direction. Step S12 can accurately extract the cut tobacco edges in the three-dimensional image of the cigarette, providing a mathematical representation for analyzing its internal structure.
[0097] Step S13 is used to extract independent connected regions. In order to cluster the discrete edge pixels into independent cut tobacco objects with physical significance and then quantify their structural and distribution characteristics, connected region analysis is required. In this embodiment, the specific steps for extracting independent connected regions can be in various forms known to those skilled in the art. In an example of the present invention, step S13 may include the steps shown in Figure 2 . In this Figure 2 , step S13 may include:
[0098] In step S30, the detected edges are dilated according to formula (5) to obtain an image with continuous edges,
[0099]
[0100] where A is the input image and B is a 3×3×3 cube structuring element, For the reflection of the structural element, z is the pixel position in the image;
[0101] In step S31, based on the edge-continuous image, seed points are obtained;
[0102] In step S32, using a priority search method starting from the seed points, all voxels connected to the seed points are marked as independent connected regions;
[0103] In step S33, the areas of different independent connected regions are calculated, and the independent connected regions with areas smaller than the set threshold are removed.
[0104] In the method as Figure 2 shown, step S30 is used to obtain the edge-continuous image. Specifically, the detected edges are dilated to make the edges continuous. A 3×3×3 cube structural element is used to dilate the edge image, so that the discontinuous edges are connected into continuous edges.
[0105] Step S31 is used to obtain seed points according to the continuous image. Since the image usually contains multiple discrete objects, the growth starting point of each object needs to be determined. Therefore, seed points need to be obtained to define the starting point of the target area to be analyzed. By traversing the pixels / voxels connected to it, the entire connected region is finally marked. Specifically, in this example, the method for step S31 to obtain seed points can be to use three-dimensional connectivity analysis to determine independent regions, that is, each tobacco strand. The 26-neighborhood (that is, the adjacent voxels in the up, down, left, right, front, back, and diagonal directions of each voxel) is used. All voxels are traversed, and the voxels with a value of 1 (edge) and not marked are used as seed points.
[0106] Step S32 is used to use a priority search method starting from the seed points to mark all voxels connected to the seed points as independent connected regions. In this example, the priority search method used in step S32 can be breadth-first search (BFS) or depth-first search (DFS).
[0107] Step S33 is used to calculate the areas of different independent connected regions and remove the independent connected regions with areas smaller than the set threshold. Since small-area connected regions are mostly noise or non-tobacco-strand structures (such as dust, imaging artifacts), this part needs to be removed. In this embodiment, after separating each tobacco strand, the center and area parameters of the tobacco strand can be calculated by calculating the average value of all pixel coordinates of each tobacco strand. After calculating the areas of different independent connected regions, the connected regions with areas smaller than the set threshold are removed. By removing the threshold, the analysis accuracy can be improved. In this example, the threshold can be set to 0.001mm 2 .
[0108] Step S14 is used to determine the main direction of cut tobacco by using the principal component analysis method and obtain the principal component vector. For each connected region (cut tobacco part), the principal component analysis method (principal components analysis, PCA) is used to calculate the main direction of the cut tobacco, and then the principal component vector of the cut tobacco is calculated by PCA. The relative plane angle of this direction in the XOY plane is obtained, and then the order rate of the cut tobacco is calculated. For the method of calculating the order rate by obtaining the eigenvector, it can be various forms known to those skilled in the art, including but not limited to local analysis of the structure tensor and three-dimensional ellipsoid fitting method. Considering that the measurement of the order rate of cut tobacco is an evaluation of the direction consistency of each cut tobacco strand, the local analysis of the structure tensor is mainly for the local direction field analysis, while the three-dimensional ellipsoid fitting method fits a three-dimensional ellipsoid model to the single cut tobacco slice to obtain the eigenvector of the ellipsoid, which is more suitable for objects with an approximate ellipsoid shape. The application of both methods has limitations. Therefore, in order to avoid the limitation of the actual cut tobacco state on the application of the analysis method itself, the principal component analysis method applicable to the direction analysis of fiber structures of any shape is adopted in the present invention. This method does not need to assume an ellipsoid model and directly calculates the direction based on the data distribution. In this embodiment, this step S14 extracts the main change direction of the data through the eigenvalue decomposition of the covariance matrix based on PCA, and the extracted main direction is more accurate. Specifically, this step S14 may include, for example, as shown in Figure 3 shown in the steps. In this Figure 3 it, this step S14 may include:
[0109] In step S40, the coordinates of all voxels of each connected region are obtained;
[0110] In step S41, the mean vector of the voxel coordinates of each connected region is calculated according to formulas (6) and (7),
[0111]
[0112] P i =(x i , y i , z i ), (7)
[0113] where μ is the mean vector of the voxel coordinates of the connected region, and P i represents the three-dimensional coordinate vector of the i-th voxel in the connected region, i = 1, 2,..., n, and n is the total number of voxels in the connected region;
[0114] In step S42, the voxel coordinate centering matrix is calculated according to formulas (8) and (9),
[0115] X c = X - θ, (8)
[0116] X = [P1, P2, …, P n , (9)
[0117] wherein, X c is the voxel coordinate centering matrix, and X is the voxel coordinate of the connected region;
[0118] In step S43, the covariance matrix of the voxel coordinate centering matrix is calculated according to formula (10),
[0119]
[0120] wherein, C is the covariance matrix of the voxel coordinate centering matrix;
[0121] In step S44, the covariance matrix is eigen-decomposed to obtain the principal component vectors.
[0122] In the method shown as Figure 3 such, step S40 is used to extract the coordinates of all voxels (3D pixels) of the connected regions (each cut tobacco strand) from the 3D image. Then, the covariance matrix of the centered data is calculated through steps S41 to S43, and step S44 eigen-decomposes the covariance matrix to obtain the principal component vectors. In this example, the covariance matrix can be eigen-decomposed according to formula (11):
[0123] Cv j = λ j v j , (j = 1, 2, 3), (11)
[0124] wherein, λ j is the eigenvalue, and v j is the eigenvector;
[0125] The eigenvalues λ1, λ2, λ3 and the corresponding eigenvectors v1, v2, v3 are obtained. The eigenvector corresponding to the maximum value of the eigenvalues is selected as the principal component vector.
[0126] Step S15 is used to calculate the order rate according to the principal component vector. Specifically, in this example, the method for step S15 to calculate the order rate may include the following steps:
[0127] In step S50, the relative planar angle of the principal component vector in the xOy plane is calculated according to formula (12):
[0128] θ = arctan2(v y , v x ), (12)
[0129] wherein, θ is the relative planar angle of the principal component vector in the xOy plane, and v xis the component of the principal component vector on the x-axis, v y is the component of the principal component vector on the y-axis, and arctan2 is a two-parameter arctangent function;
[0130] In step S51, the tobacco strand orderliness is calculated according to formulas (13) and (14):
[0131]
[0132] orientations = {θ1, θ2, …, θ n}, (14)
[0133] where Orderliness is the tobacco strand orderliness, std(orientations) is the standard deviation of the angles of the principal component vectors of all connected regions, orientations is the relative planar angle of the principal component vectors of all connected regions in the xy plane, and θ i is the relative planar angle of the principal component vector of the i-th connected region in the xy plane, i = 1, 2, …, n.
[0134] Step S50 is used to calculate the relative planar angle of the principal component vector in the xOy plane. Arctan2 is a two-parameter arctangent function that returns the angle of counterclockwise rotation from the positive x-axis to the vector (v x , v y ), and the range is between -π and π. The schematic diagram of the θ angle calculation is as Figure 4 shown. Figure 4 In part a of, it is the position diagram of the tobacco strands relative to the cigarette rod and the xOy plane. The xOy plane is a plane where the developed axial section is parallel to the horizontal direction, Figure 4 and in part b of, it is the relative planar angle of the tobacco strands in the cigarette rod with respect to the xOy plane.
[0135] Step S51 is used to calculate the tobacco strand orderliness. Since the orderliness of the cigarette rod is the overall orientation of the tobacco strands in the cigarette rod and is used to evaluate the degree of orderly arrangement of the tobacco strands in the cigarette. Considering that the mean mainly reflects the overall tendency of the main direction of the tobacco strands and cannot directly evaluate the consistency of the directions, and is not sensitive to data changes. Especially when there are large fluctuations in the main direction of the tobacco strands, the mean may not accurately reflect the actual situation and is also easily affected by extreme values, resulting in the calculation result deviating from the true situation. Compared with the mean, the standard deviation can directly evaluate the consistency of the tobacco strand directions and can also effectively filter the influence of extreme values on the whole, accurately reflecting the actual situation. Therefore, in this embodiment, the standard deviation is used to evaluate the consistency of the tobacco strand directions. In formula (13), is the maximum standard deviation, representing the direction of a completely random distribution. For each cut tobacco strand, defining the orientation as completely parallel to the cigarette axial direction is completely ordered, i.e., Orderliness = 100%, and the orientation perpendicular to the cigarette axial direction is disordered (random), i.e., Orderliness = 0%. As Figure 5 shown are the measurement results of the cut tobacco strand orderliness.
[0136] Based on the above measurement method, the cut tobacco strand orderliness detection was carried out on samples numbered 1 - 9. The experimental results are shown in Table 1. It can be observed that: the distribution interval of the cut tobacco strand orderliness of 90 samples with 9 numbers is [28.06%, 30.45%], the average orderliness is 29.42%, the relative plane angle distribution interval is [113.97°, 119.16°], and the average relative plane angle is 116.78°.
[0137] Table 1 Detection results of cut tobacco strand orderliness in cigarettes with different numbers
[0138]
[0139] On the other hand, the present invention provides a cut tobacco strand orderliness measurement system based on principal component analysis. The measurement system includes an image processing module, an edge detection module, a connected region analysis module, a principal component analysis module, an operation module, and a processor. Among them, the image processing module is used for normalizing processing, threshold segmentation processing, and morphological opening operation processing of the three-dimensional reconstructed image of the cigarette; the edge detection module is used for calculating the edge gradient of the three-dimensional reconstructed image to obtain the edge intensity; the connected region analysis module is used for extracting independent connected regions; the principal component analysis module is used for applying principal component analysis to each connected region to calculate the principal direction to determine the relative plane angle; the operation module is used for calculating the orderliness of the cut tobacco strands according to the regional principal direction angle; the processor is connected to the image processing module, the edge detection module, the connected region analysis module, the principal component analysis module, and the operation module, and the processor is configured to execute the measurement method as described in any one of the above.
[0140] On yet another aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the measurement method as described in any one of the above is implemented.
[0141] Advantages of the present invention:
[0142] The present invention uses high-resolution three-dimensional CT images, accurately extracts the cut tobacco strand region through threshold segmentation and morphological processing, combines three-dimensional edge detection and connectivity analysis, and effectively identifies and separates the cut tobacco strand region. By extracting the principal direction of each cut tobacco strand through principal component analysis (PCA) and combining the statistical analysis of the principal direction angle, the high-precision quantification of the cut tobacco strand arrangement orderliness is realized.
[0143] Based on the relative angle between the main direction of tobacco shreds and the XOY plane, the present invention calculates the standard deviation of all tobacco shred directions and generates an order rate index through normalization. This method can not only quantitatively evaluate the orderliness of tobacco shred arrangement, but also reflect the overall distribution characteristics of tobacco shreds in a cigarette, providing a scientific basis for structural performance analysis.
[0144] The present invention designs a modular system architecture, which realizes automatic processing of the whole process from image processing, connected region extraction to main direction analysis and order rate calculation, reduces manual intervention, improves analysis efficiency, and is suitable for rapid detection of a large number of cigarette samples. Moreover, the system supports dynamic adjustment of image segmentation thresholds and morphological operation parameters, and can adapt to different types and specifications of cigarette samples. In addition, the system can batch process cigarette samples and generate analysis reports containing information such as the order rate and direction distribution of tobacco shreds, facilitating quality control and process optimization.
[0145] By combining multiple algorithms (such as Sobel operator edge detection, PCA main direction extraction, and standard deviation statistical analysis), the present invention improves the robustness of data processing and the reliability of results, and has good measurement repeatability.
[0146] The present invention provides a scientific and systematic solution for the quantitative evaluation of tobacco shred arrangement, which can be widely applied to quality control, product optimization, and process improvement in the tobacco industry, providing important technical support for improving cigarette performance and market competitiveness.
[0147] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0148] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0149] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction means that implements the function specified in one or more processes and / or blocks Figure 1 of one or more processes and / or blocks Figure 1 specified in the flowcharts or block diagrams.
[0150] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the function specified in one or more processes and / or blocks Figure 1 of one or more processes and / or blocks Figure 1 specified in the flowcharts or block diagrams.
[0151] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0152] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0153] Computer-readable media includes both permanent and non-permanent, removable and non-removable media implemented by any method or technology for storing information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0154] It should also be noted that the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising the element.
[0155] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A method for measuring the orderly rate of cut tobacco based on principal component analysis, characterized in that, The measurement method includes: Obtaining a three-dimensional reconstructed image of a cigarette rod; Preprocessing the three-dimensional reconstructed image; Performing three-dimensional edge detection on the preprocessed three-dimensional reconstructed image to obtain the tobacco structure features; Extracting independent connected regions based on the tobacco structure features; For each independent connected region, using the principal component analysis method to determine the main direction of the tobacco to obtain the principal component vector; Calculating the order rate according to the principal component vector.
2. The measurement method according to claim 1, characterized in that Preprocessing the three-dimensional reconstructed image includes: Performing at least one of normalization processing, threshold segmentation processing, and morphological processing on the three-dimensional reconstructed image.
3. The measuring method according to claim 1, wherein Performing three-dimensional edge detection on the preprocessed three-dimensional reconstructed image to obtain the tobacco structure features includes: Calculating the gradient values of edge detection in the x-axis, y-axis, and z-axis directions of the preprocessed three-dimensional reconstructed image respectively according to formulas (1) to (3): Among them, G x is the gradient value of edge detection in the x direction, G y is the gradient value of edge detection in the y direction, G z is the gradient value of edge detection in the z direction, * represents the convolution operation, and I is the preprocessed three-dimensional reconstruction image; Calculating the edge strength according to formula (4): where E is the edge strength.
4. The measuring method according to claim 1, characterized in that, Extracting independent connected regions based on the tobacco structure features includes: Dilating the detected edges according to formula (5) to obtain an image with continuous edges, Among them, A is the input image, B is a 3×3×3 cubic structuring element, is the reflection of the structuring element, and z is the pixel position in the image; Obtaining seed points based on the image with continuous edges; Using the priority search method to start from the seed points and marking all voxels connected to the seed points as independent connected regions; Calculating the areas of different independent connected regions and removing the independent connected regions with areas smaller than the set threshold.
5. The measurement method according to claim 4, characterized in that Obtaining seed points based on the image with continuous edges includes: Traversing all voxels of the image with continuous edges using 26-neighborhood, and taking the voxels with voxel value 1 and unmarked as seed points.
6. The measurement method according to claim 1, characterized in that, For each connected region, using the principal component analysis method to determine the main direction of the tobacco to obtain the principal component vector includes: Obtaining the coordinates of all voxels of each connected region; Calculating the mean vector of the voxel coordinates of each connected region according to formulas (6) and (7), P i =(x i , y i , z i ), (7) where μ is the mean vector of the voxel coordinates of the connected region, and P i represents the three-dimensional coordinate vector of the i-th voxel in the connected region, i = 1, 2, …, n, where n is the total number of voxels in the connected region; Calculating the voxel coordinate centering matrix according to formulas (8) and (9), X c = X - μ, (8) X = [P1, P2, …, P n , (9) where X c is the voxel coordinate centering matrix, and X is the voxel coordinate of the connected region; Calculating the covariance matrix of the voxel coordinate centering matrix according to formula (10), where C is the covariance matrix of the voxel coordinate centering matrix; Performing eigenvalue decomposition on the covariance matrix to obtain the principal component vector.
7. The measuring method according to claim 6, wherein Performing eigenvalue decomposition on the covariance matrix to obtain the principal component vector includes: Performing eigenvalue decomposition on the covariance matrix according to formula (11), Cv j = λ j v j ,(j = 1, 2, 3), (11) where λ j is the eigenvalue and v j is the eigenvector; Selecting the eigenvector corresponding to the maximum value of the eigenvalues as the principal component vector.
8. The measurement method according to claim 1, characterized in that, Calculating the order rate according to the principal component vector includes: Calculating the relative plane angle of the principal component vector in the xOy plane according to formula (12): θ = arctan2(v y , v x ), (12) where θ is the relative plane angle of the principal component vector in the xOy plane, v x is the component of the principal component vector on the x-axis, v y is the component of the principal component vector on the y-axis, and arctan2 is the two-parameter arctangent function; Calculating the tobacco order rate according to formulas (13) and (14): orientations = {θ1, θ2, …, θ n}, (14) Among them, Ordrliness is the tobacco strand order rate, std(orientations) is the standard deviation of the angles of the principal component vectors of all connected regions, orientations is the relative planar angle of the principal component vectors of all connected regions in the xy plane, and θ i is the relative planar angle of the principal component vector of the i-th connected region in the xy plane, where i = 1, 2, …, n.
9. A measuring system for the orderly rate of cut tobacco based on principal component analysis, characterized in that, The measurement system includes: An image processing module for performing normalization processing, threshold segmentation processing, and morphological opening operation processing on the three-dimensional reconstructed image of the cigarette rod; An edge detection module for calculating the edge gradient of the three-dimensional reconstructed image to obtain the edge strength; A connected region analysis module for extracting independent connected regions; A principal component analysis module for applying principal component analysis to each connected region to calculate the main direction and determine the relative plane angle; An operation module, configured to calculate the order rate of cut tobacco according to the regional main direction angle; A processor, connected to the image processing module, the edge detection module, the connected region analysis module, the principal component analysis module and the operation module, and the processor is configured to execute the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, Instructions are stored on the computer-readable storage medium, and when the instructions are executed by the processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
High-resolution cigarette pore structure detection method and system
CN121476014A