A system and method for measuring flower moisture based on image data
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YUNNAN HUAWU TECHNOLOGY CO LTD
- Filing Date
- 2026-03-19
- Publication Date
- 2026-05-26
Smart Images

Figure CN121877772B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flower moisture measurement technology, and more specifically, to a flower moisture measurement system and method based on image data. Background Technology
[0002] The moisture state of flowers is a crucial indicator for their production, processing, logistics, and preservation. Moisture measurement results influence flower grading, preservation strategies, and processing technology selection. With the development of large-scale flower production, online non-contact moisture measurement technology has become an industry necessity. Hyperspectral imaging technology, due to its high spectral resolution and ability to simultaneously acquire spatial and spectral information, has become the mainstream technology for non-contact moisture measurement in flowers. Its core principle is to quantify moisture by extracting the spectral characteristics of water molecule absorption bands, thus meeting the automated detection needs of flower production lines.
[0003] In the logistics and processing of flowers, plastic sleeves are often used for packaging to protect the flowers. This packaging method is prone to film wrinkling and surface reflection during transportation and stacking on the production line. This results in plastic subspaces and mixed pixels in hyperspectral imaging, as a single pixel observation simultaneously includes signals from petals, film transmission and reflection, and highlights. Existing hyperspectral moisture measurement technologies often first hard segment the target area of the flower before calculating the moisture index. However, the wrinkles and reflections of the sleeves cause the boundary of the target area to drift, and the proportion of mixed pixels within the target area changes randomly, resulting in extremely poor stability of the target area and directly causing irregular fluctuations in the moisture measurement results.
[0004] Conventional flower moisture indices are mostly constructed directly based on the ratio or difference of reflectance. They are highly sensitive to the multiplicative spectral envelope formed by thin film transmission and the additive interference formed by specular highlights. Highlights can easily fill the spectral depression of the water molecule absorption band, and the thin film envelope will distort the original shape of the spectrum. Moreover, existing technologies do not perform targeted geometric extraction and interference removal of spectral features. At the same time, the interference from equipment and light sources mixed in the original hyperspectral data has not been effectively eliminated, which further aggravates the error of moisture feature extraction. This makes it difficult to guarantee the consistency of the measurement results and makes it difficult to meet the online detection requirements of flower production lines. Summary of the Invention
[0005] This invention provides a system and method for measuring the moisture content of flowers based on image data, thereby solving the technical problems mentioned in the background section.
[0006] This invention provides a flower moisture measurement system based on image data, comprising:
[0007] The first module involves acquiring raw hyperspectral images of flowers and using dark-field and white-board references to perform radiometric calibration on the raw hyperspectral images to obtain reflectance.
[0008] The second module converts the reflectivity to the logarithmic domain and applies second-order regular smoothing along the wavelength direction to generate a smoothed logarithmic spectrum.
[0009] The third module calculates the discrete second-order curvature of the smoothed logarithmic spectrum at different wavelength positions;
[0010] The fourth module extracts the discrete second-order curvature at the endpoint of the water absorption zone and interpolates it to generate a curvature baseline. The curvature residual is obtained by subtracting the curvature baseline from the discrete second-order curvature.
[0011] The fifth module performs a normalized integral on the curvature residual within the water absorption zone to generate a logarithmic spectrum of the water absorption curvature residual.
[0012] The sixth module extracts the reciprocal of the standard deviation of the logarithmic spectrum water absorption curvature residual of the whole image as the weighting weight, and combines the logarithmic spectrum water absorption curvature residual of different water absorption band intervals with the weighting weight to generate a single pixel driving amount.
[0013] The seventh module performs exponential mapping and global normalization on the single-pixel driving quantity to generate a soft weight field, and uses the soft weight field to perform weighted summation on the single-pixel driving quantity of the whole image to generate a single-value convergence quantity.
[0014] The eighth module uses quadratic polynomial calibration coefficients to perform polynomial mapping calculations on the individual aggregates, generating and outputting individual moisture estimation results.
[0015] This invention provides a method for determining the moisture content of flowers based on image data, comprising the following steps:
[0016] Step S101: Acquire the original hyperspectral image of the flower, and use the dark field reference and white board reference to perform radiometric calibration on the original hyperspectral image to obtain the reflectance;
[0017] Step S102: Convert the reflectance to the logarithmic domain and apply second-order regular smoothing along the wavelength direction to generate a smoothed logarithmic spectrum;
[0018] Step S103: Calculate the discrete second-order curvature of the smoothed logarithmic spectrum at different wavelength positions;
[0019] Step S104: Within the water absorption zone, extract the discrete second-order curvature at the endpoint of the water absorption zone and interpolate to generate a curvature baseline. Subtract the curvature baseline from the discrete second-order curvature to obtain the curvature residual.
[0020] Step S105: Perform normalized integration on the curvature residual within the water absorption band interval to generate a logarithmic spectrum water absorption curvature residual.
[0021] Step S106: Extract the reciprocal of the standard deviation of the logarithmic spectrum water absorption curvature residual of the whole image as the weighting weight, and combine the logarithmic spectrum water absorption curvature residual of different water absorption band intervals with the weighting weight to generate a single pixel driving amount.
[0022] Step S107: Perform exponential mapping and global normalization on the single-pixel driving quantity to generate a soft weight field, and use the soft weight field to perform weighted summation on the single-pixel driving quantity of the whole image to generate a single-value convergence quantity.
[0023] Step S108: Use the quadratic polynomial calibration coefficients to perform polynomial mapping calculation on the single-valued aggregation amount, generate the single-valued moisture estimation result and output it.
[0024] The beneficial effects of this invention are as follows: Addressing the non-contact moisture measurement needs in flower sleeve packaging scenarios, this invention transforms the multiplicative envelope of film transmission into an additive term through logarithmic spectral transformation. Combined with second-order regularized smoothing to suppress noise, and further through discrete second-order curvature calculation and curvature residual extraction, it eliminates non-moisture interference caused by sleeve wrinkles and reflections, retaining only moisture-related spectral geometric features. Through adaptive weighted fusion of multi-water absorption band features, it integrates multi-band moisture information, reducing the interference of single bands. Simultaneously, it replaces traditional hard segmentation of the flower target area with a soft weighted field, allowing the contribution of pixels in moisture estimation to be naturally distributed according to the reliability of their own moisture features, avoiding result fluctuations caused by the drift of the flower target area boundary. The end-to-end spectral feature processing and moisture estimation logic improves the consistency of measurement results, adapting to the automated online detection cycle of flower production lines. The non-contact detection method does not cause physical damage to the flowers, and the measurement results can directly provide reliable data support for moisture detection and grading in all stages of flower production, processing, and logistics. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the calculation process of the present invention;
[0026] Figure 2 This is a schematic diagram of the computing scenario of the present invention;
[0027] Figure 3 This is a comparison chart of the output results of the present invention. Detailed Implementation
[0028] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.
[0029] It should be noted that, unless otherwise defined, the technical or scientific terms used in one or more embodiments of the present invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in one or more embodiments of the present invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" indicate that the element or object preceding the term encompasses the elements or objects listed following the term and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0030] like Figures 1-3 As shown, a flower moisture measurement system based on image data includes:
[0031] The first module involves acquiring raw hyperspectral images of flowers and using dark-field and white-board references to perform radiometric calibration on the raw hyperspectral images to obtain reflectance.
[0032] The second module converts the reflectivity to the logarithmic domain and applies second-order regular smoothing along the wavelength direction to generate a smoothed logarithmic spectrum.
[0033] The third module calculates the discrete second-order curvature of the smoothed logarithmic spectrum at different wavelength positions;
[0034] The fourth module extracts the discrete second-order curvature at the endpoint of the water absorption zone and interpolates it to generate a curvature baseline. The curvature residual is obtained by subtracting the curvature baseline from the discrete second-order curvature.
[0035] The fifth module performs a normalized integral on the curvature residual within the water absorption zone to generate a logarithmic spectrum of the water absorption curvature residual.
[0036] The sixth module extracts the reciprocal of the standard deviation of the logarithmic spectrum water absorption curvature residual of the whole image as the weighting weight, and combines the logarithmic spectrum water absorption curvature residual of different water absorption band intervals with the weighting weight to generate a single pixel driving amount.
[0037] The seventh module performs exponential mapping and global normalization on the single-pixel driving quantity to generate a soft weight field, and uses the soft weight field to perform weighted summation on the single-pixel driving quantity of the whole image to generate a single-value convergence quantity.
[0038] The eighth module uses quadratic polynomial calibration coefficients to perform polynomial mapping calculations on the individual aggregates, generating and outputting individual moisture estimation results.
[0039] In one embodiment of the present invention, the original hyperspectral image of the flower is acquired, and the reflectance is obtained by radiometric calibration of the original hyperspectral image using a dark-field reference and a white-plate reference, including:
[0040] Obtain coordinates in image space With wavelength Original hyperspectral image of the flower at location ;
[0041] Obtain at wavelength Dark field reference of location ;
[0042] Obtain at wavelength Whiteboard reference for location ;
[0043] Using raw hyperspectral images of flowers Dark Field Reference With whiteboard reference Reflectivity is obtained by performing radiometric calibration. The calculation formula is as follows:
[0044]
[0045] in Image spatial coordinates, For wavelength, In image space coordinates With wavelength Original hyperspectral intensity data of flowers at location To be at wavelength Dark-field reference intensity data for the location. To be at wavelength Reference strength data for the location of the whiteboard. In image space coordinates With wavelength Reflectivity of the location.
[0046] It should be noted that image spatial coordinates are the planar position identifiers of pixels in a hyperspectral image, reflecting the two-dimensional orientation of the pixel in the image. Wavelength position is the spectral dimension coordinate identifier of hyperspectral imaging, reflecting the specific position of the hyperspectral image in the spectral band. The raw hyperspectral image of a flower is the raw hyperspectral intensity data acquired from the flower target, reflecting the raw light intensity information of the flower at different wavelengths. It can be acquired on a flower production line using a hyperspectral camera combined with an industrial line scan imaging system, or statically acquired from a single flower using an area array hyperspectral imaging device. Dark-field reference is the light intensity data acquired by the hyperspectral imaging system under no-light conditions, reflecting background signals such as dark current readout noise of the imaging system. It can be obtained by completely blocking the lens of the hyperspectral imaging system and acquiring light intensity data under the same imaging parameters. Whiteboard reference is the hyperspectral light intensity data acquired from a standard diffuse reflectance whiteboard, reflecting the light source intensity and system response characteristics of the imaging system at different wavelengths. It can be obtained by pointing the hyperspectral imaging system at a standard polytetrafluoroethylene (PTFE) whiteboard with a diffuse reflectance greater than 99% and acquiring light intensity data under the same imaging parameters. Reflectivity is the proportion of incident light reflected by a flower at a specific wavelength, reflecting the spectral reflectance characteristics of the flower.
[0047] It should be noted that the conditions for obtaining the dark-field reference are as follows: All imaging parameters of the hyperspectral imaging system, including exposure time, gain, and focal length, must be completely consistent with the acquisition parameters of the original hyperspectral image of the flower. The imaging lens must be completely blocked, ensuring no light enters the imaging sensor. The acquisition standard is to continuously acquire 10 to 20 frames of light intensity data from the blocked system, calculate the average value of all frames at each wavelength, and use this average value as the final dark-field reference. The conditions for obtaining the whiteboard reference are as follows: All imaging parameters of the hyperspectral imaging system must be completely consistent with the acquisition parameters of the original hyperspectral image of the flower, ensuring the standard whiteboard fills the entire field of view of the imaging system, with no other objects appearing in the field of view. The acquisition standard is to use a metrologically certified standard diffuse reflection whiteboard, continuously acquire 5 to 10 frames of light intensity data, calculate the average value of all frames at each wavelength, and use this average value as the final whiteboard reference. The specific representation of the image spatial coordinates is a two-dimensional integer coordinate system, with the upper left corner of the hyperspectral image as the origin, the horizontal direction as column coordinates, and the vertical direction as row coordinates. In addition, the specific representation of wavelength position includes two forms: one is the actual value of the center wavelength of the band, in nanometers, such as 970 nanometers or 1450 nanometers; the other is the band index of the hyperspectral imaging system, which is a continuous integer, such as the 20th band or the 50th band. The two representation forms can be converted to each other.
[0048] It should be noted that the core of using dark-field and white-board references to perform radiometric calibration on the original hyperspectral images of flowers to obtain reflectance is to remove non-target influencing factors from the original hyperspectral images through background subtraction and system response normalization. The dark-field reference carries inherent background signals such as dark current readout noise of the imaging system itself. These signals are irrelevant to the flower target and need to be subtracted from the original data first. The white-board reference, as a standard diffuse reflector, has known uniform reflectance characteristics. Using its acquired data as a benchmark, the natural differences in light source intensity at different wavelengths and the inconsistencies in the response of the imaging system across different bands can be eliminated. This ensures that the reflectance obtained after processing is only related to the spectral reflectance characteristics of the flower target itself, rather than external factors such as equipment or light source. This invention accurately deducts the dark current and readout noise of the imaging system itself by acquiring a dark-field reference, eliminating background interference unrelated to the flower target. By acquiring a whiteboard reference, it normalizes the light source intensity and the band response of the camera lens at different wavelengths, allowing the reflectivity to truly reflect the spectral reflectance characteristics of the flower. At the same time, this radiometric calibration method is suitable for industrial imaging scenarios in flower production lines. The acquisition method is simple and reproducible, and the calibration process is consistent with the imaging parameters acquired from the flower, ensuring the consistency of the calibration results. This provides stable and reliable spectral basis data for subsequent spectral feature extraction steps such as logarithmic spectrum conversion and curvature calculation, preventing subsequent calculations of moisture-related features from being contaminated by non-target factors of equipment or light sources.
[0049] In one embodiment of the present invention, the reflectivity is converted to the logarithmic domain, and a second-order canonical smoothing is applied along the wavelength direction to generate a smoothed logarithmic spectrum, including:
[0050] reflectivity Transform to the logarithmic field to obtain the logarithmic spectrum Logarithmic spectrum Calculate using the following formula:
[0051]
[0052] in Image spatial coordinates, For wavelength, In image space coordinates With wavelength Reflectivity of location, A constant that is greater than zero;
[0053] Along wavelength Directional logarithmic spectrum Apply second-order regular smoothing to generate a smooth logarithmic spectrum For each fixed image space coordinate Logarithmic spectrum Along wavelength Direction forms spectral vector Smooth spectral vector Calculated using the following optimized formula:
[0054]
[0055] in To optimize the variable spectral vector, The regularization coefficient is greater than zero. For along wavelength The second-order difference matrix of the direction, It is a 2-norm;
[0056] The smooth spectral vector can be obtained using the following closed-form solution formula. :
[0057]
[0058] in It is the identity matrix. The transpose of the second-order difference matrix is used, and the smoothed spectral vector is used. The components correspond to the logarithmic spectrum of the backsmoothed spectrum. .
[0059] It should be noted that the logarithmic spectrum is the spectral data obtained by superimposing the constant of reflectance and performing a natural logarithmic operation, reflecting the spectral characteristics of reflectance after conversion to the logarithmic domain. Second-order regularized smoothing is a smoothing process performed on the logarithmic spectrum along the wavelength direction, reflecting the noise suppression and shape preservation characteristics of the logarithmic spectrum. The smoothed logarithmic spectrum is the spectral data obtained after second-order regularized smoothing of the logarithmic spectrum, reflecting the spectral characteristics in the logarithmic domain after denoising. The constant is a positive value superimposed on the reflectance to avoid meaningless logarithmic operations; it is preferably set to 10 to the power of -6. This value is extremely small and will not change the original characteristics of reflectance, and it effectively avoids the problem that natural logarithmic operations cannot be performed when the reflectance is 0. The spectral vector is a one-dimensional vector formed by arranging the logarithmic spectra of individual pixels sequentially along the wavelength direction, reflecting the full-band spectral characteristics of a single pixel in the logarithmic domain. The regularization coefficient is a positive-zero value used to adjust the degree of bias suppression and smoothing in second-order regularized smoothing. It reflects the control characteristics of the weights of the two terms in the objective function. A preferred value is 0.01 to 0.1, which balances the bias between the spectral vector and the original data with the smoothing effect of the spectrum, effectively suppressing high-frequency noise while preserving the geometric characteristics of the water absorption band. The second-order difference matrix is a matrix constructed along the wavelength direction for calculating the second-order difference of the spectrum, reflecting the second-order variation characteristics of the spectrum in the wavelength dimension. The objective function is an optimization function composed of a spectral vector bias term and a second-order difference energy penalty term, reflecting the optimization objective characteristics of second-order regularized smoothing. The smoothed spectral vector is the spectral vector obtained after minimizing the objective function, reflecting the logarithmic domain full-band spectral characteristics of a single pixel after smoothing. The identity matrix is a square matrix with diagonal elements of 1 and all other elements of 0, reflecting the baseline characteristics in matrix operations.
[0060] It should be noted that the specific implementation of second-order regularized smoothing is as follows: First, the logarithmic spectrum of each pixel is arranged into a spectral vector along the wavelength direction. Then, an objective function consisting of a spectral vector deviation term and a second-order difference energy penalty term is constructed. The smoothed spectral vector corresponding to the minimum value of the objective function is solved using a closed-form formula. Finally, the components of the smoothed spectral vector are restored to the smoothed logarithmic spectrum of that pixel in wavelength order. This process is completed pixel by pixel to achieve second-order regularized smoothing of the logarithmic spectrum of the entire image. The specific composition of the spectral vector along the wavelength direction is as follows: Based on the band order of hyperspectral imaging, the logarithmic spectral values of a single pixel at each wavelength position are arranged in ascending order of wavelength, forming a one-dimensional column vector. The dimension of the vector is consistent with the number of bands in hyperspectral imaging, and each vector element uniquely corresponds to the logarithmic spectral value at a wavelength position. The specific construction form of the second-order difference matrix is as follows: the matrix is a sparse matrix with the number of bands minus 2 rows of bands. Each row has only three non-zero elements, namely 1, -2, 1, with the positions of the non-zero elements shifting sequentially with the row number. All other elements are 0. Multiplying this matrix by the spectral vector yields the second-order difference result of the spectral vector. The specific method for mapping the components of the smoothed spectral vector back to the image space coordinates and wavelength positions is as follows: the element arrangement order of the smoothed spectral vector is kept consistent with the original spectral vector. Each element is mapped to the same image space coordinates and wavelength position of the original pixel in ascending order of wavelength, replacing the original logarithmic spectral values. After the elements of all bands are replaced, the smoothed logarithmic spectrum of the pixel at the corresponding coordinates and wavelength positions is generated.
[0061] It should be noted that performing a natural logarithmic operation on reflectance can transform it into the logarithmic domain. The core principle is that the property of the natural logarithm can convert the multiplicative effects in reflectance into additive effects. In the case of a flower sleeve scene, the multiplicative spectral envelope of the thin film transmitted light source intensity becomes an additive term, making it easier to separate in subsequent processing. Furthermore, the monotonicity of the natural logarithmic operation can completely preserve the spectral variation trend of reflectance without changing the relative characteristics of the water absorption band. Applying second-order regularized smoothing along the wavelength direction can smooth the logarithmic spectrum. The core principle is to achieve smoothing by penalizing the second-order difference energy of the spectrum. The second-order difference can accurately characterize the high-frequency noise of the spectrum, and penalizing it can suppress meaningless jitter between bands. At the same time, processing along the wavelength direction can ensure the dimensionality of the spectrum and not destroy the correspondence between pixels and the spectrum. The smoothed spectral vector can be obtained by minimizing the objective function consisting of the spectral vector deviation term and the second-order difference energy penalty term. The core principle is that the two terms of the objective function respectively constrain the deviation of the smoothed result from the original data and the degree of spectral smoothing. Minimizing this function allows the solved spectral vector to closely approximate the original logarithmic spectrum while achieving noise suppression, meeting the dual requirements of deviation and smoothing in spectral processing. Using the identity matrix, regularization coefficients, the second-order difference matrix, and its transpose, the smoothed spectral vector can be calculated through a closed-form formula. The core principle is that the closed-form formula transforms the optimization problem into direct matrix multiplication operations through matrix inverse operations, eliminating the need for iterative solutions, improving computational efficiency, adapting to the real-time processing requirements of flower production lines, and ensuring the accuracy of the smoothing results through the rigor of matrix operations.
[0062] It should be noted that this invention converts reflectance to the logarithmic domain to separate multiplicative interference in the sleeve scene. Simultaneously, second-order regularized smoothing suppresses noise in the logarithmic spectrum, generating a stable smooth logarithmic spectrum, providing a reliable spectral foundation for subsequent discrete second-order curvature calculations. By superimposing minimal constants to perform natural logarithmic operations, the multiplicative envelope of the thin-film transmitted light source intensity is transformed into an additive term, facilitating the subsequent removal of non-moisture-related spectral interference. Second-order regularized smoothing along the wavelength direction balances bias and smoothing effect through the objective function, suppressing high-frequency noise while preserving the geometric characteristics of the water absorption band, avoiding the problem of noise amplification from direct second-order difference. The direct solution method of the closed-form formula improves processing efficiency, adapting to the real-time requirements of the production line. The components of the smoothed spectral vector also ensure the accurate correspondence between spectral data and image spatial coordinates and wavelength positions, providing an accurate spectral foundation for subsequent pixel-level spectral feature extraction.
[0063] In one embodiment of the present invention, calculating the discrete second-order curvature of the smoothed logarithmic spectrum at different wavelength positions includes:
[0064] Obtain coordinates in image space With wavelength Smooth logarithmic spectrum of position ;
[0065] Along wavelength Direction at discrete wavelength position Calculate the smoothed logarithmic spectrum Discrete second-order curvature Discrete second-order curvature Calculate using the following formula:
[0066]
[0067] in Image spatial coordinates, For wavelength, For discrete wavelength positions, The wavelength interval between adjacent discrete wavelength positions. In image space coordinates With discrete wavelength position Smoothed logarithmic spectrum data at [location] In image space coordinates With discrete wavelength position Discrete second-order curvature at that point.
[0068] It should be noted that the discrete second-order curvature is a value obtained after calculating the smoothed logarithmic spectrum using discrete second-order differencing and normalizing the wavelength interval. It reflects the curvature of the smoothed logarithmic spectrum at discrete wavelength positions. Discrete wavelength positions are the wavelength coordinates corresponding to each band in hyperspectral imaging, reflecting the discrete sampling positions of the hyperspectral data in the spectral dimension. Discrete second-order differencing is the result of calculating the second-order difference of the smoothed logarithmic spectrum at adjacent discrete wavelength positions, reflecting the second-order rate of change of the smoothed logarithmic spectrum in the wavelength dimension. Wavelength interval is the wavelength difference between two adjacent discrete wavelength positions, reflecting the sampling interval of the hyperspectral data in the spectral dimension. The specific selection rules for discrete wavelength positions are as follows: the center wavelengths of all bands in the hyperspectral imaging system are selected as discrete wavelength positions, arranged in ascending order of wavelength, with the number of selected positions matching the number of bands in the hyperspectral imaging system. Only discrete wavelength positions within the effective spectral response range are retained, and invalid positions without spectral signals are discarded. The specific method for determining the wavelength interval is as follows: if the hyperspectral imaging is equidistant sampling, the wavelength interval is the difference between the center wavelengths of adjacent bands, which is a single constant; if it is non-equidistant sampling, the wavelength interval is the difference between the actual wavelength of each discrete wavelength position and its adjacent positions before and after it, which is a value that varies with position, and the actual wavelength interval of the corresponding position is taken during calculation.
[0069] It should be noted that performing discrete second-order difference calculations on the smooth logarithmic spectrum along the wavelength direction can characterize the second-order variation characteristics of the spectral curve in the wavelength dimension. The core is that the discrete second-order difference quantifies the concavity / convexity trend of the spectral curve at a certain wavelength position. The second-order difference is positive in the rising segment and negative in the falling segment. Extreme values of the second-order difference appear at concave or convex points. This characteristic can accurately capture the local bending changes of the spectral curve caused by water absorption bands, while the second-order difference value of the smooth envelope formed by thin film transmission is close to zero, enabling a preliminary distinction between the two types of characteristics. Normalizing the discrete second-order difference results using the wavelength interval between adjacent discrete wavelength positions allows for the calculation of discrete second-order curvature. The key point is that the value of the discrete second-order difference is affected by the spectral sampling interval. The difference results with different sampling intervals have no uniform dimension. Normalizing by the square of the wavelength interval ensures that the curvature obtained from data acquired by different hyperspectral imaging systems has comparable dimensions, guaranteeing the consistency of curvature calculation results. Discrete second-order curvature can characterize the curvature of a smooth logarithmic spectrum at discrete wavelengths. The core idea is that the magnitude of the curvature is positively correlated with the curvature of the spectral curve, and the positive or negative value corresponds to the concave or convex direction of the spectral curve. The water absorption band appears as a local concavity in the logarithmic spectrum, and a characteristic change in the discrete second-order curvature value will appear at the corresponding position. This change can be used as a geometric feature to characterize water absorption information.
[0070] It should be noted that this invention characterizes the curvature of the spectrum along the wavelength dimension by calculating the discrete second-order curvature of the smoothed logarithmic spectrum, extracting key physical quantities that can characterize the geometry of the water absorption band, and providing basic data for subsequent extraction of the water absorption band curvature baseline and residuals. Performing discrete second-order difference calculations along the wavelength direction accurately captures the second-order spectral changes caused by the concavity of the water absorption band, while eliminating the meaningless influence of the smooth envelope of the thin film. Normalization through wavelength intervals eliminates the influence of sampling intervals on the curvature results, ensuring the consistency of calculations across different imaging systems. The discrete calculation method adapts to the discrete band characteristics of hyperspectral imaging, enabling pixel-by-pixel and wavelength-by-wavelength calculations, fully preserving pixel-level spectral curvature features, and quantifying the water absorption-related geometric information of each pixel. This provides analyzable and comparable curvature data for subsequent feature extraction of the water absorption band, meeting the needs of pixel-level moisture information characterization in flower sleeve scenarios.
[0071] In one embodiment of the present invention, within the water absorption zone, the discrete second-order curvature at the endpoint of the water absorption zone is extracted and interpolated to generate a curvature baseline. The curvature residual is obtained by subtracting the curvature baseline from the discrete second-order curvature, including:
[0072] In the Determine the wavelength position of the left endpoint within the water absorption band interval. With the wavelength position of the right endpoint and from discrete second-order curvature Extracting coordinates in image space Discrete second-order curvature at the wavelength position corresponding to the left endpoint Discrete second-order curvature corresponding to the wavelength position at the right endpoint ;
[0073] In the Within a water absorption zone, using discrete second-order curvature With discrete second-order curvature Perform interpolation operations to generate curvature baselines The calculation formula is as follows:
[0074]
[0075] in For located in the interval Wavelength position within;
[0076] In the Within a water absorption zone, using discrete second-order curvature Subtract curvature baseline Calculate the curvature residual The calculation formula is as follows:
[0077]
[0078] in Image spatial coordinates, For wavelength, The wavelength position at the left endpoint. The wavelength position at the right endpoint. For discrete second-order curvature, As the curvature baseline, For curvature residuals.
[0079] It should be noted that the water absorption band is a specific wavelength range defined for extracting water-related curvature characteristics. It reflects a spectral range matching the absorption characteristics of water molecules, preferably ranging from 950 nm to 990 nm and from 1430 nm to 1470 nm. These two ranges are strong absorption bands for water molecules in the near-infrared band, accurately capturing the spectral response of water in flowers while avoiding strong absorption ranges of other flower components, reducing interference from non-water factors. The left endpoint wavelength position is the starting wavelength coordinate of the water absorption band, reflecting the spectral start position of the water absorption band. The right endpoint wavelength position is the ending wavelength coordinate of the water absorption band, reflecting the spectral end position of the water absorption band. The curvature baseline is a curvature reference curve generated by interpolating the curvature at the endpoints within the water absorption band, reflecting the smooth curvature change trend when there is no water absorption within the range. The curvature residual is the numerical difference between the discrete second-order curvature and the curvature baseline at the same position, reflecting the net change in local curvature caused only by water absorption.
[0080] It should be noted that the specific selection rules for the water absorption band interval are based on the characteristic absorption peaks of water molecules in the near-infrared band to determine the interval range. The interval must completely cover the spectral range of the absorption peaks, and the width of a single interval is controlled between 20 nm and 40 nm. The determination is based on a standard spectral database of near-infrared absorption of water molecules, combined with the effective spectral response range of hyperspectral imaging of flowers, eliminating invalid wavelength intervals where the imaging system has no spectral signal. The specific implementation of the interpolation process is to use linear interpolation, with the wavelength position as the abscissa and the discrete second-order curvature as the ordinate. Based on the wavelength positions of the left and right endpoints of the water absorption band interval and the corresponding discrete second-order curvature, a one-dimensional linear function is constructed. This function is used to calculate the baseline curvature value corresponding to each wavelength position within the interval. By subtracting the curvature baseline at the same position from the discrete second-order curvature, the curvature residual at the corresponding position can be calculated. The core is that the difference operation can remove the basic trend brought about by the smooth envelope in the discrete second-order curvature, retaining only the local curvature changes that deviate from this trend. These changes are caused by the concavity of the spectral curve due to water absorption, thus achieving the separation of water-related features from background interference. The curvature baseline characterizes the smooth curvature change trend within the water absorption zone when there are no absorption depressions. The core principle is that the baseline is generated by interpolating the actual curvature at the endpoints of the zone, without introducing additional assumptions. It closely matches the smooth curvature distribution formed by factors such as film transmission and light source changes in a flower sleeve scenario, serving as a reasonable reference for judging curvature changes caused by water absorption. The curvature residual can peel away the curvature trend brought about by the smooth envelope, retaining the local curvature changes caused by water absorption. The core principle is that the curvature change of the smooth envelope has been completely fitted by the curvature baseline, and the residual only contains curvature fluctuations exceeding this trend. Depressions in the water absorption zone cause local curvature to deviate significantly from the baseline, and these fluctuations are completely preserved in the residual.
[0081] It should be noted that this invention generates a curvature baseline that fits the smooth background trend within the wavelength range of water molecule characteristic absorption. This eliminates curvature interference caused by non-moisture factors such as film transmission and light source variations, extracting only the curvature residual caused by water absorption, providing crucial data for subsequent quantification of moisture characteristics. The selected water absorption band range matches the strong near-infrared absorption characteristics of water molecules, focusing on moisture-related spectral changes and reducing interference from other components of the flower. The linear interpolation method for generating the curvature baseline fits the smooth curvature trend of the sleeve scene, accurately eliminating the influence of non-moisture factors. The curvature residual retains only the local curvature changes caused by water absorption, making the features more closely match the actual moisture state of the flower. The pixel-by-pixel, wavelength-by-wavelength calculation method fully preserves pixel-level moisture-related curvature features, meeting the needs of pixel-level analysis in sleeve scenes.
[0082] In one embodiment of the present invention, a normalized integral is performed on the curvature residual within the water absorption band region to generate a logarithmic spectrum water absorption curvature residual, including:
[0083] In the Each water absorption zone Internal Determined Band Set ,in The wavelength position at the left endpoint. Let be the wavelength position at the right endpoint, and let... Band set The number of elements, band set Corresponding to the position in the Discrete wavelength positions within each water absorption band interval ;
[0084] Utilizing curvature residuals In the Within each water absorption zone, normalized integral calculations are performed to generate the logarithmic spectrum water absorption curvature residual. The calculation formula is as follows:
[0085]
[0086] in Image spatial coordinates, This refers to the water absorption zone interval number. For discrete wavelength positions, For band set, The number of elements in the band set. In image space coordinates With discrete wavelength position Curvature residual at the point, In image space coordinates The logarithmic spectrum water absorption curvature residual generated at that location.
[0087] It should be noted that the band set is a collection of band indices corresponding to all discrete wavelength positions within the water absorption band interval, reflecting the effective band range within the water absorption band interval. The number of elements is the number of band indices included in the band set, reflecting the total number of effective bands within the water absorption band interval. The logarithmic spectral water absorption curvature residual is a scalar obtained by summing the curvature residuals and normalizing them with the number of elements, reflecting the overall water-related curvature characteristics of a single pixel within the water absorption band interval. The band set is specifically determined by matching all discrete wavelength positions of the hyperspectral imaging system with the wavelength positions at the left and right endpoints of the water absorption band interval, and selecting all bands whose wavelength values fall within this interval. The selection rule is to retain only bands with effective spectral signals from the imaging system, and to remove invalid bands with no signal or excessive noise. The selected band indices are arranged in ascending order of wavelength to form the final band set. By summing the curvature residuals within the band set, the moisture-related curvature features within the water absorption band interval can be accumulated. The core principle is to superimpose the local moisture features of each wavelength within the interval, neutralizing the influence of random noise at a single wavelength. For example, a noise spike in one band can be canceled out by the effective moisture features of other bands, making the result more closely reflect the actual moisture state of the pixel. Normalizing the summation result using the number of elements in the band set eliminates the dimensional influence caused by differences in the width of the water absorption band interval. Furthermore, performing normalized integral calculation on the curvature residuals generates a logarithmic spectrum of water absorption curvature residuals characterizing the pixel's moisture features. The core principle is to transform the multidimensional curvature residual data within the water absorption band interval into a single-dimensional scalar, preserving the overall moisture characteristics within the interval while simplifying subsequent feature processing and calculations, thus adapting to the real-time computing needs of industrial scenarios.
[0088] It should be noted that this invention performs normalized integration on the curvature residuals within the water absorption band interval, transforming the multidimensional curvature residuals into single-dimensional scalar features. This accumulates the overall moisture-related features within the interval, reducing interference from single-point wavelength noise and providing a unified scalar input for subsequent multi-absorption band feature fusion. By determining the band set, the effective bands of the water absorption band are precisely focused, eliminating interference from non-moisture bands outside the interval. Accumulation and summation integrate the moisture features of each wavelength within the interval, neutralizing accidental noise from single-point wavelengths and improving the stability of pixel-level moisture features. Normalization of the number of elements eliminates the dimensional differences in the width of different water absorption band intervals, allowing direct comparison and fusion of features from different intervals. Transforming the multidimensional curvature residuals into single-dimensional scalars simplifies the subsequent feature processing flow, adapting to the real-time computational needs of flower production lines. The pixel-by-pixel generation method also fully preserves pixel-level moisture features, providing a reliable pixel-level feature foundation for the construction of soft weighted fields.
[0089] In one embodiment of the present invention, the reciprocal of the standard deviation of the logarithmic spectrum water absorption curvature residual of the entire image is extracted as a weighting weight. The logarithmic spectrum water absorption curvature residuals of different water absorption band intervals are combined with the weighting weight to generate a single pixel driving quantity, including:
[0090] Obtaining the logarithmic spectrum water absorption curvature residual , In image space coordinates Place, No. Logarithmic spectrum water absorption curvature residuals within each water absorption band interval;
[0091] Calculate the mean of the whole map and the standard deviation of the whole map The calculation formula is as follows:
[0092]
[0093]
[0094] in Image spatial coordinates, This represents the total number of pixels in the entire image. For the first The mean of the logarithmic spectrum water absorption curvature residual within each water absorption band interval over the entire map. For the first The standard deviation of the logarithmic spectrum water absorption curvature residual within each water absorption zone interval over the entire map;
[0095] Using the standard deviation of the whole map Generate weighted weights The calculation formula is as follows:
[0096]
[0097] in A constant that is greater than zero. For the first Weighted weights for each water absorption zone interval;
[0098] Fusion generates single-pixel driving amount The calculation formula is as follows:
[0099]
[0100] in In image space coordinates The single-pixel driving amount at that location.
[0101] It should be noted that the full-image mean is the arithmetic mean of the logarithmic spectrum water absorption curvature residual across the entire image's pixel range, reflecting the overall distribution level of this feature across the entire image. The full-image standard deviation is a numerical value representing the dispersion of the logarithmic spectrum water absorption curvature residual relative to the full-image mean, reflecting the global fluctuation characteristics of this feature across the entire image. The weighted weight is a value obtained by summing the constants of the full-image standard deviation and taking its reciprocal, reflecting the contribution of the corresponding water absorption band feature during fusion. The single-pixel driving quantity is a scalar obtained by weighted summation of the logarithmic spectrum water absorption curvature residuals of different water absorption bands, reflecting the comprehensive water feature of a single pixel after fusing multiple absorption bands. The statistics of the logarithmic spectrum water absorption curvature residual calculated across the entire image reflect the global fluctuation characteristics of this feature across the entire image. The core is that the full-image statistics are calculated based on the feature values of all pixels, objectively reflecting the degree of scene interference affecting the feature of the water absorption band. Large fluctuations indicate that the feature of that band is more affected by factors such as sleeve wrinkles and reflections, while small fluctuations indicate that the feature is more stable. The reciprocal of the overall standard deviation can be used as a weighting factor to adaptively weight features across different water absorption bands. The core principle is that a larger standard deviation indicates more drastic global fluctuations in the feature, while a smaller reciprocal corresponds to a lower weight. This allows highly distorted features to contribute less during fusion, while less distorted features contribute more, eliminating the need for manual weight setting and adapting to real-time scene changes. Combining the logarithmic spectrum water absorption curvature residuals from different water absorption bands with the weighting factor enables multi-feature fusion. The key is that the weighting factor can differentiate the features of each absorption band, integrating effective information from multiple water-sensitive bands, compensating for potential information gaps in single absorption band features, and allowing the fused features to more comprehensively reflect the pixel's water status.
[0102] It should be noted that this invention adaptively weights and fuses the logarithmic spectrum water absorption curvature residuals of multiple water absorption bands to generate single-pixel driving quantities. This integrates water-related features from multiple bands, avoiding the information limitations of a single absorption band and reducing the impact of highly disturbed features on the fusion result, providing a unified pixel-level feature input for subsequent soft weighting field construction. The fluctuation degree of each absorption band feature is calculated using full-image statistics to achieve adaptive weighting, avoiding subjective bias caused by manually setting weights and making feature fusion more closely aligned with the actual scene. The weighted summation method integrates effective information from multiple water-sensitive bands, compensating for the information loss of a single absorption band, allowing the single-pixel driving quantity to more comprehensively reflect the pixel's water status. The pixel-by-pixel fusion calculation method fully preserves the pixel-level comprehensive water features, ensuring the spatial resolution of the features, adapting to the subsequent need for constructing a soft weighting field based on pixel-level features, and also giving the fused features better robustness.
[0103] In one embodiment of the present invention, a soft weight field is generated by performing exponential mapping and global normalization on the single-pixel driving quantity, and a weighted summation of the single-pixel driving quantities of the entire image is performed using the soft weight field to generate a single-valued convergent quantity, including:
[0104] Obtain single pixel driving amount ,in In image space coordinates Single pixel driving amount at the location;
[0105] Calculate the mean of the whole map Standard deviation of the whole map The calculation formula is as follows:
[0106]
[0107]
[0108] in Image spatial coordinates, This represents the total number of pixels in the entire image. This represents the average driving amount of a single pixel across the entire image. The standard deviation of the single-pixel driving amount over the entire image;
[0109] Calculate the exponential mapping scale parameter The calculation formula is as follows:
[0110]
[0111] in A constant that is greater than zero. The scale parameter for the exponential mapping;
[0112] Generate soft weight field The calculation formula is as follows:
[0113]
[0114] in It is an exponential function. In image space coordinates The soft weight field weight at the location;
[0115] Generate single-value aggregation The calculation formula is as follows:
[0116]
[0117] in This is a single-valued aggregate quantity.
[0118] It should be noted that the exponential mapping scale parameter is an adjustment coefficient obtained by summing the constants of the full-image standard deviation of single-pixel driving quantities and taking their reciprocals. It reflects the scaling degree of the exponential mapping to adapt to the feature fluctuations of different scenes. The soft weight field is the full-image pixel-level weight distribution obtained by exponential mapping and global normalization of single-pixel driving quantities, reflecting the contribution of each pixel to the overall moisture estimation of flowers. The single-value convergence is a scalar obtained by weighting and summing the full-image single-pixel driving quantities using the soft weight field, reflecting the overall moisture characteristics of flowers corresponding to the entire image. The exponential mapping scale parameter adapted to the scene can be obtained by summing the constants of the full-image standard deviation and taking their reciprocals. The core is that the standard deviation reflects the fluctuations of scene features, and its reciprocal allows the scale parameter to adapt to the magnitude of fluctuations. Large fluctuations result in a small scale parameter, avoiding excessive weight differences after exponential mapping; small fluctuations result in a large scale parameter, strengthening the weight differentiation of effective pixels. The constant summation avoids the division by zero problem. Soft weighted fields can achieve pixel-level adaptive weighted summation of single-pixel driving quantities across the entire image. The core principle is that the soft weighted field assigns a weight to each pixel that matches its moisture characteristic confidence level; high-confidence pixels have higher weights and a larger proportion in the weighted summation, while low-confidence pixels have lower weights, eliminating the need for manually setting weight allocation rules. Furthermore, by using soft weighted fields to weighted sum the single-pixel driving quantities, a single-valued aggregated quantity representing the moisture characteristics of the entire image can be generated. The key is that the weighted summation integrates the pixel-level moisture characteristics of the entire image into a single value, preserving the dominant role of high-confidence pixels while integrating the moisture information of the entire image, forming a unified index that can represent the overall moisture state of the flower.
[0119] It should be noted that this invention transforms single-pixel driving quantities into pixel-level soft weighted fields, achieving adaptive weight allocation for all pixels in the image. Then, through weighted summation, pixel-level moisture features are aggregated into a single-value aggregated quantity representing the overall flower, providing a unified one-dimensional input for subsequent moisture calibration while avoiding result fluctuations caused by hard segmentation regions. The exponential mapping scale parameter adaptively adjusts with scene feature fluctuations, ensuring that the weight discrimination of the exponential mapping closely matches the actual imaging scene. The exponential mapping naturally amplifies the weight of high-confidence pixels, global normalization ensures the rationality of weight allocation, and the soft weighted field naturally reduces the contribution of low-confidence pixels caused by reflections from sleeve wrinkles, eliminating the need for manually setting segmentation rules. Weighted summation integrates moisture information from all effective pixels in the image, and the single-value aggregated quantity accurately represents the overall moisture state of the flower. The pixel-by-pixel processing method preserves pixel-level contribution differences, making the aggregated result more closely match the actual moisture distribution of the flower, adapting to the moisture estimation needs of individual flowers on a production line.
[0120] In one embodiment of the present invention, a polynomial mapping calculation is performed on the individual concentration using quadratic polynomial calibration coefficients to generate and output the individual moisture estimation result, including:
[0121] Get Single Value Aggregate Single-value aggregation The value is generated by performing a weighted summation on the driving quantities of a single pixel across the entire image using a soft-weighted field;
[0122] Using the constant term coefficients in the calibration coefficients of a quadratic polynomial coefficient of the first term and the coefficient of the quadratic term For single-value convergence Perform polynomial mapping calculations to obtain single-value moisture estimation results. The calculation formula is as follows:
[0123]
[0124] in For single-value aggregation quantity, The coefficient of the constant term, The coefficient of the linear term, The coefficient of the quadratic term, This is the generated single-value moisture estimation result.
[0125] It should be noted that the quadratic polynomial calibration coefficients are a set of quadratic polynomial coefficients used to map single-valued aggregate quantities to actual moisture values, reflecting the conversion relationship from moisture characteristic scalars to actual moisture values. The constant term coefficients are the constant part of the quadratic polynomial, reflecting the basic offset of the polynomial mapping. The linear term coefficients are the coefficients of the linear term in the quadratic polynomial, reflecting the degree of linear correlation between single-valued aggregate quantities and moisture values. The quadratic term coefficients are the coefficients of the quadratic term in the quadratic polynomial, reflecting the degree of non-linear correlation between single-valued aggregate quantities and moisture values. The single-valued moisture estimation result is a value calculated through quadratic polynomial mapping, reflecting the quantitative result of the overall moisture state of the flower. The quadratic polynomial calibration coefficients can perform polynomial mapping calculations on single-valued aggregate quantities, realizing the conversion from moisture characteristic scalars to actual moisture values. The core is that single-valued aggregate quantities are spectral geometric characteristic scalars representing moisture, without actual moisture dimensions. Transforming dimensionless characteristic values into meaningful moisture values allows the calculation results to directly reflect the actual moisture state of the flower. The quadratic polynomial mapping can fit the linear and nonlinear relationship between the single-valued convergence amount and the actual flower moisture value. The core is that the relationship between flower moisture and spectral characteristics is not strictly linear. The rate of change of characteristics with the change of moisture content will show nonlinear differences. The first term fits the linear relationship between the two, and the quadratic term fits the nonlinear relationship, which can accurately capture the characteristic change pattern of different moisture ranges.
[0126] It should be noted that the specific method and process for obtaining the calibration coefficients of the quadratic polynomial are as follows: The acquisition method involves offline calibration experiments combined with the least squares method. The calibration process involves first selecting 30 to 50 flower samples, collecting hyperspectral images of the samples, and calculating the single-valued aggregate quantity according to the previous steps. Simultaneously, physical measurement methods such as weighing are used to obtain the actual moisture value of the samples. Then, a calibration dataset is constructed with the single-valued aggregate quantity as the independent variable and the actual moisture value as the dependent variable. Finally, the quadratic polynomial calibration coefficients are obtained by solving the least squares method. The specific calibration and solution rules for the constant term coefficients, linear term coefficients, and quadratic term coefficients are as follows: A calibration matrix is constructed, with the first column being a vector of all 1s, the second column being the vector of the single-valued aggregate quantity, and the third column being the vector of the squared single-valued aggregate quantity. The dependent variable is the vector of the actual moisture value. The linear equation system of the calibration matrix and coefficient vectors is solved using the least squares method. The solution vectors are, in order, the constant term coefficients, linear term coefficients, and quadratic term coefficients. During the solution process, the calibration matrix is guaranteed to be full rank to avoid no or multiple solutions for the coefficients. In addition, the output of the single-value moisture estimation results includes both numerical and unit-labeled formats, supporting both digital signal output for industrial control and numerical display via a visual interface. The data accuracy standard is that the goodness of fit of the calibration set is greater than 0.9, and the absolute error of a single measurement result does not exceed 0.5 moisture units, ensuring the reliability of the estimation results.
[0127] It should be noted that this invention transforms the dimensionless single-value aggregate obtained in the preceding steps into a single-value moisture estimation result with actual dimensions through quadratic polynomial calibration coefficients. This enables quantitative output of flower moisture, meeting the practical application needs of production lines for moisture measurement. The coefficients obtained through offline calibration experiments combined with the least squares method transform abstract geometric features into directly applicable quantitative moisture results. The quadratic polynomial can simultaneously fit the linear and nonlinear relationships between features and moisture values, better reflecting the actual spectral response of flower moisture compared to a single linear mapping, making the estimation result more closely match the true moisture state of the flowers. The standardization of the calibration process ensures the objectivity and reliability of the coefficient solution, and the interference elimination in the preceding steps ensures that the calibrated mapping result stably reflects the moisture state of the flowers, adapting to the real-time measurement needs of production lines.
[0128] It should be noted that, as Figure 3 As shown, the output results of single-plant flower detection based on the system of the present invention are displayed. Different colors correspond to different moisture value ranges: light yellow corresponds to a moisture range of 75% to 80%, light red corresponds to a moisture range of 80% to 85%, and light purple corresponds to a moisture range of 85% to 90%. This clearly reflects the differences in moisture distribution in different areas of the flower, such as petals and sepals. At the same time, the overall single-value moisture estimation result of a single-plant flower is also displayed, with a specific value of 82.8% here.
[0129] In one embodiment of the present invention, a method for determining the moisture content of flowers based on image data includes the following steps:
[0130] Step S101: Acquire the original hyperspectral image of the flower, and use the dark field reference and white board reference to perform radiometric calibration on the original hyperspectral image to obtain the reflectance;
[0131] Step S102: Convert the reflectance to the logarithmic domain and apply second-order regular smoothing along the wavelength direction to generate a smoothed logarithmic spectrum;
[0132] Step S103: Calculate the discrete second-order curvature of the smoothed logarithmic spectrum at different wavelength positions;
[0133] Step S104: Within the water absorption zone, extract the discrete second-order curvature at the endpoint of the water absorption zone and interpolate to generate a curvature baseline. Subtract the curvature baseline from the discrete second-order curvature to obtain the curvature residual.
[0134] Step S105: Perform normalized integration on the curvature residual within the water absorption band interval to generate a logarithmic spectrum water absorption curvature residual.
[0135] Step S106: Extract the reciprocal of the standard deviation of the logarithmic spectrum water absorption curvature residual of the whole image as the weighting weight, and combine the logarithmic spectrum water absorption curvature residual of different water absorption band intervals with the weighting weight to generate a single pixel driving amount.
[0136] Step S107: Perform exponential mapping and global normalization on the single-pixel driving quantity to generate a soft weight field, and use the soft weight field to perform weighted summation on the single-pixel driving quantity of the whole image to generate a single-value convergence quantity.
[0137] Step S108: Use the quadratic polynomial calibration coefficients to perform polynomial mapping calculation on the single-valued aggregation amount, generate the single-valued moisture estimation result and output it.
[0138] Specifically, a complete system is set up at the inspection station of the flower production line, including a hyperspectral imaging system, an industrial control host, a stable light source, a conveyor line trigger module, and a system where the lens of the hyperspectral imaging system is vertically aligned with the flower inspection area of the conveyor line to ensure that the flower appears completely in the imaging field of view as it passes through. The stable light source uses a diffuse reflective surface light source to evenly illuminate the inspection area and avoid highlights and shadows. The trigger module is linked to the conveyor line; when a flower arrives at the inspection area, the hyperspectral imaging system is automatically triggered to acquire an image. The industrial control host is pre-loaded with software programs that implement the calculation logic of this invention. After the system is powered on, it first completes the acquisition of dark-field reference and white-board reference. Following the previous steps, the dark-field reference is acquired by shading, and the white-board reference is acquired by aligning with the standard white board. The reference data is stored in the industrial control host. During production, the reference data is re-acquired every 2 hours to update the dark-field reference and white-board reference stored in the system. Finally, the industrial control host receives the original hyperspectral image of the flower, generates a single-value moisture estimation result, and outputs it. The entire process is without manual intervention, and the calculation and processing time for a single flower matches the inspection cycle of the conveyor line.
[0139] The output results of this invention include two categories: single-value moisture estimation results for individual flowers and pixel-level moisture response maps. It supports both industrial digital signal and visual display output formats, and all results have clear dimensions, allowing direct application to production line detection and grading operations. The single-value moisture estimation result is a numerical value characterizing the overall moisture state of a single flower, expressed as a percentage by mass, i.e., the percentage of the flower's water mass to its total mass. This result is a key basis for production line grading; for example, after testing a rose flower using this invention's system, the output single-value moisture estimation result is 83.5%; the single-value moisture estimation results for a batch of carnation flowers range from 78.2% to 85.7%. The pixel-level moisture response map is a moisture distribution image that corresponds one-to-one with the original hyperspectral image of the flower. Visualized in pseudo-color, different colors correspond to different moisture value ranges, intuitively reflecting the moisture differences in different parts of the flower. For example, a moisture value of 75% to 80% is set to light yellow, 80% to 85% to light red, and 85% to 90% to light purple. In the moisture response map of a certain flower, the petal area is light red, and the sepal area is light yellow, reflecting that the petals have a higher moisture content than the sepals. Furthermore, the single-value moisture estimation results are converted into analog electrical signals of 4 to 20 mA and transmitted to the grading control system on the production line. The signal values correspond linearly to the moisture values; for example, 4 mA corresponds to a 70% moisture value, 20 mA to a 90% moisture value, and 83.5% moisture value corresponds to a 16.24 mA analog signal. The grading system automatically completes the grading and feeding of the flowers based on the signals. In addition, the system can be recalibrated offline every 30 days. This involves selecting 30 to 50 plants of the same type with different moisture states as samples, collecting hyperspectral images of the samples and calculating the single-value convergence. At the same time, the actual moisture value of the samples is obtained by drying and weighing. The calibration dataset is then reconstructed and the new quadratic polynomial calibration coefficients are solved by the least squares method. These coefficients replace the original coefficients in the industrial control host, adapting to the characteristics of flower varieties and the long-term drift of the equipment.
[0140] It should be noted that this invention enables fully automated moisture detection throughout the entire flower production line, replacing the traditional manual sampling, drying, and weighing method. This improves detection efficiency, allows for complete inspection of each flower, and avoids the randomness of sampling. The detection results can be directly used as the basis for flower processing and grading. For example, in flower tea processing, flowers are graded according to their moisture content, and flowers with different moisture levels are processed at different temperatures and times, improving the consistency of the processed flower products. Furthermore, the non-contact detection method does not cause physical damage to the flowers, ensuring their commercial value. Similarly, this invention can be used to build a detection system at the warehousing and transportation nodes of flower cold chain logistics, quickly determining the moisture content of flowers, monitoring moisture changes in real time during logistics, and adjusting the temperature and humidity of storage and the preservation conditions during transportation accordingly. This reduces losses caused by moisture loss or mold, extending the shelf life of the flowers. Furthermore, by combining the hyperspectral imaging system of this invention with field mobile equipment, non-contact moisture detection can be performed on flowers in flower planting bases, quickly obtaining the moisture distribution and overall moisture status of flowers in the field. This provides data support for growers' water and fertilizer management, allowing them to adjust the frequency and amount of watering and fertilization based on the moisture detection results, optimize water and fertilizer programs for flower planting, and improve the growth quality of flowers.
[0141] It should be noted that the interval and threshold sizes are set for ease of comparison. The size of the threshold depends on the amount of sample data and the base number set by those skilled in the art for each set of sample data, as long as it does not affect the proportional relationship between the parameter and the quantized value. Furthermore, the above formulas are all dimensionless calculations, and the formulas are derived from software simulations using a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0142] The embodiments of this example have been described above. However, this example is not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms based on the guidance of this example, and all of them are within the protection scope of this example.
Claims
1. A flower moisture determination system based on image data, characterized by, include: The first module involves acquiring raw hyperspectral images of flowers and using dark-field and white-board references to perform radiometric calibration on the raw hyperspectral images to obtain reflectance. The second module converts the reflectivity to the logarithmic domain and applies second-order regular smoothing along the wavelength direction to generate a smoothed logarithmic spectrum. The third module calculates the discrete second-order curvature of the smoothed logarithmic spectrum at different wavelength positions; The fourth module extracts the discrete second-order curvature at the endpoint of the water absorption zone and interpolates it to generate a curvature baseline. The curvature residual is obtained by subtracting the curvature baseline from the discrete second-order curvature. The water absorption band range is a wavelength range defined for extracting water-related curvature characteristics, reflecting a spectral range that matches the absorption characteristics of water molecules. The fifth module performs a normalized integral on the curvature residual within the water absorption zone to generate a logarithmic spectrum of the water absorption curvature residual. The sixth module extracts the reciprocal of the standard deviation of the logarithmic spectrum water absorption curvature residual of the whole image as the weighting weight, and combines the logarithmic spectrum water absorption curvature residual of different water absorption band intervals with the weighting weight to generate a single pixel driving amount. The seventh module performs exponential mapping and global normalization on the single-pixel driving quantities to generate a soft weight field. It then uses this soft weight field to perform a weighted summation on the single-pixel driving quantities across the entire image to generate a single-valued convergent quantity. This includes: Obtain the single-pixel driving quantity in image space coordinates; Calculate the mean and standard deviation of the single-pixel driving amount across the entire image, and perform normalization using the total number of pixels in the entire image; The reciprocal of the constant whose cumulative standard deviation of the whole map is greater than zero is taken as the exponential mapping scale parameter. The single-pixel driving quantity is subjected to exponential mapping processing with the exponential mapping scale parameter as the adjustment coefficient, and numerical normalization is performed across the entire image to generate a soft weight field in the image space coordinates. The single-value convergence is calculated by performing a weighted summation on the single-pixel driving quantities across the entire image using a soft weighted field. The eighth module uses quadratic polynomial calibration coefficients to perform polynomial mapping calculations on the individual aggregates, generating and outputting individual moisture estimation results.
2. The flower moisture determining system based on image data according to claim 1, characterized in that, Raw hyperspectral images of flowers were acquired, and reflectance was obtained by radiometric calibration of the raw hyperspectral images using dark-field and white-field references, including: Acquire the original hyperspectral image of the flower at image space coordinates and wavelength position; acquire the dark field reference at the wavelength position; acquire the white board reference at the wavelength position; Radiometric calibration was performed by combining the original hyperspectral image of the flower, a dark field reference, and a whiteboard reference to calculate the reflectance at the image spatial coordinates and wavelength position.
3. The flower moisture determining system based on image data according to claim 1, characterized in that, The reflectivity is converted to the logarithmic domain, and a second-order canonical smoothing is applied along the wavelength direction to generate a smoothed logarithmic spectrum, including: After accumulating the reflectivity to a constant greater than zero, perform a natural logarithmic operation to obtain the logarithmic spectrum at the image spatial coordinates and wavelength position; The logarithmic spectrum in the image spatial coordinates is used to form a spectral vector along the wavelength direction. Combined with a regularization coefficient greater than zero and a second-order difference matrix along the wavelength direction, the smooth spectral vector is calculated by minimizing the objective function composed of the spectral vector deviation term and the second-order difference energy penalty term. Using the identity matrix, regularization coefficient, second-order difference matrix, and transpose of the second-order difference matrix, a smoothed spectral vector is obtained through a closed-form solution formula. Each component in the smoothed spectral vector is then mapped back to image space coordinates and wavelength positions to generate a smoothed logarithmic spectrum.
4. The flower moisture determining system based on image data according to claim 1, characterized in that, Calculate the discrete second-order curvature of the smoothed logarithmic spectrum at different wavelength positions, including: Obtain the smoothed logarithmic spectrum at the image spatial coordinates and wavelength position; Discrete second-order difference calculations are performed on the smooth logarithmic spectrum at discrete wavelength positions along the wavelength direction, and normalization is performed using the wavelength interval between adjacent discrete wavelength positions to calculate the discrete second-order curvature at the image space coordinates and discrete wavelength positions.
5. The flower moisture determining system based on image data according to claim 1, wherein, Within the water absorption zone, the discrete second-order curvature at the endpoints of the water absorption zone is extracted and interpolated to generate a curvature baseline. The curvature residual is obtained by subtracting the curvature baseline from the discrete second-order curvature, including: Within the water absorption band, determine the wavelength positions of the left and right endpoints, and extract the discrete second-order curvature corresponding to the wavelength positions of the left and right endpoints in the image space coordinates. Interpolation is performed within the water absorption band using the wavelength positions of the left and right endpoints and the corresponding discrete second-order curvature to generate a curvature baseline in the image space coordinates and wavelength position. Within the water absorption band, the curvature residual at the image spatial coordinates and wavelength position is calculated by subtracting the curvature baseline from the discrete second-order curvature at the image spatial coordinates and wavelength position.
6. The flower moisture determining system based on image data according to claim 1, wherein, Normalized integration is performed on the curvature residuals within the water absorption band to generate logarithmic spectrum water absorption curvature residuals, including: Within the water absorption band region, the band set is determined by the wavelength positions at the left and right endpoints, and the number of elements in the band set is also determined. Extract the curvature residuals in the image space coordinates and discrete wavelength positions, and perform curvature residual summation processing on the discrete wavelength positions located within the band set; By performing normalized integral calculation on the summed result using the number of elements in the band set, a logarithmic spectral water absorption curvature residual in image space coordinates is generated.
7. The flower moisture determining system based on image data according to claim 1, wherein, The reciprocal of the standard deviation of the logarithmic spectrum water absorption curvature residuals of the entire image is extracted as a weighting factor. The logarithmic spectrum water absorption curvature residuals of different water absorption band intervals are then fused with the weighting factor to generate single-pixel driving quantities, including: Obtain the logarithmic spectrum water absorption curvature residual in image space coordinates and water absorption band intervals; For the water absorption band region, the mean and standard deviation of the logarithmic spectrum water absorption curvature residuals are calculated across the entire image, and normalization is performed using the total number of pixels in the entire image. The reciprocal of the sum of the standard deviations of the entire map that are greater than zero is taken as the weighting weight for the corresponding water absorption zone interval; The logarithmic spectrum water absorption curvature residuals of different water absorption band intervals are combined with weighted weights and weighted summation is performed to generate a single pixel driving quantity in image space coordinates.
8. The flower moisture determining system based on image data according to claim 1, wherein, Using quadratic polynomial calibration coefficients, a polynomial mapping calculation is performed on the individual-valued accumulation amount to generate and output individual-valued moisture estimation results, including: Obtain the single-valued convergence value generated by performing a weighted summation of the driving quantities of single pixels across the entire image using a soft-weighted field; Using the constant term coefficient, linear term coefficient, and quadratic term coefficient in the quadratic polynomial calibration coefficients, polynomial mapping processing is performed on the individual-valued aggregate quantity to calculate and output the individual-valued moisture estimation result.
9. A method of flower water determination based on image data, characterized by, Performing a flower moisture measurement system based on image data as described in any one of claims 1 to 8 includes the following steps: Step S101: Acquire the original hyperspectral image of the flower, and use the dark field reference and white board reference to perform radiometric calibration on the original hyperspectral image to obtain the reflectance; Step S102: Convert the reflectance to the logarithmic domain and apply second-order regular smoothing along the wavelength direction to generate a smoothed logarithmic spectrum; Step S103: Calculate the discrete second-order curvature of the smoothed logarithmic spectrum at different wavelength positions; Step S104: Within the water absorption zone, extract the discrete second-order curvature at the endpoint of the water absorption zone and interpolate to generate a curvature baseline. Subtract the curvature baseline from the discrete second-order curvature to obtain the curvature residual. Step S105: Perform normalized integration on the curvature residual within the water absorption band interval to generate a logarithmic spectrum water absorption curvature residual. Step S106: Extract the reciprocal of the standard deviation of the logarithmic spectrum water absorption curvature residual of the whole image as the weighting weight, and combine the logarithmic spectrum water absorption curvature residual of different water absorption band intervals with the weighting weight to generate a single pixel driving amount. Step S107: Perform exponential mapping and global normalization on the single-pixel driving quantity to generate a soft weight field, and use the soft weight field to perform weighted summation on the single-pixel driving quantity of the whole image to generate a single-value convergence quantity. Step S108: Use the quadratic polynomial calibration coefficients to perform polynomial mapping calculation on the single-valued aggregation amount, generate the single-valued moisture estimation result and output it.