Detailed Description
The details of the invention will be more clearly understood in conjunction with the accompanying drawings and description of specific embodiments of the invention. The specific embodiments of the invention described herein are for purposes of illustration only and are not to be construed as limiting the invention in any way. Given the teachings of the present invention, one of ordinary skill in the related art will contemplate any possible modification based on the present invention, and such should be considered to be within the scope of the present invention.
It will be understood that when an element is referred to as being "mounted" or "disposed" on another element, it can be directly on the other element or intervening elements may be present. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or intervening elements may be present.
The invention provides a method for identifying the slight green of flue-cured tobacco leaves, as shown in figure 1, which comprises the steps of collecting original spectrum images of the tobacco leaves to be identified (as shown in figures 2 and 4), preprocessing the original spectrum images to obtain preprocessed spectrum information, obtaining spectrum curves of pixels on the leaf surfaces of the tobacco leaves to be identified through the spectrum information, calculating the curvature radius of the spectrum curves of the pixels, extracting corresponding pixels according to the curvature radius and displaying the pixels as green smoke areas (as shown in figures 3 and 5).
The invention also provides a device for identifying the slight green of the flue-cured tobacco leaves, which comprises:
The identification unit is used for acquiring an original spectrum image of the tobacco leaves to be identified;
The preprocessing unit is used for preprocessing the original spectrum image and obtaining processed spectrum information;
the calculating unit is used for obtaining the spectrum curve of each pixel according to the spectrum information and calculating the curvature radius of the spectrum curve of each pixel;
And the output unit extracts corresponding pixels according to the curvature radius and displays the pixels as a green smoke area.
The method and the device for identifying the slight green of the flue-cured tobacco leaf can be used for rapidly identifying the slight green part in the tobacco leaf and can be used for rapidly identifying the green distribution in the tobacco leaf on line, thereby avoiding the loss caused by artificial factors, greatly solving the personnel consumption, increasing the selective use width of industry and reducing the difficulty of industrial formulation.
According to the method and the device for identifying the slight green of the flue-cured tobacco leaf, provided by the invention, the on-line rapid identification of the slight green part in the tobacco leaf is realized by calculating the curvature radius of part of each pixel spectral curve in the tobacco leaf spectral image and extracting the distribution of the green tobacco region according to the curvature radius in each pixel.
Meanwhile, the curvature radius is a main method for measuring the bending degree of the curve, the curvature radius can be better attached to the curvature radius of the characteristic peak, the curvature radius is measured, priori learning knowledge is not needed, the trouble of manually marking data is avoided, and the quick identification can be automatically carried out.
In an alternative example of the present invention, the identification unit is a hyperspectral imager, and the raw spectral image is acquired by the hyperspectral imager.
The hyperspectral imager can adopt the prior art, can obtain tens to hundreds of wave bands of images in a narrower wave band range by measuring the energy of the radiation emitted or reflected by a sample, can realize the classification and detection of objects, organically combines the traditional two-dimensional imaging technology and the spectrum technology, has spectrum analysis and image processing capability, has higher spectrum resolution and can obtain rich information. The hyperspectral imager is used for acquiring detailed spectral characteristic information and external characteristic information of a sample, so that the measured substance can be evaluated with higher accuracy and stronger comprehensiveness.
In an alternative example of the invention, the model number of the hyperspectral imaging spectrometer is GAIAFIELD-V10E-AZ4, and further the identification unit also comprises a CCD camera, 4 halogen lamps with the power supply of 50W and an electric displacement control platform.
When the original image is acquired, firstly, a sample (tobacco leaf) to be detected is placed on an electric displacement control platform, then, the movement of the electric displacement control platform and the acquisition of hyperspectral images are controlled through a computing unit, and finally, the acquired hyperspectral image data are transmitted to the computing unit (computer) for storage.
In an alternative example, when the hyperspectral imager is used for collecting original spectrum images of tobacco leaves, the tobacco leaves are fully unfolded and placed on an objective table of the hyperspectral imager manually, the map information of the front and the back of the tobacco leaves is collected respectively, and the map information is stored in a preprocessing unit or a computing unit according to digital numbers.
In an alternative embodiment of the invention, the preprocessing process includes data correction of the raw map information using standard black and white plate correction formulas.
The standard black-and-white plate correction formula is:
In the formula, a standard white correction plate obtains a full-white calibration image W, a full-black calibration image B is obtained by scanning a built-in blackboard, an original image I is subjected to correction processing, and the preprocessed map data is R.
Specifically, before the sample to be measured is collected, a standard white correction plate and a built-in blackboard are required to be collected for correcting the collected hyperspectral image, so as to eliminate the influence of instrument noise. W is a standard white correction plate to obtain a full white calibration image, the white plate is moved below a camera to collect and store a hyperspectral image, B is a full black calibration image obtained by scanning a built-in blackboard, a camera lens is covered by a camera cover to collect and store the full black hyperspectral image, I is a sample to be detected and is obtained by collecting the sample on an electric displacement control platform, and R is a spectrum image which is obtained by correcting the black and white plate and is used for eliminating instrument noise and smoothing.
In an optional embodiment of the invention, obtaining the spectrum value of each pixel of the leaf surface of the tobacco leaf to be identified through the pretreated spectrum information comprises the steps of converting the pretreated spectrum information into single-band spectrum data, dividing the single-band spectrum data into tobacco leaf information and background information, dividing the tobacco leaf information into leaf surface information, leaf stalk information and fold information, marking the leaf surface information as an induction area, correcting the spectrum of an interested area, intercepting the leaf surface information in a preset wave band range, and calculating the curvature radius of a spectrum curve of each pixel in the leaf surface information one by one.
In an alternative example of this embodiment, spectrum information with a band of 675.4nm in the pre-processed spectrum information is selected to be converted into binary single-band spectrum data.
In an alternative example of this embodiment, the global thresholding is used to segment the tobacco leaf and background information, and then the leaf surface, leaf stalk and fold information is segmented by the local thresholding, marking the leaf surface portion as the region of interest.
The threshold segmentation method of the image has the characteristics of intuitiveness and easiness in implementation, and plays an important role in image segmentation application. Specifically, the image f (m, n) is composed of two types of regions having different gray levels, i.e., dark objects and bright objects. The bright and dark portions of such an image can be clearly distinguished in the histogram, so a threshold can be selected for distinguishing between bright and dark peaks. Threshold segmentation can be seen as a functional operation:
T=T[m,n,p(m,n),f(m,n)];
Wherein m and n represent the abscissa p (m, n) of the pixel, f (m, n) represents the gray value of the pixel, and the thresholded image is defined as:
wherein the pixel with gray scale labeled 1 corresponds to the object of interest, the pixel labeled 0 corresponds to the background, and there are:
1. if T depends only on f (m, n), the threshold is global;
2. If T depends on f (m, n) and p (m, n), the threshold is local;
3. if T depends on the coordinates (m, n), the threshold is adaptive.
In the above process, the global threshold may be understood as counting the histogram of the whole image, then dividing all pixels in the image by selecting a certain threshold, the local threshold is dividing the image into set small blocks, counting the histogram in the small blocks, selecting a certain threshold, dividing the pixels in the small blocks, and the local threshold dividing is finer.
In an alternative example of this embodiment, the radius of curvature calculation uses the formula:
In the formula, X is a spectral band value, and y is the reflectivity of the corresponding spectral band value.
In an alternative example, the spectrum of the region of interest is corrected by a multi-element scattering correction method, then the curvature radius of the spectrum curve of each pixel is calculated one by one in the 600nm-700nm band range.
The multi-element scattering correction method can effectively eliminate spectrum differences caused by different scattering levels through the baseline translation and offset phenomenon of spectrum data corrected by the average spectrum, thereby enhancing the correlation between the spectrum and the data.
The method comprises (1) obtaining average value of all spectrum data, (2) subjecting spectrum of each sample and average spectrum to unitary linear regression, solving least square problem to obtain baseline shift and offset of each sample, and (3) correcting spectrum of each sample by subtracting the obtained baseline shift and dividing by offset to obtain corrected spectrum
In an optional embodiment of the invention, the extraction process of the green smoke region according to each curvature radius comprises the steps of sequencing the pixels according to the curvature radius from low to high, then normalizing the curvature radius, and setting thermodynamic diagram to display green smoke distribution of leaf surfaces by adopting dividing points as indexes.
The normalization process is to convert the data into decimal of the (0, 1) interval and change the dimensionality expression into non-dimensionality expression to solve the comparability of the data.
In an alternative example of this embodiment, the radius of curvature of each of the sorted pixels is divided into four equal parts by a quantile method, and the equal parts respectively occupy 10%,20% and 30% of the radius of curvature according to the numerical value, which are used as quantiles for green smoke identification. Other percentages may also be used in the quantile method. The selection of the dividing points is different, the displayed green smoke distribution effect is different, the display areas with different green degrees can be understood, if the set dividing points are large, the green areas are displayed more completely, partial misidentification can exist, if the set dividing points are small, the green areas are displayed as areas with larger green degrees, in the embodiment, the selected dividing points are divided by reference according to the standard of the flue-cured tobacco GB 2635-92, and finally, the pixel areas with smaller values than the set dividing points are displayed.
In an alternative embodiment of the invention, the method of authentication further comprises preparing the tobacco leaves to be authenticated, and placing the tobacco leaf sample in an environment of 70% relative humidity and 25 ℃ for 48 hours to form the tobacco leaves to be authenticated.
The detailed explanation of the embodiments described above is only for the purpose of explaining the present invention so as to enable a better understanding of the present invention, but these descriptions should not be construed as limiting the present invention in any way, and in particular, the individual features described in the different embodiments may be arbitrarily combined with each other to constitute other embodiments, and these features should be understood as being applicable to any one embodiment, except as explicitly stated to the contrary, without being limited to only the described embodiment.