A grain moisture detection method, system, device and storage medium

By using 3D point cloud reconstruction and support vector machine regression techniques, a 3D model of grain grains is constructed, which solves the problems of inaccurate and inefficient grain moisture detection in existing technologies. It achieves efficient and non-destructive grain moisture detection, and is especially suitable for high-moisture wheat grains, with high detection accuracy and stability.

CN116718592BActive Publication Date: 2025-12-23ACAD OF NAT FOOD & STRATEGIC RESERVES ADMINISTRATION
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310638328.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-31
Publication Date
2025-12-23
Estimated Expiration
2043-05-31

AI Technical Summary

Technical Problem

Existing technologies for detecting the moisture content of grains suffer from problems such as inaccurate measurement, low efficiency, and damage to the grains.

Method used

A 3D model of grain grains was constructed using 3D point cloud reconstruction technology, and non-destructive testing was achieved through support vector machine regression technology. A depth map was generated using the Vis-MVSNet 3D reconstruction model, and scale-free correlation features were extracted for moisture prediction by combining a sparse point cloud reconstruction platform and image processing technology.

Benefits of technology

It achieves intelligent, efficient, and non-destructive detection of grain moisture, with high accuracy and good stability. It is not affected by external factors such as ambient temperature and humidity and grain shape, and has a low average absolute error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116718592B_ABST
    Figure CN116718592B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a grain moisture detection method, system, device and storage medium. In a specific embodiment, the method comprises: acquiring grain kernel images at multiple angles; inputting the grain kernel images at multiple angles into a sparse point cloud reconstruction platform to obtain three-dimensional sparse point clouds; inputting the multiple three-dimensional sparse point clouds and the multiple grain kernel images into a Vis-MVSNet three-dimensional reconstruction model respectively to obtain multiple depth maps; fusing the multiple depth maps to obtain a three-dimensional dense point cloud; extracting a scale-free correlation feature of the three-dimensional dense point cloud, inputting the feature into a trained support vector machine regression model, and obtaining a grain kernel predicted moisture content. The embodiment constructs a three-dimensional model of the grain kernel through a three-dimensional point cloud model, and realizes nondestructive detection of the wheat kernel through a support vector machine regression technology, especially realizes nondestructive detection of the high-moisture wheat kernel, and is not affected by external factors such as environmental temperature and humidity, grain type and bulk density, and has high stability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of wheat moisture detection. More particularly, it relates to a grain moisture detection method, system, device and storage medium. BACKGROUND

[0002] At present, the moisture content of grain is an important basis for grain pricing. In the prior art, the methods for detecting the moisture content of grain include manual measurement, direct measurement and indirect measurement.

[0003] The direct measurement method mainly includes hot air oven drying method, infrared drying method and microwave drying method. The direct measurement method is accurate in measuring the moisture content but is destructive to the grain sample and the detection process is tedious and inefficient.

[0004] The indirect measurement method mainly includes resistance method, capacitance method and microwave method. The resistance method uses electrical conductivity as a sensitive quantity of moisture, but this method is destructive to grain detection and the measurement result is affected by the contact state of the electrode and the grain sample. The core of the capacitance method is to measure the dielectric constant of the grain sample, but the bulk density of the grain has a great influence on the measurement result, and the measurement result is also affected by the contact state of the electrode and the grain sample. The microwave method indirectly measures the moisture content of grain by measuring the resonance frequency and quality factor or complex dielectric constant, etc. which are related to moisture, but the bulk density of grain has a great influence on the measurement result, and the cost is high.

[0005] Therefore, the existing technology for detecting the moisture content of high-moisture grain still mainly relies on manual on-site sensory inspection, which is labor-intensive, inefficient, has poor repeatability, is highly subjective, and is difficult to ensure the rationality and authority of the detection results.

[0006] In the process of implementing the present application, the inventors found that the prior art has at least the following problems: when detecting the moisture content of grain, the prior art has the problems of inaccurate measurement, low measurement efficiency and damage to the grain. SUMMARY

[0007] The present application aims to provide a grain moisture detection method, system, device and storage medium which are intelligent, efficient, non-destructive and stable in detecting the moisture content of grain, so as to solve at least one of the problems existing in the prior art.

[0008] To achieve the above-mentioned purpose, the present application adopts the following technical solutions:

[0009] The first aspect of the present application provides a grain moisture detection method based on the following steps:

[0010] Obtaining grain kernel images at multiple angles;

[0011] inputting the plurality of grain seed images of different angles into a sparse point cloud reconstruction platform to obtain a plurality of three-dimensional sparse point clouds output by the sparse point cloud reconstruction platform;

[0012] inputting the plurality of three-dimensional sparse point clouds and the plurality of grain seed images of different angles into a Vis-MVSNet three-dimensional reconstruction model respectively to obtain a plurality of depth maps output by the Vis-MVSNet three-dimensional reconstruction model;

[0013] fusing the plurality of depth maps to obtain a three-dimensional dense point cloud;

[0014] extracting scale-invariant features of the three-dimensional dense point cloud, inputting the scale-invariant features into a trained support vector machine regression model to obtain a grain seed predicted moisture content output by the support vector machine regression model.

[0015] Further, before the inputting the plurality of grain seed images of different angles into the sparse point cloud reconstruction platform, the method further comprises:

[0016] performing binaryzation processing on the plurality of grain seed images of different angles;

[0017] in response to an adjustment operation of a user, adjusting a background of the plurality of binaryzated grain seed images of different angles to pure black to obtain a first intermediate image;

[0018] calculating a sum of pixel values of pixels in each row of the first intermediate image to obtain row pixel values of the pixels, calculating a difference value of the row pixel values of adjacent two rows of pixels and screening out a maximum difference value, taking the two rows of pixels where the maximum difference value is located as a cropping line, cropping the first intermediate image, and retaining a part with a larger sum of row pixel values after cropping to obtain a cropped grain seed image.

[0019] Further, the sparse point cloud reconstruction platform is COLMAP software, and the inputting the plurality of grain seed images of different angles into the sparse point cloud reconstruction platform to obtain a plurality of three-dimensional sparse point clouds output by the sparse point cloud reconstruction platform comprises:

[0020] extracting feature points of the plurality of grain seed images of different angles by the COLMAP software, performing feature point matching on the feature points, and correcting feature points that are wrong in the feature point matching process according to a bundle adjustment algorithm to obtain a three-dimensional sparse point cloud.

[0021] Further, before the inputting the plurality of three-dimensional sparse point clouds and the plurality of grain seed images of different angles into the Vis-MVSNet three-dimensional reconstruction model respectively, the method further comprises: converting a format of the plurality of three-dimensional sparse point clouds into a format suitable for the MVSNet network.

[0022] Further, the method further comprises: before the extracting the scale-invariant features of the three-dimensional dense point cloud, performing point cloud filtering, grid construction and multiple smoothing processing on the three-dimensional dense point cloud.

[0023]

[0024] The covariance matrix C is calculated, wherein N is the total number of point clouds of the three-dimensional model of the grain kernels, A i is the spatial position coordinate matrix [x, y, z] of the i-th point cloud in the three-dimensional model of the grain kernels, is the average value of the position coordinates of the point clouds in the three-dimensional model of the grain kernels;

[0025] The eigenvalues of the covariance matrix C are calculated.

[0026] The scale-invariant features are constructed according to the eigenvalues of the covariance matrix C.

[0027] Further, before the extracting the scale-invariant features of the three-dimensional dense point cloud, the method further comprises: performing point cloud filtering, grid construction and multiple smoothing processing on the three-dimensional dense point cloud.

[0028] Further, before the inputting the scale-invariant features into the trained support vector machine regression model, the method further comprises:

[0029] Obtaining a plurality of grain samples;

[0030] Obtaining a plurality of grain kernel images of each grain sample at multiple angles;

[0031] Inputting the plurality of grain kernel images of each grain sample at multiple angles into a sparse point cloud reconstruction platform to obtain a plurality of three-dimensional sparse point clouds of each grain sample output by the sparse point cloud reconstruction platform;

[0032] Inputting the plurality of three-dimensional sparse point clouds and the plurality of grain kernel images at multiple angles of each grain sample into a Vis-MVSNet three-dimensional reconstruction model to obtain a plurality of depth maps of each grain sample output by the Vis-MVSNet three-dimensional reconstruction model;

[0033] Fusing the plurality of depth maps to obtain a three-dimensional dense point cloud of each grain sample;

[0034] Extracting scale-invariant features of the three-dimensional dense point cloud of each grain sample;

[0035] Dividing each grain sample into a test grain sample and a training grain sample;

[0036] Measuring and recording the true moisture content of each grain sample by using an oven drying method;

[0037] The characteristics of the training grain samples are input into the support vector machine regression model as input, and the true moisture content of the training grain samples is input into the support vector machine regression model as a training label to train the support vector machine regression model to obtain a trained support vector machine regression model;

[0038] The characteristics of the test grain samples are input into the trained support vector machine regression model to obtain the predicted moisture content of each test grain sample output by the trained support vector machine regression model.

[0039] The average absolute error of each test grain sample is calculated according to the predicted moisture content of each test grain sample and the true moisture content of each test grain sample, respectively, and a comparison chart is drawn.

[0040] The second aspect of the present application provides a grain moisture detection system, characterized in that it comprises:

[0041] An image acquisition system is used to acquire grain kernel images at multiple angles.

[0042] A first reconstruction module is used to input the grain kernel images at multiple angles into a sparse point cloud reconstruction platform to obtain multiple three-dimensional sparse point clouds output by the sparse point cloud reconstruction platform.

[0043] A second reconstruction module is used to input the multiple three-dimensional sparse point clouds and the grain kernel images at multiple angles into a Vis-MVSNet three-dimensional reconstruction model, respectively, to obtain multiple depth maps output by the Vis-MVSNet three-dimensional reconstruction model.

[0044] A fusion module is used to fuse the multiple depth maps to obtain a three-dimensional dense point cloud.

[0045] A prediction module is used to extract scale-invariant features of the three-dimensional dense point cloud, input the scale-invariant features into a trained support vector machine regression model, and obtain the predicted moisture content of the grain kernel output by the support vector machine regression model.

[0046] The image acquisition system comprises a control module, an air compressor, a connecting plate, a stepping motor, a stepping motor drive module, an external air tube, a suction nozzle seat, a suction nozzle, and an image shooting module; the output end of the stepping motor is fixedly connected with the suction nozzle seat, one side of the suction nozzle seat is in communication with the suction nozzle, the other side of the suction nozzle seat is in communication with the air compressor through the external air tube, and the connecting plate is rotatably connected with the stepping motor and the suction nozzle seat, respectively; the stepping motor is electrically connected with the stepping motor drive module, the control module is electrically connected with the stepping motor drive module and the air compressor, respectively, and the distance between the lens of the image shooting module and the grain kernel is 5-20 cm.

[0047] The third aspect of the present application provides a computer device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of the first aspect when executing the program.

[0048] The fourth aspect of the present application provides a computer readable storage medium, which stores a computer program, wherein the program is executable by a processor to implement the method according to any one of the first aspect.

[0049] The present application has the following beneficial effects:

[0050] The present application respectively constructs a three-dimensional model of grain kernels by three-dimensional point cloud reconstruction technology, and realizes nondestructive detection of wheat kernels by support vector machine regression technology, especially nondestructive detection of high-moisture wheat kernels, which is not affected by external factors such as environmental temperature and humidity, grain type and bulk density, and has high stability. The average absolute error (MAE) of each moisture gradient of the wheat moisture detection model is 0.5331, which shows that the accuracy has a significant advantage, and the present application automatically realizes moisture prediction by an image acquisition system, a first reconstruction module, a second reconstruction module, a fusion module and a prediction module, which is not affected by human operation and has high prediction processing efficiency.

[0051] The specific embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0052] Figure 1 A flow chart of a grain moisture detection method based on a three-dimensional point cloud model according to an embodiment of the present application is shown.

[0053] Figure 2 An HSV image of a cut grain kernel according to an embodiment of the present application is shown.

[0054] Figure 3 A total loss curve according to an embodiment of the present application is shown.

[0055] Figure 4 An uncertainty loss curve according to an embodiment of the present application is shown.

[0056] Figure 5 A schematic diagram of a grain moisture detection system according to an embodiment of the present application is shown.

[0057] Figure 6 A schematic diagram of the structure of an image acquisition system according to an embodiment of the present application is shown.

[0058] Figure 7 An electrical connection diagram of an image acquisition system according to an embodiment of the present application is shown.

[0059] Figure 8 A comparison chart of the test value and the actual value of each gradient water content of wheat provided by an embodiment of the present application is shown.

[0060] Figure 9 A structural schematic diagram of a computer system implementing the device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0061] In order to more clearly illustrate the present application, the present application will be further described below in conjunction with embodiments and drawings. Like components are denoted by the same reference numerals in the drawings. It should be understood by those skilled in the art that the specific description below is illustrative rather than limiting, and should not limit the scope of protection of the present application.

[0062] In recent years, with the continuous development of information technology, machine vision technology has become a popular technology in agricultural production and has penetrated more and more into the agricultural field. It is widely used in the detection of the shape, color, damage degree, freshness and other quality of agricultural products, which improves the detection accuracy and work efficiency of each detection link in agricultural production. Therefore, the present application takes rapid, non-destructive and stable as the core, uses advanced machine learning algorithms, deep learning algorithms and artificial intelligence theory to re-understand the detection characteristics of grain moisture, and studies the intelligent, efficient, non-destructive and stable detection method of grain moisture.

[0063] In view of this, as Figure 1 shown, an embodiment of the present application provides a grain moisture detection method, comprising:

[0064] Step S1, acquiring grain kernel images at multiple angles;

[0065] Step S2, inputting the grain kernel images at multiple angles into a sparse point cloud reconstruction platform to obtain multiple three-dimensional sparse point clouds output by the sparse point cloud reconstruction platform;

[0066] Step S3, respectively inputting the multiple three-dimensional sparse point clouds and the grain kernel images at multiple angles into a Vis-MVSNet three-dimensional reconstruction model to obtain multiple depth maps output by the Vis-MVSNet three-dimensional reconstruction model

[0067] Step S4, fusing the multiple depth maps to obtain a three-dimensional dense point cloud;

[0068] Step S5, extracting scale-invariant features of the three-dimensional dense point cloud, inputting the scale-invariant features into a trained support vector machine regression model, and obtaining a grain kernel predicted moisture content output by the support vector machine regression model.

[0069] Testing revealed that using a neural network model such as RC-MVSNET to generate depth maps resulted in a 3D dense point cloud after fusion, which suffered from long processing time and poor accuracy. This invention preferentially uses the Vis-MVSNet 3D reconstruction model as the neural network model for depth map generation, which generates a 3D dense point cloud with higher accuracy and efficiency, thereby improving the accuracy of subsequent grain moisture measurement.

[0070] In one possible implementation, before inputting the grain images from the multiple angles into the sparse point cloud reconstruction platform, the method further includes:

[0071] Step S21: Binarize the grain images from the multiple angles;

[0072] Step S22: In response to the user's adjustment operation, adjust the background of the binarized grain images from multiple angles to pure black to obtain the first intermediate image;

[0073] More specifically, this embodiment sets a grayscale threshold of 40. When the grayscale threshold of the background pixels of the grain image is greater than 40, the grayscale value of the background pixels of the grain image remains unchanged. When the grayscale threshold is less than or equal to 40, the grayscale value of the background pixels of the grain image is set to 0.

[0074] Step S23: Calculate the sum of the pixel values ​​of each row of pixels in the first intermediate image to obtain the row pixel values ​​of each row.

[0075] Step S24: Calculate the difference between the row pixel values ​​of two adjacent rows and filter out the largest difference;

[0076] Step S25: Using the two rows of pixels with the largest difference as the cropping lines, crop the first intermediate image, and retain the part with the largest sum of row pixel values ​​after cropping to obtain the cropped grain image.

[0077] like Figure 2 As shown, this embodiment takes wheat grains as the research object. Specifically, it calculates the sum of pixels in each row of the image after brightness threshold adjustment and the difference between the sums of pixels in two adjacent rows. The difference between the sums of pixels in two adjacent rows and the position of each row's pixels are then used as coordinate axes to generate a difference variation curve. Figure 2 On the right side, a peak can be observed above the particles; this is where the color change is most pronounced. Figure 2 (At the horizontal line), cut along this line to obtain the complete and pure wheat grain body.

[0078] The application adjusts the background to pure black by adjusting the brightness threshold, greatly improves the efficiency of the grain seed three-dimensional model in the subsequent step, and further improves the calculation precision of the grain seed by drawing the HSV image pixel difference to clip the HSV image and obtain the complete and pure grain main body.

[0079] In a possible implementation, the sparse point cloud reconstruction platform is COLMAP software, and the input of the plurality of grain seed images at different angles into the sparse point cloud reconstruction platform to obtain a plurality of three-dimensional sparse point clouds output by the sparse point cloud reconstruction platform comprises:

[0080] The feature points of the plurality of grain seed images at different angles are extracted by the COLMAP software, the feature points are matched, and the feature points that are wrong in the feature point matching process are corrected according to the bundle adjustment algorithm, to obtain the three-dimensional sparse point cloud. The COLMAP software uses incremental SfM, and is more flexible to use.

[0081] More specifically, the application mainly uses the "COLMAPautomatic_reconstruction" command in the COLMAP software and reconstructs the three-dimensional sparse point cloud through feature point extraction, feature point matching and volume bundle adjustment, the key parameter of the command is "quality", that is, the reconstruction quality, which is used to control the number of extracted feature points and the operation of eliminating matching errors, and we set it to the highest "extreme". Through experiments, most of the particles of the preprocessed grain seed images can be successfully reconstructed.

[0082] After preprocessing, the three-dimensional sparse point cloud of the grain seed established by the COLMAP software has higher precision, most of the particles of the preprocessed grain seed images can be successfully reconstructed, which is beneficial to improve the precision of the three-dimensional model of the grain seed.

[0083] Before the input of the plurality of three-dimensional sparse point clouds and the plurality of grain seed images at different angles into the Vis-MVSNet three-dimensional reconstruction model, the method further comprises: converting the format of the plurality of three-dimensional sparse point clouds into a format suitable for the MVSNet network.

[0084] In a possible implementation, the method for extracting features in the three-dimensional model of the grain seed comprises:

[0085] In step S41, the covariance matrix C is calculated according to the formula:

[0086]

[0087] The covariance matrix C is calculated, wherein N is the total number of point clouds of the three-dimensional model of the grain seed, A ia spatial position coordinate matrix [x, y, z] of an i-th point cloud in a three-dimensional model of the grain kernels, an average value of the position coordinates of the point cloud in the three-dimensional model of the grain kernels; that is,

[0088] Step S42, eigenvalues λ1, λ2 and λ3 of the covariance matrix C are calculated.

[0089] Step S43, a plurality of scale-invariant features are constructed according to the eigenvalues of the covariance matrix C.

[0090] The constructed scale-invariant features are as follows:

[0091] Sum feature, su = λ1 + λ2 + λ3;

[0092] Omnivariance feature,

[0093] Eigenentropy feature,

[0094] Anisotropy feature, Ani = (λ1-λ3) / λ1;

[0095] Planarity feature, Pla = (λ2-λ3) / λ1;

[0096] Linearity feature, Lin = (λ1-λ2) / λ1;

[0097] Surface Variation feature, SV = λ3 / (λ1+λ2+λ3);

[0098] Sphericity feature, Sp = λ3 / λ1.

[0099] After the above features are constructed, the eight constructed features are sequentially composed into a matrix of 1 row and 8 columns, and after normalization and transposition operations, the matrix is input into the trained support vector machine regression model and output, and then the output data is denormalized to obtain the predicted moisture content of the grain kernels.

[0100] More specifically, the covariance matrix is a matrix that describes the relationship between multi-dimensional random variables, the elements on the diagonal line of which represent the variance of each random variable, and the elements on the non-diagonal line represent the covariance between different variables. The closer the covariance matrix is to the diagonal matrix, the lower the correlation between each random variable; otherwise, the higher the correlation. In data analysis, the covariance matrix can be used to find the correlation between variables and perform principal component analysis, factor analysis and other statistical analysis methods. The point cloud covariance matrix describes the dispersion of the point cloud data in each dimension and the correlation between different dimensions. The eigenvectors and eigenvalues of the covariance matrix can be used to describe the shape and direction of the point cloud. For a point cloud, its main shape can be obtained by eigenvalue decomposition of the covariance matrix, in which the eigenvectors correspond to the offset of the point cloud in each principal axis direction, and the eigenvalues represent the dispersion in each principal axis direction.

[0101] In a possible implementation, before the extracting the scale-invariant features of the three-dimensional dense point cloud, the method further comprises: performing point cloud filtering, grid construction and multiple smoothing processing on the three-dimensional dense point cloud.

[0102] More specifically, after generating a three-dimensional dense point cloud, the point cloud is sequentially filtered, reconstructed into a grid, and smoothed multiple times. In this process, the application uses a mesh-based smoothing algorithm to perform multiple smoothing using the mesh smoothing function in Agisoft Metashape. The results are shown in Figure 3 and Figure 4 As shown, the total loss and the uncertainty loss can converge normally.

[0103] In a possible implementation, the training method of the support vector machine regression model comprises:

[0104] Step S51, obtaining a plurality of grain samples;

[0105] Step S52, obtaining a plurality of angle grain kernel images of each grain sample;

[0106] Step S53, inputting the plurality of angle grain kernel images of each grain sample into a sparse point cloud reconstruction platform to obtain a plurality of three-dimensional sparse point clouds of each grain sample output by the sparse point cloud reconstruction platform;

[0107] Step S54, inputting the plurality of three-dimensional sparse point clouds and the plurality of angle grain kernel images of each grain sample into a Vis-MVSNet three-dimensional reconstruction model to obtain a plurality of depth maps of each grain sample output by the Vis-MVSNet three-dimensional reconstruction model;

[0108] Step S55, fusing the plurality of depth maps to obtain a three-dimensional dense point cloud of each of the grain samples;

[0109] Step S56, extracting a scale-invariant feature of the three-dimensional dense point cloud of each of the grain samples;

[0110] Step S57, dividing each of the grain samples into a test grain sample and a training grain sample;

[0111] Step S58, measuring and recording a true moisture content of each of the grain samples by using an oven drying method;

[0112] Step S59, inputting the features of the training grain samples as inputs and inputting the true moisture contents of the training grain samples as training labels into a support vector machine regression model to train, to obtain a trained support vector machine regression model;

[0113] Step S510, inputting the features of the test grain samples into the trained support vector machine regression model to obtain predicted moisture contents of each of the test grain samples output by the trained support vector machine regression model;

[0114] Step S511, calculating a mean absolute error of each of the test grain samples according to the predicted moisture content of each of the test grain samples and the true moisture content of each of the test grain samples, and drawing a comparison chart.

[0115] More specifically, the present embodiment selects wheat Wanke 189 as a grain sample. Twelve moisture gradient wheat samples are prepared, and the water content of each gradient wheat is (8±1)%, (10±1)%, (12±1)%, (14±1)%, (16±1)%, (18±1)%, (20±1)%, (22±1)%, (24±1)%, (26±1)%, (28±1)%, and (30±1)%. The prepared wheat is labeled for true moisture by using an oven drying method. The present embodiment selects 50 wheat kernels for each moisture gradient, and a total of 43200 images are collected. The collected wheat kernel images are automatically processed. The functions include image preprocessing, sparse reconstruction, dense reconstruction, point cloud filtering, model smoothing, format conversion, and data arrangement. The scale-invariant features of the wheat kernels are extracted from the three-dimensional dense point cloud model, and the scale-invariant features are used for predicting the moisture content of the wheat kernels. The present embodiment tests the SVR wheat moisture detection model created by using the collected wheat data samples of different moisture contents. The prediction results of the support vector machine are as follows: Figure 8As shown, the average absolute error of each scale is 2.73, 1.51, 1.37, 0.79, 0.1, 0.89, 0.92, 0.68, 0.48, 0.20, 2.19, 2.12, respectively, and the average absolute error (MAE) of each moisture gradient is 0.5331, which meets the accuracy requirement.

[0116] On the other hand, as Figure 5 shown, the application embodiment provides a grain moisture detection system, characterized in that it comprises:

[0117] An image acquisition system 100 is configured to acquire grain kernel images at multiple angles.

[0118] A first reconstruction module 200 is configured to input the grain kernel images at multiple angles into a sparse point cloud reconstruction platform to obtain multiple three-dimensional sparse point clouds output by the sparse point cloud reconstruction platform.

[0119] A second reconstruction module 300 is configured to input the multiple three-dimensional sparse point clouds and the grain kernel images at multiple angles into a Vis-MVSNet three-dimensional reconstruction model, respectively, to obtain multiple depth maps output by the Vis-MVSNet three-dimensional reconstruction model.

[0120] A fusion module 400 is configured to fuse the multiple depth maps to obtain a three-dimensional dense point cloud.

[0121] A prediction module 500 is configured to extract scale-free correlation features of the three-dimensional dense point cloud, input the scale-free correlation features into a trained support vector machine regression model, and obtain a predicted moisture content of the grain kernel output by the support vector machine regression model.

[0122] The image acquisition system 100 comprises a control module 109, an air compressor 107, a connecting plate 104, a stepping motor 105, a stepping motor drive module 106, an external air pipe 103, a suction nozzle seat 102, a suction nozzle 101, and an image shooting module 108. The output end of the stepping motor 105 is fixedly connected with the suction nozzle seat 102. One side of the suction nozzle seat 102 is in communication with the suction nozzle 101. The other side of the suction nozzle seat 102 is in communication with the air suction end of the air compressor 107 through the external air pipe 103. The connecting plate 104 is rotatably connected with the stepping motor 105 and the suction nozzle seat 102, respectively. The stepping motor 105 is electrically connected with the stepping motor drive module 106. The control module 109 is electrically connected with the stepping motor drive module 106 and the air compressor 107, respectively. The suction nozzle 101 is configured to adsorb the grain kernel. The distance between the lens of the image shooting module 108 and the grain kernel is 5-20 cm.

[0123] More specifically, as Figure 6 and Figure 7As shown, grains are placed at the suction nozzle 101. Under the action of the air compressor 107, the suction force of the suction nozzle 101 is increased through the external air pipe 103, causing the grains to be adsorbed onto the suction nozzle 101. The control module 109 controls the stepper motor 105 to rotate at a fixed time and angle via the motor drive module. The stepper motor 105 drives the grains adsorbed on the suction nozzle 101 to rotate. Each time the stepper motor 105 rotates, the image capturing module 108 rotates.

[0124] This invention uses an air compressor 107 with a working speed of 1450 r / min and an exhaust volume of 0.3 m³ / min. The stepper motor 105 is a Nanotec PD4-EX, with a rotation angle set to 1-20 degrees and an interval time of 1-10 seconds. A 5-second interval was used to capture 72 grain photos in 6 minutes to achieve the best reconstruction effect and time. Reducing the interval angle increases the number of photos taken in one cycle, improving the accuracy of the reconstructed point cloud model, but also increases the reconstruction time and computational load; conversely, increasing the interval angle has the opposite effect. Testing showed that a rotation angle of 5° was optimal. The image capture module 108 used for taking photos is a Canon EOS R5C with a macro lens. The exposure time is 0.1-5 seconds, the shooting resolution is 1920×1080-8192×5464, JPG format, aperture f / 8, focal length 100 mm, and the distance between the lens and the grain is 5-20 cm. The optimal exposure time is 1 second, the resolution is 8192×5464, and the distance between the lens and the grain is 5 cm. This will result in the highest image clarity and the best capture of the surface texture of the wheat grains.

[0125] like Figure 9 As shown, a computer system suitable for implementing the grain moisture detection method based on a three-dimensional point cloud model provided in the above embodiments includes a central processing module (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM). The RAM also stores various programs and data required for the operation of the computer system. The CPU, ROM, and RAM are connected via a bus. An input / output (I / O) interface is also connected to the bus.

[0126] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a liquid crystal display (LCD), etc., and a speaker, etc.; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as necessary. A removable medium such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive as necessary, so that a computer program read out therefrom is installed in the storage part as necessary.

[0127] In particular, according to the present embodiment, the processes described above in the flowcharts can be implemented as a computer software program. For example, the present embodiment includes a computer program product comprising a computer program tangibly embodied on a computer readable medium, the computer program containing program code for executing the methods illustrated in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication part, and / or installed from a removable medium.

[0128] The flowcharts and diagrams in the drawings illustrate the architecture, functionality, and operations of possible implementations of systems, methods and computer program products according to various embodiments. In this regard, each block in the flowcharts or diagrams can represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the diagram and / or flowchart illustrations, and combinations thereof, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or combinations of hardware and software.

[0129] The embodiment also provides a nonvolatile computer storage medium, which can be the nonvolatile computer storage medium contained in the device in the above embodiment, or can exist independently and not be assembled into the terminal. The nonvolatile computer storage medium stores one or more programs, and when the one or more programs are executed by a device, the device is caused to: acquire a plurality of angle grain images; input the plurality of angle grain images into a sparse point cloud reconstruction platform to obtain a plurality of three-dimensional sparse point clouds output by the sparse point cloud reconstruction platform; input the plurality of three-dimensional sparse point clouds and the plurality of angle grain images respectively into a Vis-MVSNet three-dimensional reconstruction model to obtain a plurality of depth maps output by the Vis-MVSNet three-dimensional reconstruction model; fuse the plurality of depth maps to obtain a three-dimensional dense point cloud; extract a scale-free correlation feature of the three-dimensional dense point cloud, and input the scale-free correlation feature into a support vector machine regression model trained to obtain a grain predicted moisture content output by the support vector machine regression model.

[0130] The application respectively constructs a three-dimensional model of grain by three-dimensional point cloud reconstruction technology, and realizes nondestructive detection of wheat grains by support vector machine regression technology, especially realizes nondestructive detection of high-moisture wheat grains, is not affected by external factors such as environmental temperature and humidity, grain type and bulk density, has high stability, the average value of mean absolute error (MAE) of each moisture gradient of the wheat moisture detection model is 0.5331, so the accuracy has a significant advantage, and the application respectively realizes automatic moisture prediction by the image acquisition system 100, the first reconstruction module 200, the second reconstruction module 300, the fusion module 400 and the prediction module 500, is not affected by human operation, and the prediction processing efficiency is high.

[0131] In the description of the present application, it should be noted that the positions or position relationships indicated by the terms "upper", "lower" and the like are based on the positions or position relationships shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular position, be constructed and operated in a particular position, and therefore cannot be understood as a limitation on the present application. Unless otherwise specified and limited, the terms "mounting", "connection", "connection" should be understood broadly, for example, can be fixed connection, can also be detachable connection, or integral connection; can be mechanical connection, can also be electrical connection; can be directly connected, can also be indirectly connected through an intermediate medium, and can be the communication between two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0132] It is further noted that the terminology "first", "second" and the like used in the description of the application is merely intended to differentiate one entity or operation from another, without necessarily requiring or implying any actual such relationship or order between such entities or operations. Moreover, the use of the term "including", "containing" or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or even inherent to such process, method, article or apparatus. An element proceeded by "comprises... a", "has... a", "includes... a" or "contains... a", does not, without more constraints, preclude the existence of additional identical elements in the process, method, article or apparatus that comprises the element.

[0133] Obviously, the above-described embodiments of the application are only examples for clearly illustrating the application, and are not intended to limit the implementation of the application. Based on the above description, other different forms of changes or variations can be made by those skilled in the art, and it is impossible to enumerate all the embodiments here. Any obvious changes or variations derived from the technical solutions of the application are still within the protection scope of the application.

Claims

1. A method of detecting moisture in grain, characterized by, The method comprises the following steps: acquiring a plurality of grain seed images at different angles; inputting the plurality of grain seed images at different angles into a sparse point cloud reconstruction platform to obtain a plurality of three-dimensional sparse point clouds output by the sparse point cloud reconstruction platform; respectively inputting the plurality of three-dimensional sparse point clouds and the plurality of grain seed images at different angles into a Vis-MVSNet three-dimensional reconstruction model to obtain a plurality of depth maps output by the Vis-MVSNet three-dimensional reconstruction model; fusing the plurality of depth maps to obtain a three-dimensional dense point cloud; extracting scale-invariant features of the three-dimensional dense point cloud, inputting the scale-invariant features into a trained support vector machine regression model, and obtaining a grain seed predicted moisture content output by the support vector machine regression model; before the step of inputting the plurality of grain seed images at different angles into the sparse point cloud reconstruction platform, the method further comprises the following steps: performing binaryzation processing on the plurality of grain seed images at different angles; in response to an adjustment operation of a user, adjusting the background of the binaryzated plurality of grain seed images at different angles to pure black to obtain a first intermediate image; calculating the sum of pixel values of each row of pixels in the first intermediate image to obtain row pixel values of each row of pixels, calculating the difference between row pixel values of adjacent two rows of pixels, and screening out a maximum difference value; taking the two rows of pixels where the maximum difference value is located as a cropping line, cropping the first intermediate image, and retaining the part with a larger sum of row pixel values after cropping to obtain a cropped grain seed image.

2. The method of claim 1, wherein, The sparse point cloud reconstruction platform is COLMAP software, and the step of inputting the plurality of grain seed images at different angles into the sparse point cloud reconstruction platform to obtain a plurality of three-dimensional sparse point clouds output by the sparse point cloud reconstruction platform comprises the following steps: extracting feature points of the plurality of grain seed images at different angles by using the COLMAP software, performing feature point matching on the feature points, and correcting the feature points that are wrong in the feature point matching process according to a bundle adjustment algorithm to obtain three-dimensional sparse point clouds.

3. The method of claim 2, wherein, Before the step of respectively inputting the plurality of three-dimensional sparse point clouds and the plurality of grain seed images at different angles into the Vis-MVSNet three-dimensional reconstruction model, the method further comprises the following step: converting the format of the plurality of three-dimensional sparse point clouds into a format suitable for the MVSNet network.

4. The method of claim 1, wherein, extracting scale-invariant features of the three-dimensional dense point cloud according to the formula: The covariance matrix C is calculated, wherein N is the total number of point clouds of the three-dimensional model of the grain kernels, is the spatial position coordinate matrix of the i-th point cloud in the three-dimensional model of the grain kernels , is the average value of the position coordinates of the point clouds in the three-dimensional model of the grain kernels. calculating eigenvalues of the covariance matrix C; constructing a plurality of scale-invariant features according to the eigenvalues of the covariance matrix C.

5. The method of claim 1, wherein, Before the step of extracting the scale-invariant features of the three-dimensional dense point cloud, the method further comprises the following steps: performing point cloud filtering, constructing a grid, and performing multiple smoothing processing on the three-dimensional dense point cloud.

6. The method of claim 1, wherein, Before the step of inputting the scale-invariant features into the trained support vector machine regression model, the method further comprises the following steps: acquiring a plurality of grain samples; acquiring a plurality of grain seed images at different angles of each grain sample; inputting the plurality of grain seed images at different angles of each grain sample into a sparse point cloud reconstruction platform to obtain a plurality of three-dimensional sparse point clouds of each grain sample output by the sparse point cloud reconstruction platform; inputting the multiple three-dimensional sparse point clouds and the multiple angle grain kernel images of each of the grain samples into a Vis-MVSNet three-dimensional reconstruction model to obtain multiple depth maps output by the Vis-MVSNet three-dimensional reconstruction model; fusing the multiple depth maps to obtain a three-dimensional dense point cloud of each of the grain samples; extracting scale-invariant features of the three-dimensional dense point cloud of each of the grain samples; dividing each of the grain samples into a test grain sample and a training grain sample; measuring and recording the true moisture content of each of the grain samples by using an oven drying method; training a support vector machine regression model by inputting the features of the training grain samples as input and the true moisture content of the training grain samples as training labels into the support vector machine regression model respectively to obtain a trained support vector machine regression model; inputting the features of the test grain sample into the trained support vector machine regression model to obtain the predicted moisture content of each of the test grain samples output by the trained support vector machine regression model; calculating the mean absolute error of each of the test grain samples according to the predicted moisture content of each of the test grain samples and the true moisture content of each of the test grain samples respectively and drawing a comparison chart.

7. A grain moisture detection system characterized by, comprise: an image acquisition system configured to acquire multiple angle grain kernel images; a first reconstruction module configured to input the multiple angle grain kernel images into a sparse point cloud reconstruction platform to obtain multiple three-dimensional sparse point clouds output by the sparse point cloud reconstruction platform; a second reconstruction module configured to input the multiple three-dimensional sparse point clouds and the multiple angle grain kernel images into a Vis-MVSNet three-dimensional reconstruction model respectively to obtain multiple depth maps output by the Vis-MVSNet three-dimensional reconstruction model; a fusion module configured to fuse the multiple depth maps to obtain a three-dimensional dense point cloud; a prediction module configured to extract scale-invariant features of the three-dimensional dense point cloud, input the scale-invariant features into a trained support vector machine regression model, and obtain grain kernel predicted moisture content output by the support vector machine regression model; wherein the image acquisition system comprises a control module, an air compressor, a connecting plate, a stepping motor, a stepping motor drive module, an external air tube, a suction nozzle seat, a suction nozzle, and an image shooting module; the output end of the stepping motor is fixedly connected with the suction nozzle seat, one side of the suction nozzle seat is in communication with the suction nozzle, the other side of the suction nozzle seat is in communication with the air compressor through the external air tube, and the connecting plate is rotationally connected with the stepping motor and the suction nozzle seat respectively; the stepping motor is electrically connected with the stepping motor drive module, the control module is electrically connected with the stepping motor drive module and the air compressor respectively, and the distance between the lens of the image shooting module and the grain kernel is 5-20 cm; before the multiple angle grain kernel images are input into the sparse point cloud reconstruction platform, the first reconstruction module is further configured to: perform binaryzation processing on the multiple angle grain kernel images; in response to an adjustment operation of a user, adjust the background of the binaryzation processed multiple angle grain kernel images to pure black to obtain a first intermediate image; The sum of pixel values of pixels in each row of the first intermediate image is calculated to obtain row pixel values of the pixels in each row; the difference between the row pixel values of two adjacent rows of pixels is calculated, and the maximum difference is selected; the first intermediate image is cropped with the two rows of pixels where the maximum difference is located as the cropping lines, and the part with larger sum of row pixel values is retained after cropping to obtain a cropped grain kernel image.

8. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method in any one of claims 1-6 when executing the program.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method in any one of claims 1-6.

Citation Information

Patent Citations

  • Grain moisture content detecting method based on hyperspectral image technology

    CN102033043A

  • 3D reconstruction method and device based on multi-view image and related equipment

    CN115222889A