Tobacco shred moisture content detection method and device, computer equipment, storage medium and computer program product
Through the combination of hyperspectral imager and reflective microwave radar moisture sensor, the problems of low accuracy and slow efficiency of tobacco moisture content detection are solved, and accurate detection of tobacco moisture content and spatial distribution display are achieved.
Patent Information
- Application Number
- CN202510446389.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-07-11
AI Technical Summary
The existing tobacco moisture content detection technology cannot obtain the spatial distribution of tobacco moisture content, and the measurement accuracy is low and the speed is slow, which affects the quality and production efficiency of tobacco silk.
Using a combination of hyperspectral imager and reflective microwave radar moisture sensor, we use the method of determining the tobacco coordinates by acquiring the imaging images, controlling the imaging range to cover the target area, obtaining the total moisture content and average spectral data, and establishing a prediction model to generate a visualization of the moisture content distribution.
It realizes accurate detection of the moisture content of tobacco, improves detection efficiency and accuracy, can intuitively display the moisture distribution, and supports dynamic monitoring and real-time display.
Smart Images

Figure CN120294030A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of tobacco detection, and particularly to a method, a device, a computer device, a storage medium, and a computer program product for detecting the moisture content of cut tobacco. Background Art
[0002] The moisture content of cut tobacco is an important index affecting the quality of cut tobacco and the production and processing process. Too high or too low moisture content of cut tobacco will affect the taste and burning characteristics of products related to cut tobacco. Therefore, how to accurately detect the moisture content of cut tobacco and its spatial distribution has become a problem to be solved.
[0003] The current detection technologies for the moisture content of cut tobacco include the resistance method, the microwave method, and the drying method, but they cannot obtain the spatial distribution of the moisture content of cut tobacco, and have low measurement accuracy, slow detection speed, and strong damage ability to samples, which affect the quality of cut tobacco and the efficiency of production and processing. Therefore, there are problems of low detection efficiency and low accuracy for the moisture content of cut tobacco at present. Summary of the Invention
[0004] Based on this, in view of the above technical problems of low detection efficiency and low accuracy for the moisture content of cut tobacco, it is necessary to provide a method, a device, a computer device, a storage medium, and a computer program product for detecting the moisture content of cut tobacco.
[0005] In a first aspect, the present application provides a method for detecting the moisture content of cut tobacco, including:[[]]
[0006] Obtaining an imaging image of the cut tobacco to be measured within a preset sample area, and determining the cut tobacco coordinates of the cut tobacco to be measured according to the imaging image; the preset sample area represents an area including all the cut tobacco to be measured;
[0007] Based on the cut tobacco coordinates, determining a target area of the cut tobacco to be measured within the preset sample area;
[0008] Controlling the imaging range of a hyperspectral imager to cover the target area, and controlling a reflection type microwave radar moisture sensor to move to the center of the target area;
[0009] Based on the reflection type microwave radar moisture sensor, obtaining the total moisture content of the cut tobacco to be measured within the target area;
[0010] Based on the hyperspectral imager, obtaining the average spectral data of the target area;
[0011] Based on the total moisture content and the average spectral data, establishing a prediction model for obtaining a visualization graph of the moisture content distribution of the cut tobacco to be measured within the target area.
[0012] In one embodiment, obtaining the total moisture content of the to-be-detected cut tobacco in the target area based on the reflective microwave radar moisture sensor includes: obtaining the difference data between the moisture echo signal and the transmitted signal corresponding to the target area based on the reflective microwave radar moisture sensor; collecting the temperature and humidity data of the target area based on a temperature and humidity sensor; and obtaining the total moisture content of the to-be-detected cut tobacco in the target area based on a preset moisture calibration curve, the difference data, and the temperature and humidity data.
[0013] In one embodiment, obtaining the average spectral data of the target area based on the hyperspectral imager includes: obtaining the spectral image data of the target area based on the hyperspectral imager; performing threshold segmentation on the spectral image data based on a preset threshold to obtain the pixel spectral of each pixel point of the to-be-detected cut tobacco in the target area; and obtaining the average spectral data of the target area based on multiple pixel spectrals.
[0014] In one embodiment, establishing a prediction model based on the total moisture content and the average spectral data for obtaining a visualization graph of the moisture content distribution of the to-be-detected cut tobacco in the target area includes: establishing a prediction model based on the total moisture content and the average spectral data, and obtaining the spectral data of each pixel point in the spectral image data, so as to perform point-by-point prediction of the moisture content corresponding to each pixel point through the prediction model to obtain a prediction result; and generating a visualization graph of the moisture content distribution of the to-be-detected cut tobacco sample based on the prediction result.
[0015] In one embodiment, obtaining the spectral image of the to-be-detected cut tobacco in a preset sample area and determining the cut tobacco coordinates of the to-be-detected cut tobacco according to the spectral image includes: obtaining the imaging image of the to-be-detected cut tobacco and the reference object of the to-be-detected cut tobacco in the preset sample area based on the hyperspectral imager; obtaining the difference data between the color and / or reflectivity of the to-be-detected cut tobacco and the reference object based on the imaging image; and obtaining the cut tobacco coordinates of the to-be-detected cut tobacco in the preset sample area based on the difference data.
[0016] In one embodiment, the cut tobacco moisture content detection method further includes: obtaining the spectral image of the to-be-detected cut tobacco in the preset sample area, and inputting the spectral data corresponding to the spectral image into the training set of the prediction model to update the prediction model.
[0017] In a second aspect, the present application further provides a cut tobacco moisture content detection device, including:
[0018] A coordinate determination module, configured to obtain an imaging image of the to-be-detected cut tobacco within a preset sample area, and determine the cut tobacco coordinates of the to-be-detected cut tobacco according to the imaging image; the preset sample area represents an area including all the to-be-detected cut tobacco;
[0019] A target area determination module, configured to determine a target area of the to-be-detected cut tobacco within the preset sample area based on the cut tobacco coordinates;
[0020] A control module, configured to control the imaging range of a hyperspectral imager to cover the target area, and control a reflection microwave radar moisture sensor to move to the center of the target area;
[0021] A data acquisition module, configured to acquire the total moisture content of the to-be-detected cut tobacco within the target area based on the reflection microwave radar moisture sensor;
[0022] The data acquisition module is further configured to acquire the average spectral data of the target area based on the hyperspectral imager;
[0023] A data processing module, configured to establish a prediction model based on the total moisture content and the average spectral data, so as to obtain a visualization graph of the moisture content distribution of the to-be-detected cut tobacco within the target area.
[0024] In a third aspect, the present application further provides a computer device, where the computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0025] Obtain an imaging image of the to-be-detected cut tobacco within a preset sample area, and determine the cut tobacco coordinates of the to-be-detected cut tobacco according to the imaging image; the preset sample area represents an area including all the to-be-detected cut tobacco;
[0026] Determine a target area of the to-be-detected cut tobacco within the preset sample area based on the cut tobacco coordinates;
[0027] Control the imaging range of a hyperspectral imager to cover the target area, and control a reflection microwave radar moisture sensor to move to the center of the target area;
[0028] Acquire the total moisture content of the to-be-detected cut tobacco within the target area based on the reflection microwave radar moisture sensor;
[0029] Acquire the average spectral data of the target area based on the hyperspectral imager;
[0030] Establish a prediction model based on the total moisture content and the average spectral data, so as to obtain a visualization graph of the moisture content distribution of the to-be-detected cut tobacco within the target area.
[0031] Fourthly, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0032] Obtain an imaging image of the to-be-detected cut tobacco within a preset sample area, and determine the cut tobacco coordinates of the to-be-detected cut tobacco according to the imaging image; the preset sample area represents an area including all the to-be-detected cut tobacco;
[0033] Based on the cut tobacco coordinates, determine a target area of the to-be-detected cut tobacco within the preset sample area;
[0034] Control the imaging range of a hyperspectral imager to cover the target area, and control a reflective microwave radar moisture sensor to move to the center of the target area;
[0035] Based on the reflective microwave radar moisture sensor, obtain the total moisture content of the to-be-detected cut tobacco within the target area;
[0036] Based on the hyperspectral imager, obtain the average spectral data of the target area;
[0037] Based on the total moisture content and the average spectral data, establish a prediction model for obtaining a visualization graph of the moisture content distribution of the to-be-detected cut tobacco within the target area.
[0038] Fifthly, the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0039] Obtain an imaging image of the to-be-detected cut tobacco within a preset sample area, and determine the cut tobacco coordinates of the to-be-detected cut tobacco according to the imaging image; the preset sample area represents an area including all the to-be-detected cut tobacco;
[0040] Based on the cut tobacco coordinates, determine a target area of the to-be-detected cut tobacco within the preset sample area;
[0041] Control the imaging range of a hyperspectral imager to cover the target area, and control a reflective microwave radar moisture sensor to move to the center of the target area;
[0042] Based on the reflective microwave radar moisture sensor, obtain the total moisture content of the to-be-detected cut tobacco within the target area;
[0043] Based on the hyperspectral imager, obtain the average spectral data of the target area;
[0044] A prediction model is established based on the total moisture content and the average spectral data for obtaining a visualization map of the moisture content distribution of the cut tobacco to be measured within the target area.
[0045] In the above cut tobacco moisture content detection method, device, computer device, storage medium, and computer program product, during the process of detecting the cut tobacco moisture content, first, an imaging image of the cut tobacco to be measured within a preset sample area is obtained, and the cut tobacco coordinates of the cut tobacco to be measured are determined according to the imaging image; the preset sample area represents an area including all the cut tobacco to be measured; then, based on the cut tobacco coordinates, the target area of the cut tobacco to be measured within the preset sample area is determined; next, the imaging range of the hyperspectral imager is controlled to cover the target area, and the reflective microwave radar moisture sensor is controlled to move to the center of the target area; then, based on the reflective microwave radar moisture sensor, the total moisture content of the cut tobacco to be measured within the target area is obtained; further, the average spectral data of the target area is obtained based on the hyperspectral imager; finally, a prediction model is established based on the total moisture content and the average spectral data for obtaining a visualization map of the moisture content distribution of the cut tobacco to be measured within the target area. During the above process, by obtaining the imaging image of the cut tobacco to be measured within the preset sample area and thus determining the cut tobacco coordinates, the cut tobacco sample to be measured can be accurately located to ensure the accuracy of data collection; by determining the target area based on the cut tobacco coordinates and controlling the reflective microwave radar moisture sensor to move to the center of the target area, the efficiency and accuracy of data acquisition can be improved; by obtaining the average spectral data and combining it with the total moisture content to establish a prediction model, more accurate moisture content prediction can be achieved. Therefore, the above process improves the efficiency and accuracy of cut tobacco moisture content detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0047] Figure 1 It is a schematic flowchart of a cut tobacco moisture content detection method in an embodiment;
[0048] Figure 2 It is a schematic flowchart of a cut tobacco moisture content detection step in an embodiment;
[0049] Figure 3 It is a schematic structural diagram of a cut tobacco moisture content detection system in an embodiment;
[0050] Figure 4 It is a structural block diagram of a cut tobacco moisture content detection device in an embodiment;
[0051] Figure 5 It is the internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0052] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The moisture content is one of the important indicators affecting the quality of cut tobacco and the production and processing process. Too high or too low moisture content of cut tobacco will lead to a decline in storage performance, limited process stability, and even affect the taste and burning characteristics of the final product. Therefore, accurately detecting the moisture content of cut tobacco and its spatial distribution is of great significance to the tobacco industry. However, traditional cut tobacco moisture detection technologies mainly rely on point measurement equipment, such as the resistance method, microwave method, drying method, etc. Although these methods can measure the overall moisture content, there are problems such as low measurement accuracy, slow detection speed, and strong sample destructiveness. In addition, traditional methods cannot obtain the spatial distribution information of the moisture content of cut tobacco and are difficult to meet the requirements of modern and intelligent tobacco production for precise moisture control.
[0054] In one embodiment, as Figure 1 shown, a method for detecting the moisture content of cut tobacco is provided. In this embodiment, the example of applying this method to a server is used for illustration. In this embodiment, the method includes the following steps:
[0055] Step S102, obtain an imaging image of the cut tobacco to be measured within a preset sample area, and determine the cut tobacco coordinates of the cut tobacco to be measured according to the imaging image; the preset sample area represents an area including all the cut tobacco to be measured.
[0056] Among them, the preset sample area refers to the area predefined during data collection, which can be used to ensure that this area includes all the cut tobacco to be measured; the cut tobacco to be measured refers to the tobacco sample that needs to be evaluated for quality or composition; the imaging image can be an image obtained by spectral imaging technology, such as a spectral image, and the spectral image usually includes spectral information of the cut tobacco to be measured at multiple wavelengths; the cut tobacco coordinates refer to the coordinate information indicating the position of the cut tobacco to be measured in the spectral image, which can be two-dimensional or three-dimensional.
[0057] As an example, a hyperspectral imager can be used to collect the imaging image of the cut tobacco to be measured within the preset sample area, so as to provide the reflectance data of the cut tobacco to be measured; the determination of the cut tobacco coordinates can be achieved through image processing technology, such as using an image segmentation algorithm to identify and mark the position of the cut tobacco; the cut tobacco to be measured can be obtained from different sources; the spectral image usually consists of multiple bands, such as visible light and near-infrared light.
[0058] Step S104: Determine the target area of the to-be-detected cut tobacco within the preset sample area based on the coordinates of the cut tobacco.
[0059] The target area is a relatively small area with respect to the preset sample area and is usually a part of the preset sample area.
[0060] Step S106: Control the imaging range of the hyperspectral imager to cover the target area, and control the reflective microwave radar moisture sensor to move to the center of the target area.
[0061] The center of the target area refers to the position of the center point of the target area, which can be used as a reference point for subsequent operations.
[0062] Step S108: Obtain the total moisture content of the to-be-detected cut tobacco in the target area based on the reflective microwave radar moisture sensor.
[0063] The total moisture content refers to the moisture content inside the to-be-detected cut tobacco measured by the reflective microwave radar moisture sensor.
[0064] Step S110: Obtain the average spectral data of the target area based on the hyperspectral imager.
[0065] The average spectral data refers to the average value of multiple spectral data obtained from the target area.
[0066] Step S112: Establish a prediction model based on the total moisture content and the average spectral data to obtain a visualization map of the moisture content distribution of the to-be-detected cut tobacco in the target area.
[0067] The visualization map of the moisture content distribution refers to an image of the moisture content distribution of the to-be-detected cut tobacco, which may include high-moisture areas and low-moisture areas, and may also include specific values and distribution trends of the moisture content.
[0068] As an example, the form of the visualization map of the moisture content distribution can be a heat map, a contour map, a scatter plot, a bar chart, etc.
[0069] In the above method for detecting the moisture content of cut tobacco, first, an imaging image of the cut tobacco to be measured within a preset sample area is obtained, and the cut tobacco coordinates of the cut tobacco to be measured are determined based on the imaging image; the preset sample area represents an area including all the cut tobacco to be measured; then, based on the cut tobacco coordinates, the target area of the cut tobacco to be measured within the preset sample area is determined; next, the imaging range of the hyperspectral imager is controlled to cover the target area, and the reflective microwave radar moisture sensor is controlled to move to the center of the target area; then, based on the reflective microwave radar moisture sensor, the total moisture content of the cut tobacco to be measured within the target area is obtained; further, the average spectral data of the target area is obtained based on the hyperspectral imager; finally, a prediction model is established based on the total moisture content and the average spectral data for obtaining a visualization map of the moisture content distribution of the cut tobacco to be measured within the target area. In the above process, by obtaining the imaging image of the cut tobacco to be measured within the preset sample area and thus determining the cut tobacco coordinates, the cut tobacco sample to be measured can be accurately positioned, ensuring the accuracy of data collection; by determining the target area based on the cut tobacco coordinates and controlling the reflective microwave radar moisture sensor to move to the center of the target area, the efficiency and accuracy of data acquisition can be improved; by obtaining the average spectral data and combining it with the total moisture content to establish a prediction model, more accurate moisture content prediction can be achieved. Therefore, the above process improves the efficiency and accuracy of the detection of the moisture content of cut tobacco.
[0070] In an exemplary embodiment, step S106 of obtaining the total moisture content of the cut tobacco to be measured within the target area based on the reflective microwave radar moisture sensor includes:
[0071] Based on the reflective microwave radar moisture sensor, the difference data between the moisture echo corresponding to the target area and the transmitted signal is obtained; the temperature and humidity data of the target area are collected based on the temperature and humidity sensor; based on the preset moisture calibration curve, the difference data, and the temperature and humidity data, the total moisture content of the cut tobacco to be measured within the target area is obtained.
[0072] Among them, the moisture echo refers to the signal reflected back after the microwave radar sensor emits microwaves and encounters moisture; the difference data refers to the energy difference between the emitted microwave signal and the received echo signal; the preset moisture calibration curve refers to a curve established based on the historical moisture content and the measured difference data, which can be used to obtain the total moisture content of the cut tobacco to be measured in actual measurement.
[0073] In this embodiment, by combining the reflective microwave radar moisture sensor, the temperature and humidity sensor, their difference data, and the preset calibration curve, the total moisture content of the cut tobacco within the target area can be more accurately evaluated.
[0074] In an embodiment, step S108 of obtaining the average spectral data of the target area based on the hyperspectral imager includes:
[0075] Based on a hyperspectral imager, spectral image data of the target area is obtained; based on a preset threshold, threshold segmentation is performed on the spectral image data to obtain the pixel spectra of each pixel of the cut tobacco to be measured within the target area; based on the spectra of multiple pixels, the average spectral data of the target area is obtained.
[0076] Among them, the preset threshold is a pre-set value that can be used to distinguish different features; threshold segmentation refers to determining whether a pixel belongs to the target object or the background by comparing the spectral image data of each pixel with the preset threshold; a pixel is the smallest unit that makes up an image in a digital image, and each pixel includes spectral data at the corresponding position, reflecting the spectral characteristics at the corresponding position; pixel spectrum refers to a data set obtained from a hyperspectral imager and used to represent the spectral characteristics of the pixel.
[0077] In this embodiment, by using the preset threshold for threshold segmentation, the interference of background noise can be effectively reduced, each pixel within the target area can be analyzed centrally, and the reliability of the data can be improved; by calculating the average spectrum of the target area from the spectra of multiple pixels, the influence of outliers of individual pixels can be reduced, so as to obtain more accurate characteristics of the target area and improve the accuracy of the subsequent process.
[0078] Further, in one embodiment, step S110 is based on the total moisture content and the average spectral data to establish a prediction model to obtain a visualization map of the moisture content distribution of the cut tobacco to be measured within the target area, including:
[0079] Based on the total moisture content and the average spectral data, a prediction model is established, and the spectral data of each pixel in the spectral image data is obtained, so as to predict the moisture content corresponding to each pixel point by point through the prediction model to obtain a prediction result; based on the prediction result, a visualization map of the moisture content distribution of the cut tobacco sample to be measured is generated.
[0080] Among them, point-by-point prediction refers to estimating the moisture content of each pixel in the spectral image data separately. The spectral image data of each pixel can be used as input and input into the prediction model, and then the predicted value of the moisture content of the pixel is generated; the prediction result refers to the estimated value of the moisture content generated according to the point-by-point prediction, usually represented in the form of specific numerical values or ranges.
[0081] As an example, the output form can be through a numerical value, such as expressed as a percentage; it can also be through a spatial distribution, such as using the prediction results to form a two-dimensional matrix, and using the two-dimensional matrix to represent the moisture distribution of the target area.
[0082] In this embodiment, through point-by-point prediction, the moisture content of each pixel can be provided, improving the accuracy of the moisture content acquisition process; the use of the moisture content distribution visualization map can intuitively display the moisture distribution in different regions, enhancing the user experience.
[0083] Furthermore, in one embodiment, step S102 of obtaining the imaging image of the to-be-detected cut tobacco within the preset sample area and determining the cut tobacco coordinates of the to-be-detected cut tobacco according to the imaging image includes:
[0084] Based on a hyperspectral imager, obtain the imaging images of the to-be-detected cut tobacco and the reference object of the to-be-detected cut tobacco within the preset sample area; based on the imaging images, obtain the difference data of the color and / or reflectivity between the to-be-detected cut tobacco and the reference object; based on the difference data, obtain the cut tobacco coordinates of the to-be-detected cut tobacco within the preset sample area.
[0085] Among them, the hyperspectral imager can generate an imaging image by simultaneously capturing the reflected light within multiple wavelength ranges; the reference object of the to-be-detected cut tobacco can be a conveyor belt.
[0086] As an example, respectively obtain the colors of the to-be-detected cut tobacco and the reference object, such as the RGB (RGB color mode) values. By comparing the RGB values of the to-be-detected cut tobacco and the reference object, difference data can be obtained, and then the cut tobacco coordinates can be determined based on the difference data.
[0087] As another example, respectively obtain the reflectivities of the to-be-detected cut tobacco and the reference object at the same wavelength. By comparing the reflectivities of the to-be-detected cut tobacco and the reference object, difference data can be obtained, and then the cut tobacco coordinates can be determined based on the difference data.
[0088] As yet another example, respectively obtain the color of the to-be-detected cut tobacco and the reference object and the reflectivities of the to-be-detected cut tobacco and the reference object at the same wavelength, and combine the difference in color between the to-be-detected cut tobacco and the reference object and the difference in reflectivity between the to-be-detected cut tobacco and the reference object to determine the cut tobacco coordinates.
[0089] In this embodiment, through the imaging image obtained by the hyperspectral imager, the difference between the to-be-detected cut tobacco and the reference object can be accurately obtained, so as to determine the cut tobacco coordinates by comparing the difference between the to-be-detected cut tobacco and the reference object, with relatively high accuracy, and time and resources are saved.
[0090] In one embodiment, the cut tobacco moisture content detection method further includes: obtaining the spectral image of the to-be-detected cut tobacco within the preset sample area, and inputting the spectral data corresponding to the spectral image into the training set of the prediction model to update the prediction model.
[0091] Among them, when obtaining the spectral images of other to-be-detected cut tobacco within the preset sample area, the corresponding spectral data can be directly input into the prediction model, and then the prediction model can be optimized and updated in real time through the chip to obtain a prediction model with higher accuracy, laying a foundation for subsequent use.
[0092] Furthermore, in one embodiment, the present application further includes a cut tobacco moisture content detection system, as Figure 2 shown. The system includes a conveyor belt 1, a driving motor 2, a light-shielding cover 3, an array of halogen lamps 4, a hyperspectral imager 5, a reflection-type microwave radar moisture sensor 6, a temperature and humidity sensor 7, a control chip 8, and a display 9.
[0093] The display 9 is electrically connected to the light-shielding cover 3 through the control chip 8. The light-shielding cover 3 is placed on the black cloth surface with a reflectivity of 0% on the conveyor belt 1 to form a closed space. The driving motor 2 is electrically connected to the conveyor belt 1. The array of halogen lamps 4, the hyperspectral imager 5, the reflection-type microwave radar moisture sensor 6, and the temperature and humidity sensor 7 are placed inside the light-shielding cover 3.
[0094] The conveyor belt 1 is used to place the to-be-detected cut tobacco; the motor drive is used to drive the conveyor belt 1 to move; the light-shielding cover 3 is used to isolate interfering light sources; the array of halogen lamps 4 is used to provide a uniform light source for the to-be-detected cut tobacco; the hyperspectral imager 5 is used to obtain the spectral image of the to-be-detected cut tobacco; the reflection-type microwave radar moisture sensor 6 is used to obtain the cut tobacco coordinates of the to-be-detected cut tobacco; the temperature and humidity sensor 7 is used to monitor the temperature and humidity; the control chip 8 is used to control the start and stop of the conveyor belt 1, the array of halogen lamps 4, the hyperspectral imager 5, the reflection-type microwave radar moisture sensor 6, and the driving motor 2, and to adjust the speed of the conveyor belt 1 and the light source intensity of the array of halogen lamps 4; the display 9 is used to display the visualization map of the moisture content distribution of the to-be-detected cut tobacco.
[0095] Among them, the motor drive (driving motor 2) can control the movement speed of the conveyor belt 1; the hyperspectral imager 5 is detachable; the control chip 8 is also connected with a peripheral circuit and can be controlled by AI (Artificial Intelligence); the surface of the conveyor belt 1 is a black cloth surface with a reflectivity of 0%, which is used to place the to-be-detected cut tobacco sample to ensure the minimum optical reflection interference during the spectral measurement process; the conveyor belt 1 is powered by the driving motor 2, and the control chip 8 controls the speed of the conveyor belt 1 by adjusting the motor gear to ensure that the image does not distort when the hyperspectral imager 5 acquires data; the array of halogen lamps 4 is arranged at the top inside the main body of the system (the closed space formed by the light-shielding cover 3 and the conveyor belt 1), which can provide a stable and uniform light source for the to-be-detected sample, avoiding interference to hyperspectral imaging caused by uneven illumination. When the to-be-detected cut tobacco is in the shooting environment of the light-shielding cover 3 and the halogen light source, it can be irradiated by a stable light source and there is no need to perform complex background elimination work on the acquired spectral image and spectral data.
[0096] The hyperspectral imager 5 and the reflection microwave radar moisture sensor 6 are installed on the stepping control rod. The stepping control rod can achieve precise movement along the horizontal and vertical axes, ensuring that the field of view of the hyperspectral imager 5 covers the entire sample area and enabling accurate positioning of the reflection microwave radar sensor to focus on the central area of the sample to be measured (the preset sample area of the cut tobacco to be measured). On the inner side of the side of the system main body is the temperature and humidity sensor 7, which is used to monitor the ambient temperature and humidity to assist in the calibration and analysis of the moisture content. The outside of the system main body is connected to the AI control chip 8 (control chip 8), which is responsible for controlling the start and stop of the conveyor belt 1, the halogen light source, the hyperspectral imager 5, the microwave moisture sensor, and the drive motor 2, and for adjusting the speed of the conveyor belt 1 and the intensity of the light source in real time. At the same time, the AI control chip 8 is used for real-time data calculation, prediction model training and updating, and for displaying the visualized distribution map of the moisture content and the prediction results on the display 9 in real time. The outside of the system main body is connected to the display 9, which can be used to receive the distribution map of the moisture content of the cut tobacco calculated and output by the AI control chip 8 and to visually display the moisture distribution situation.
[0097] Furthermore, as an example, when the power is turned on, the AI control chip 8 outputs a drive signal to start the conveyor belt, and the cut tobacco sample to be measured is placed on it. The array halogen lamp 4 light source, the hyperspectral imager 5, the microwave radar moisture sensor, the temperature and humidity sensor 7, and the stepping control rod are started. After waiting for the light source to stabilize, the stepping control rod moves to drive the hyperspectral imager 5 and the microwave radar moisture sensor to move. The position of the sample is automatically identified according to the color and reflectivity differences between the sample and the bottom conveyor belt. After determining the sample position coordinates, image and microwave signal acquisition of the sample are carried out. The temperature and humidity sensor 7 obtains the temperature and humidity signals in the light-shielding cover 3 at this time. The AI control chip 8 performs fusion analysis on the data of the energy difference between the moisture echo obtained by the reflection microwave radar moisture sensor 6 and the transmitted signal and the synchronously collected ambient temperature and humidity data, and combines it with the standard moisture calibration curve (preset moisture calibration curve) to obtain the overall moisture content of the cut tobacco to be measured. The AI control chip 8 combines and corresponds the obtained image information with the overall moisture content, processes the data using the spectral image processing algorithm integrated therein, establishes a moisture content prediction model (prediction model) based on the least squares support vector machine, and predicts and calculates the moisture content of each pixel point in the target image area using the information of the spectrum and the image based on the visualization algorithm integrated in the AI control chip 8. After the calculation is completed, a distribution map of the moisture content of the cut tobacco is formed by combining the image pixel positions. The AI control chip 8 packs and stores the single measurement calculation data, and visually displays the moisture content distribution of the cut tobacco in the target area on the display 9.
[0098] The present application provides a method for detecting the moisture content of cut tobacco. To better understand the process of the above method for detecting the moisture content of cut tobacco, in combination with Figure 2 asFigure 3 As shown below, a specific process of the tobacco moisture content detection method of this application is elaborated in detail, including the following steps:
[0099] Step S302: Start the conveyor belt and place the tobacco to be tested.
[0100] Step S304: Start the array halogen lamp, hyperspectral imager, reflective microwave radar moisture sensor, temperature and humidity sensor, and stepper control rod.
[0101] Step S306: The hyperspectral imager and the reflective microwave radar moisture sensor move to the preset sample area to obtain spectral images, tobacco coordinates, and the total moisture content of the tobacco to be tested within the target area.
[0102] Among them, through the movement of the hyperspectral imager and the reflective microwave radar moisture sensor carried on the stepper control rod, the coordinates of the tobacco to be tested are calculated according to the image, so that the imaging range of the hyperspectral imager covers the preset sample area, and the reflective microwave radar moisture sensor moves to the central area of the target area; the reflective microwave radar moisture sensor obtains the difference data between the moisture echo and the transmitted signal energy of the target area; the temperature and humidity sensor synchronously collects the ambient temperature and humidity data, and the data is fused and analyzed by the AI chip, and combined with the standard moisture calibration curve, the total moisture content of the tobacco to be tested is obtained.
[0103] Step S308: Perform threshold segmentation and spectral extraction on the hyperspectral image to obtain average spectral data.
[0104] Among them, the hyperspectral imager collects the hyperspectral image data of the target area; the AI chip performs threshold segmentation on the hyperspectral image, identifies the effective coverage area of the tobacco, extracts the pixel point spectra within the coverage area, and calculates the average spectral data as the representative spectral data of this area.
[0105] As an example, by preprocessing the hyperspectral image, the pixel points of the tobacco to be tested in the hyperspectral image are extracted, and using image processing algorithms, according to the spectral feature differences between the tobacco to be tested and the conveyor belt background, the tobacco to be tested is separated from its background, a suitable threshold is set to form a mask, and the image is processed to separate the tobacco area from the background to form a binary image. After successfully segmenting the area corresponding to the tobacco to be tested, further spectral extraction is performed on the hyperspectral image (spectral image) of this area. Each pixel point in the area corresponding to the tobacco to be tested will have multi-dimensional spectral data, which includes the reflectance values of different bands, and the spectral characteristics of all pixel points in all bands are extracted for a single tobacco to be tested.
[0106] Step S310: Build a prediction model based on the total moisture content and the average spectral data.
[0107] Among them, the information of the sample spectral image is in one-to-one correspondence with the information of the total moisture; based on the obtained average spectral data and the total moisture content, a prediction model is established using the least squares support vector machine (LS-SVM) method.
[0108] As an example, the spectral features of all pixel points of a single sample can be summarized, the average spectral data of the corresponding area of the cut tobacco to be measured can be calculated, and the average spectral data can be paired with the known moisture content data corrected by the microwave moisture sensor and temperature and humidity. A regression model based on the least squares support vector machine (LSSVM) is constructed using the paired data. The LSSVM model can train a model (prediction model) by learning the relationship between the input spectral features and the moisture content. This model can predict the moisture content according to the input spectral data.
[0109] Step S312, based on the prediction model, predict the moisture content of the cut tobacco to be measured, and at the same time output a visualization map of the moisture content distribution through the display.
[0110] Among them, by combining the spectral information of each pixel point in the hyperspectral image, the moisture content corresponding to each pixel point is predicted point by point through the moisture prediction model, a visualization map of the moisture content distribution of the cut tobacco sample is generated, and it is transmitted to the output port in real time for display. The new data can be automatically added to the training set of the prediction model, and the AI chip is used to update and optimize the moisture prediction model to improve the prediction accuracy and stability.
[0111] As an example, by using the trained LSSVM model, the spectral features (spectral data) of the pixel points of the corresponding area of the cut tobacco to be measured are input into the model for prediction. The LSSVM model outputs the moisture content value of each pixel point according to the input spectral information, and the moisture content of the entire cut tobacco area can be predicted pixel by pixel, forming a visualization map of the moisture content distribution.
[0112] Among them, the visualization map of the moisture content distribution is obtained by mapping the moisture content value of each pixel point predicted by the LSSVM model to the corresponding position of the image. This map will show the moisture distribution in each area of the cut tobacco to be measured, helping the operator to visually observe the moisture content differences in different areas and providing a basis for subsequent quality control.
[0113] Through the above embodiments, by integrating hyperspectral imaging and a reflective microwave moisture sensor, multimodal detection of the moisture content of cut tobacco is achieved, and the detection accuracy is improved by combining temperature and humidity compensation; data processing and real-time calculation are performed by an AI chip to generate a visualization map of the moisture content distribution, intuitively showing the moisture distribution, supporting dynamic monitoring and real-time display, effectively improving the detection efficiency and result reliability; data acquisition, calculation, and output can be implemented on a hardware platform, or the data can be transmitted to a remote server for calculation and analysis by copying or through the Internet; in addition, the accuracy of the prediction model can be ensured by data adaptive update.
[0114] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily have to be executed at the same moment, but can be executed at different moments. The execution order of these steps or stages does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0115] Based on the same inventive concept, an embodiment of the present application also provides a cut tobacco moisture content detection device for implementing the cut tobacco moisture content detection method involved above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the cut tobacco moisture content detection device provided below can refer to the limitations on the cut tobacco moisture content detection method in the above text, and will not be repeated here.
[0116] In an exemplary embodiment, as Figure 4 shown, a cut tobacco moisture content detection device is provided, including: a coordinate determination module 401, a target area determination module 402, a control module 403, a data acquisition module 404, and a data processing module 405, where:
[0117] The coordinate determination module 401 is configured to obtain an imaging image of the cut tobacco to be measured within a preset sample area, and determine the cut tobacco coordinates of the cut tobacco to be measured according to the imaging image; the preset sample area represents an area including all the cut tobacco to be measured.
[0118] The target area determination module 402 is configured to determine the target area of the cut tobacco to be measured within the preset sample area based on the cut tobacco coordinates.
[0119] The control module 403 is used to control the imaging range of the hyperspectral imager to cover the target area and control the reflective microwave radar moisture sensor to move to the center of the target area.
[0120] The data acquisition module 404 is used to obtain the total moisture content of the to-be-detected cut tobacco in the target area based on the reflective microwave radar moisture sensor.
[0121] The data acquisition module 404 is also used to obtain the average spectral data of the target area based on the hyperspectral imager.
[0122] The data processing module 405 is used to establish a prediction model based on the total moisture content and the average spectral data for obtaining a visualization map of the moisture content distribution of the to-be-detected cut tobacco in the target area.
[0123] Further, in one embodiment, the data acquisition module 404 is also used to obtain the difference data between the moisture echo signal and the transmitted signal corresponding to the target area based on the reflective microwave radar moisture sensor; collect the temperature and humidity data of the target area based on the temperature and humidity sensor; and obtain the total moisture content of the to-be-detected cut tobacco in the target area based on the preset moisture calibration curve, the difference data, and the temperature and humidity data.
[0124] Further, in one embodiment, the data acquisition module 404 is also used to obtain the spectral image data of the target area based on the hyperspectral imager; perform threshold segmentation on the spectral image data based on a preset threshold to obtain the pixel spectra of each pixel point of the to-be-detected cut tobacco in the target area; and obtain the average spectral data of the target area based on the multiple pixel spectra.
[0125] Further, in one embodiment, the data processing module 405 is also used to establish a prediction model based on the total moisture content and the average spectral data, and obtain the spectral data of each pixel point in the spectral image data, so as to perform point-by-point prediction on the moisture content corresponding to each pixel point through the prediction model to obtain a prediction result; and generate a visualization map of the moisture content distribution of the to-be-detected cut tobacco sample based on the prediction result.
[0126] Further, in one embodiment, the data processing module 405 is also used to obtain the imaging images of the to-be-detected cut tobacco and the reference object of the to-be-detected cut tobacco in a preset sample area based on the hyperspectral imager; obtain the difference data of the color and / or reflectivity between the to-be-detected cut tobacco and the reference object based on the imaging images; and obtain the cut tobacco coordinates of the to-be-detected cut tobacco in the preset sample area based on the difference data.
[0127] Each module in the above tobacco shred moisture content detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or stored in the memory of the computer device in software form so that the processor can call and execute the operations corresponding to each of the above modules.
[0128] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 5 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store tobacco shred moisture content detection data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a method for detecting the moisture content of tobacco shreds.
[0129] Those skilled in the art can understand that Figure 5 the structure shown in
[0130] is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0131] In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps in the above method embodiments.
[0132] In an embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, it implements the steps in the above method embodiments.
[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0134] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memories can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., and are not limited thereto.
[0135] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0136] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for detecting the moisture content of cut tobacco, characterized in that, The method includes: Obtaining an imaging image of the cut tobacco to be measured within a preset sample area, and determining the cut tobacco coordinates of the cut tobacco to be measured according to the imaging image; the preset sample area represents an area including all the cut tobacco to be measured; Based on the cut tobacco coordinates, determining a target area of the cut tobacco to be measured within the preset sample area; Controlling the imaging range of the hyperspectral imager to cover the target area, and controlling the reflective microwave radar moisture sensor to move to the center of the target area; Based on the reflective microwave radar moisture sensor, obtaining the total moisture content of the cut tobacco to be measured within the target area; Based on the hyperspectral imager, obtaining the average spectral data of the target area; Based on the total moisture content and the average spectral data, establishing a prediction model for obtaining a visualization map of the moisture content distribution of the cut tobacco to be measured within the target area.
2. The method according to claim 1, wherein The obtaining the total moisture content of the cut tobacco to be measured within the target area based on the reflective microwave radar moisture sensor includes: Based on the reflective microwave radar moisture sensor, obtaining the difference data between the moisture echo signal and the transmitted signal corresponding to the target area; Collecting the temperature and humidity data of the target area based on a temperature and humidity sensor; Based on a preset moisture calibration curve, the difference data, and the temperature and humidity data, obtaining the total moisture content of the cut tobacco to be measured within the target area.
3. The method according to claim 2, wherein The obtaining the average spectral data of the target area based on the hyperspectral imager includes: Based on the hyperspectral imager, obtaining spectral image data of the target area; Performing threshold segmentation on the spectral image data based on a preset threshold to obtain the pixel point spectrum of each pixel point of the cut tobacco to be measured within the target area; Based on multiple pixel point spectra, obtaining the average spectral data of the target area.
4. The method according to claim 3, wherein The establishing a prediction model based on the total moisture content and the average spectral data for obtaining a visualization map of the moisture content distribution of the cut tobacco to be measured within the target area includes: Establishing a prediction model based on the total moisture content and the average spectral data, and obtaining the spectral data of each pixel point in the spectral image data, so as to perform point-by-point prediction on the moisture content corresponding to each pixel point through the prediction model to obtain a prediction result; Generating a visualization map of the moisture content distribution of the cut tobacco sample to be measured based on the prediction result.
5. The method according to claim 4, wherein The obtaining an imaging image of the cut tobacco to be measured within a preset sample area and determining the cut tobacco coordinates of the cut tobacco to be measured according to the imaging image includes: Based on the hyperspectral imager, obtaining an imaging image of the cut tobacco to be measured and a reference object of the cut tobacco to be measured within the preset sample area; Based on the imaging image, obtaining the difference data between the color and / or reflectivity of the cut tobacco to be measured and the reference object; Based on the difference data, obtaining the cut tobacco coordinates of the cut tobacco to be measured within the preset sample area.
6. The method according to claim 1, wherein The method further includes: obtaining a spectral image of the cut tobacco to be measured within the preset sample area, inputting spectral data corresponding to the spectral image into a training set of the prediction model, and updating the prediction model.
7. A tobacco moisture content detection device, characterized in that, The apparatus includes: a coordinate determination module, configured to obtain an imaging image of the cut tobacco to be measured within the preset sample area, and determine the cut tobacco coordinates of the cut tobacco to be measured according to the imaging image; the preset sample area represents an area including all the cut tobacco to be measured; a target area determination module, configured to determine a target area of the cut tobacco to be measured within the preset sample area based on the cut tobacco coordinates; a control module, configured to control the imaging range of a hyperspectral imager to cover the target area, and control a reflection type microwave radar moisture sensor to move to the center of the target area; a data acquisition module, configured to obtain the total moisture content of the cut tobacco to be measured within the target area based on the reflection type microwave radar moisture sensor; the data acquisition module is further configured to obtain average spectral data of the target area based on the hyperspectral imager; a data processing module, configured to establish a prediction model based on the total moisture content and the average spectral data for obtaining a visualization graph of the moisture content distribution of the cut tobacco to be measured within the target area.
8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.