An online soil salt content measurement method based on surface crack texture features

By capturing images of soil surface cracks and using random forest machine learning to build a predictive model, this method solves the problems of expensive equipment and susceptibility to interference in traditional methods, as well as the poor mobility of remote sensing methods. It achieves rapid, accurate, and low-cost measurement of soil salinity, and is suitable for real-time monitoring and improvement of saline-alkali soils.

CN122289337APending Publication Date: 2026-06-26ANHUI AGRICULTURAL UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI AGRICULTURAL UNIVERSITY
Filing Date
2026-02-13
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing methods for measuring soil salinity and alkalinity suffer from problems such as expensive equipment, susceptibility to interference, poor mobility, and low temporal resolution of remote sensing methods, making it difficult to achieve rapid, accurate, and non-destructive measurement of soil salinity.

Method used

By capturing images of cracks on the soil surface, extracting texture features using geometric correction and grayscale processing, and combining random forest machine learning to build a prediction model, non-destructive online measurement of soil salinity can be achieved.

Benefits of technology

It enables rapid, accurate, low-cost, and interference-resistant measurement of soil salinity, reduces soil erosion, improves temporal resolution and measurement accuracy, and is suitable for real-time monitoring and improvement of saline-alkali soils.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_16
    Figure SMS_16
  • Figure SMS_17
    Figure SMS_17
  • Figure SMS_18
    Figure SMS_18
Patent Text Reader

Abstract

This invention discloses an online method for measuring soil salinity based on surface crack texture features, belonging to the field of soil testing. The method first standardizes and acquires surface crack images of saline-alkali soil in the field. After preprocessing including geometric distortion correction, cropping, grayscale conversion, and histogram equalization, grayscale co-occurrence matrices in four directions and 13 types of statistical texture features are extracted. Then, the importance of these features is calculated and normalized using the random forest method, and a prediction model is established based on a cumulative importance threshold. Finally, the optimal model is selected based on complexity, and the corresponding texture features of the soil to be tested are extracted to complete the online measurement of salinity. This method relies on the mathematical relationship between soil cracks and salinity to achieve measurement, and has advantages such as being non-destructive, low-cost, anti-interference, and highly mobile. It can be standardized and automated, and is suitable for real-time monitoring of salinity in saline-alkali soils.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of soil testing, specifically relating to an online method for measuring soil salinity based on surface crack texture characteristics. Background Technology

[0002] As a major form of land degradation in arid and semi-arid regions, soil salinization leads to soil structure damage, decreased soil fertility, reduced crop yields, and even agricultural shutdowns. Furthermore, soil salinization poses a serious threat to the environment. Besides the influence of natural factors such as topography, soil parent material, climate, and hydrology, human activities are considered to play a significant role in soil salinization, particularly secondary salinization in arid and semi-arid regions. Their impact on soil salinization is mainly concentrated in agricultural activities, especially unreasonable irrigation, excessive deforestation, over-cultivation, and overgrazing, which severely damage soil structure, leading to rising groundwater levels and water-salt imbalances, further promoting the accumulation of salt minerals on the soil surface. Therefore, rapid, accurate, and efficient measurement of soil salinity is of significant practical importance for determining the degree of soil salinization, improving the physicochemical properties of saline-alkali soils, and achieving soil remediation.

[0003] In existing methods for measuring the salinity of saline-alkali soils, most methods focus on field collection of soil samples, drying them, and then analyzing the prepared soil extracts in the laboratory. This traditional method suffers from significant time lag and often requires substantial manpower, material resources, and financial investment. While geodetic conductivity meters can measure soil salinity non-contactly by considering the relative relationship between the primary and secondary magnetic fields, these instruments are expensive, highly sensitive, and susceptible to environmental and soil physicochemical variations. Remote sensing inversion methods can extract information about saline-alkali soils from the spectral characteristics of soil and halophyte vegetation, but the electromagnetic radiation signals received by the sensors are typically limited by the instrument's signal-to-noise ratio and measurement altitude. Furthermore, remote sensing images present numerous challenges, such as wide bandwidth and pixel mixing, and the spatial resolution and accuracy of the predicted results are difficult to guarantee for practical applications. Therefore, developing a rapid, efficient, and non-destructive method for measuring soil salinity, tailored to the specific characteristics of the soil, has become an urgent and pressing issue. Summary of the Invention

[0004] To address the aforementioned shortcomings, this invention provides an online method for measuring soil salinity based on surface crack texture characteristics. This method solves the problems of high cost and susceptibility to interference associated with traditional methods using geodetic conductivity meters, and poor mobility and low temporal resolution of remote sensing methods. It aims to provide a fast, accurate, non-destructive, low-cost, simple-to-operate, and interference-resistant online measurement solution to meet the needs of real-time monitoring and improvement of salinity in saline-alkali soils.

[0005] The technical solution adopted in this invention is as follows: an online method for measuring soil salinity based on surface crack texture characteristics, comprising the following steps:

[0006] Step 1: Standardized acquisition of soil crack images: Standardized photography of cracked, sticky, saline-alkali soil surface images under natural field conditions at a fixed height.

[0007] Step 2: Preprocessing of soil crack images: Under dry conditions, the geometric distortion of the standardized crack image is corrected using the geometric shape of the geometric calibration plate. The soil crack image is cropped according to the number of pixels corresponding to the actual size of the ruler. The cropped crack image of uniform size is then converted to grayscale and histogram equalization is performed on the grayscale image.

[0008] Step 3, Crack Image Texture Feature Extraction: For the preprocessed histogram equalized image, calculate its second-order combination conditional probability density in different directions and variation intervals. Based on the second-order combination conditional probability values ​​of different gray values, construct a gray-level co-occurrence matrix. Then, use the element values ​​of the gray-level co-occurrence matrix to calculate different types of statistical texture features.

[0009] Step 4: Establishment of the salinity prediction model: Using the random forest machine learning method, the importance of the extracted statistical texture features of all cracked soil samples is calculated and normalized. Based on the normalization results, the cumulative normalized importance threshold parameter is determined. Based on the selected cumulative importance threshold, texture features are selected to establish a soil salinity prediction model.

[0010] Step 5: Non-destructive online measurement of soil salinity: Combining computational and time complexity, the optimal prediction model is selected from the texture feature prediction models corresponding to different importance thresholds. The importance threshold corresponding to the model and the specific texture features to be selected are determined. The specific texture features corresponding to the crack features on the soil surface in the field to be measured are extracted. The extraction results are then fed into the optimal prediction model to realize the measurement of soil salinity.

[0011] Furthermore, the specific operation of standardized photography in step 1 includes: fixing the digital camera on a metal bracket, adjusting the camera to be horizontal using a spirit level, and setting a fixed height for the camera lens from the ground; marking the center position of the camera lens on the ground, using this position as the center of a rectangular frame and determining the direction of the rectangular frame using a compass; adjusting the white balance of the camera using a standard color chart and then taking a picture of the rectangular frame area, and finally placing a geometric calibration plate inside the rectangular frame to complete the shooting.

[0012] Furthermore, the geometric distortion correction process described in step 2 is implemented using ArcGIS software. Specifically, sample points of the geometric calibration plate are collected in the geometric correction module of ArcGIS software, and a polynomial geometric correction model is established based on the sampling results of the correction points. This model is then used to correct the geometric distortion of the soil crack image. The grayscale processing involves extracting the red, green, and blue components of the cropped image, calculating the arithmetic mean of the three color components to obtain a grayscale image, performing histogram equalization on the grayscale image, and calculating the statistical texture features of the histogram equalized image in different directions.

[0013] Furthermore, the different directions mentioned in step 3 are four directions: 0°, 45°, 90°, and 135°. The statistical texture features include contrast, energy, entropy, consistency, correlation, cluster shadow, cluster prominence, maximum probability, sum average, sum entropy, sum variance, related information feature one, and related information feature two. In order to remove the influence of direction, the texture feature extraction results of the same type of gray-level co-occurrence matrix in the four directions are arithmetically averaged to obtain the dataset of each statistical texture feature.

[0014] Furthermore, the contrast dataset is T1, the energy dataset is T2, the entropy dataset is T3, the consistency dataset is T4, the correlation dataset is T5, the cluster shadow dataset is T6, the cluster salience dataset is T7, the maximum probability dataset is T8, the sum average dataset is T9, the sum entropy dataset is T10, the sum variance dataset is T11, the relevant information feature one dataset is T12, and the relevant information feature two dataset is T13. All feature datasets are merged into dataset T, and the calculation formulas for each statistical texture feature are as follows:

[0015] Contrast Ratio:

[0016] energy:

[0017] entropy:

[0018] consistency:

[0019] Correlation:

[0020] Cluster shade: ,

[0021] Cluster prominence:

[0022] Maximum probability:

[0023] And average:

[0024] Sum of entropy:

[0025] Sum of variance:

[0026] Feature 1 of relevant information:

[0027] Related Information Feature Two:

[0028] The calculation formulas for the intermediate variables in each formula are as follows:

[0029]

[0030]

[0031]

[0032]

[0033]

[0034]

[0035] In the formula, It is a normalized gray-level co-occurrence matrix Position element value; It is the gray level of the co-occurrence matrix; All are positive integers; , In the horizontal direction and in the vertical direction The mean; , In the horizontal direction and in the vertical direction The variance of ; n is the gray level.

[0036] Furthermore, the specific operations for calculating importance using the random forest machine learning method described in step 4 include:

[0037] S41. Standardize the dataset of all statistical texture features so that the values ​​of each texture feature are between 0 and 1, thus obtaining a standardized texture feature dataset.

[0038] S42. Load the normalized texture feature dataset into the Random Forest module of MATLAB and calculate the importance of each normalized texture feature.

[0039] S43. Normalize the importance calculation results, sort all normalized importance values ​​from largest to smallest, and set multiple cumulative normalized importance threshold parameters.

[0040] S44. Sum the normalized importance values ​​from largest to smallest, select the minimum number of texture features whose total normalized cumulative importance is greater than a set threshold as independent variables, and use the actual soil salinity dataset as the dependent variable to establish a multiple linear regression model for predicting soil salinity.

[0041] Furthermore, the cumulative normalized importance threshold parameters mentioned in step 4 are set to 0.7, 0.8, and 0.9, respectively, to establish three different soil salinity prediction models.

[0042] Furthermore, the selection of the optimal prediction model in step 5 is based on the model's computational complexity and time complexity, and the measurement process of the soil in the area to be measured is consistent with the process of image acquisition, preprocessing, and feature extraction of the sample soil.

[0043] The principle of this invention is as follows: Higher salt content in saline-alkali soils results in a greater number of exchangeable cations. The bound water film formed between these cations and soil particles exerts a stronger attenuation effect on the soil's shear strength and cohesion, leading to more pronounced surface cracking. Texture features can effectively quantify the cracking condition of the soil surface, as well as the spatial distribution and randomness of the cracks. Therefore, they exhibit a clear mathematical relationship with soil salinity and can be used to predict soil salinity.

[0044] The key advantages and benefits of this invention are as follows: Compared with traditional field sampling and laboratory measurement of soil salinity, the method involved in this invention does not require damage to the original soil, thus reducing soil erosion. Compared with real-time measurement methods such as geodetic conductivity meters, the method involved in this invention is less expensive, simpler to operate, and less affected by environmental and soil physicochemical properties. Compared with remote sensing methods, the salinity measurement method involved in this invention is highly mobile, has high temporal resolution, and can measure soil salinity levels in real time. Furthermore, the method of this invention achieves standardized processing and high accuracy in image processing and parameter extraction, and can be automated and batch-processed through computer programming technology. Detailed Implementation

[0045] The embodiments of the present invention will be described in further detail below with reference to examples. These examples are for illustrative purposes only and should not be construed as limiting the scope of the invention.

[0046] Example 1

[0047] A method for online measurement of soil salinity based on surface crack texture features includes the following steps:

[0048] Step 1: The equipment used includes a metal support frame, a spirit level, a compass, a black and white checkerboard calibration board, a rectangular wooden frame with an inner diameter of 50 cm * 50 cm, a standard colorimetric board, a fixed-focus digital camera, and a laptop computer, etc., to standardize the photographing of the surface condition of 20 cracked, clayey, saline-alkali soil samples selected under natural field conditions. The specific steps are as follows:

[0049] S11. Fix the digital camera on the metal bracket, place the spirit level above the digital camera, adjust the angle of the digital camera until the camera is horizontal, and adjust the camera height so that the lens is 1 m above the ground.

[0050] S12. Mark the center position of the digital camera lens on the ground, and use this position as the center of the diagonal of the rectangular frame, that is, the center of the rectangular frame. Spray black paint on a fixed side of the rectangular wooden frame and mark it as the east-west direction as the reference of the rectangular frame.

[0051] S13. Determine the due north direction using the compass, and adjust the direction of the rectangular frame with the rectangular frame as the center to ensure that the reference of the rectangular frame is perpendicular to the due north direction.

[0052] S14. Adjust the white balance of the camera using a standard color chart, and then take a picture of the rectangular frame using a digital camera. Finally, prepare a square cardboard with a side length of 50 cm, draw a 2 cm × 2 cm black and white checkerboard on the cardboard to make a black and white checkerboard calibration board, and accurately place the calibration board inside the rectangular frame. Take another picture of the black and white checkerboard calibration board on the ground surface using a digital camera for later geometric distortion correction of the crack images. The entire above photography process serves as a standardized acquisition process for photographs of the surface crack conditions of cracked saline-alkali soil under natural field conditions. The surface crack conditions of all soil sample points selected in the embodiment are photographed using the above standardization process. After taking standardized surface crack images of the sample points, surface soil samples at a height of 0-20 cm at the center of the sample frame are collected, and the actual salinity of the soil samples is measured in the laboratory. The salinity dataset S of all soil samples is saved.

[0053] Step 2: Digital camera images exhibit geometric distortion. The distortion decreases closer to the projection center and increases towards the edges of the image. In the black-and-white grid calibration board, all grids are identical squares, and the angle between the grid intersections is 90°. The specific steps are as follows:

[0054] S21. Open the standardized photo of the black and white checkerboard calibration board in ArcGIS software. In the geometric correction module of ArcGIS software, collect sample points at all intersections of the black and white checkerboard calibration board. Based on the sampling results of the correction points, correct the calibration board image with geometric distortion. Record the row and column numbers in the image corresponding to the first pixel in the upper left corner of the calibration board after correction. The last pixel in the lower right corner of the calibration plate corresponds to the row and column number in the image. At the same time, the polynomial geometric correction model established using the sampling points is saved;

[0055] S22. Load standardized photos of cracked soil surfaces into ArcGIS software, and load the polynomial geometric correction model established by the black and white checkerboard calibration process to realize geometric correction of soil surface crack images under standardized photography conditions in the ArcGIS geometric correction module.

[0056] S23. Crop the corrected soil surface crack image, load the geometrically corrected soil surface crack image into MATLAB software, and save the image variable as... The first pixel in the upper left corner of the calibration plate corresponds to the row and column number in the image. The last pixel in the lower right corner of the calibration plate corresponds to the row and column number in the image. This function crops an image and saves the result as... I1 corresponds to all pixels in image I in rows R1 to R2 and columns L1 to L2, resulting in a standard crack region image of 50 cm × 50 cm inside the sample frame after geometric correction. Extract the red image component of the cropped image I2. Green image component and blue image component Calculate the arithmetic mean of the three color image components. This method enables grayscale processing of standard crack region images to obtain grayscale images of the standard crack region. ;

[0057] S24. Grayscale images of the standard crack regions of all sample points. Perform histogram equalization and save the result; this is the histogram equalized image of the sample. .in, Let F represent the row and column numbers of the pixels, respectively. The set of histogram equalization plots for all 20 soil sample points is denoted as F.

[0058] Step 3: Histogram equalization of the preprocessed image Calculate histogram equalization of the image The second-order combination conditional probability density at four directions (0°, 45°, 90°, and 135°) and a gray-level interval of 40 pixels. The calculation formula is as follows:

[0059]

[0060] in, Histogram equalization image of cracked samples In the Okay, number Columns, that is, in the histogram equalized image The grayscale value at the location point Histogram equalization image of cracked samples In the Okay, number Columns, that is, in the histogram equalized image The gray values ​​at the location points are used to histogram equalize the image. Conditional probability density of all second-order combinations under each combination of direction and variation interval. The values ​​are stored as gray-level co-occurrence matrices M. Specifically, M1 is the gray-level co-occurrence matrix at 0°; M2 at 45°; M3 at 90°; and M4 at 135°. To further quantify the texture features of soil surface cracks, the texture feature quantity of each element in the gray-level co-occurrence matrix is ​​calculated, using the following formula:

[0061] Contrast:

[0062] energy:

[0063] entropy:

[0064] consistency:

[0065] Correlation:

[0066] Cluster shade: ,

[0067] Cluster prominence:

[0068] Maximum probability:

[0069] And average:

[0070] Sum of entropy:

[0071] Sum of variance:

[0072] Feature 1 of relevant information:

[0073] Related Information Feature Two:

[0074] The formula for calculating intermediate variables in the formula is as follows:

[0075]

[0076]

[0077]

[0078]

[0079]

[0080] In the formula, It is a normalized gray-level co-occurrence matrix The position element value is the gray level of any pixel in the histogram-equalized image I4(x,y). The probability value of simultaneous occurrence is the element value corresponding to the i-th row and j-th column in the gray-level co-occurrence matrix; It is the gray level of the co-occurrence matrix. All are positive integers; , In the horizontal direction and in the vertical direction The mean; , In the horizontal direction and in the vertical direction The variance of ; n is the gray level.

[0081] Since the development of surface cracks in soil is random, to remove the influence of direction, the texture feature extraction results of each gray-level co-occurrence matrix in the 0°, 45°, 90°, and 135° directions of the sample points are arithmetically averaged and stored. The datasets are as follows: contrast dataset T1, energy dataset T2, entropy dataset T3, consistency dataset T4, correlation dataset T5, cluster shadow dataset T6, cluster saliency dataset T7, maximum probability dataset T8, sum average dataset T9, sum entropy dataset T10, sum variance dataset T11, relevant information feature 1 dataset T12, and relevant information feature 2 dataset T13. All texture feature datasets are further stored as dataset T.

[0082] Step 4: Calculate the importance of all surface-cracked saline-alkali soil samples using the random forest method, and select the optimal set of texture features based on importance to establish a predictive model for soil salinity. The specific steps are as follows:

[0083] S41. Standardize all texture features of the soil sample points so that the range of each type of texture feature is between 0 and 1. Specifically, the contrast-standardized dataset is T1', the energy-standardized dataset is T2', the entropy-standardized dataset is T3', the consistency-standardized dataset is T4', the correlation-standardized dataset is T5', the cluster shadow-standardized dataset is T6', the cluster salience-standardized dataset is T7', the maximum probability-standardized dataset is T8', the sum-mean-standardized dataset is T9', the sum-entropy-standardized dataset is T10', the sum-variance-standardized dataset is T11', the relevant information feature 1-standardized dataset is T12', and the relevant information feature 2-standardized dataset is T13'. Store all standardized texture feature datasets as T'.

[0084] S42. In the Random Forest module of MATLAB, load the dataset T' of standardized texture features for all sample points, and calculate the importance W of each standardized texture feature in T', where the importance of contrast is W1, energy is W2, entropy is W3, consistency is W4, correlation is W5, clustering is W6, cluster salience is W7, maximum probability is W8, sum-mean is W9, sum-entropy is W10, sum-variance is W11, relevant information feature 1 is W12, and relevant information feature 2 is W13.

[0085] S43. Normalize the importance calculation results, where the normalized importance of contrast is W1', energy is W2', entropy is W3', consistency is W4', correlation is W5', cluster shadow is W6', cluster salience is W7', maximum probability is W8', sum average is W9', sum entropy is W10', sum variance is W11', relevant information feature 1 is W12', and relevant information feature 2 is W13'. All normalized importance values ​​are sorted from largest to smallest. Thresholds Q1=0.7, Q2=0.8, and Q3=0.9 are set as cumulative importance measures. The normalized importance values ​​are summed sequentially from largest to smallest. The texture feature types with the fewest sums of normalized cumulative importance values ​​greater than the set thresholds are selected. The selected different types of texture features are used as independent variables to establish a multiple linear regression model with the salt content dataset S.

[0086] In actual modeling, the cumulative importance threshold is set to Q2=0.8. If the sum of the highest normalized importance W1', W3', W7', and W11' just exceeds the threshold of 0.8, then the corresponding standardized texture feature datasets T1', T3', T7', and T11' can be used as the independent variable datasets, and the salinity dataset S can be used as the dependent variable dataset. A multiple linear regression model for salinity is established: Y=k0+k1×T1'+k2×T3'+k3×T7'+k4×T11', where k0, k1, k2, k3, and k4 are the constant term and the parameter term of the independent variable, respectively. The constant term and parameter term are calculated by solving the equation using the modeling dataset.

[0087] Step 5: Combining the scheme in Step 4, for the cumulative importance threshold Q1=0.7, select the corresponding texture features to establish a salinity prediction model Y1; for the cumulative importance threshold Q2=0.8, select the corresponding texture features to establish a salinity prediction model Y2; for the cumulative importance threshold Q3=0.9, select the corresponding texture features to establish a salinity prediction model Y3. Considering the time complexity of the modeling process, select the optimal salinity prediction model formula from Y1, Y2, and Y3. In actual soil salinity measurement work, standardized photos of soil surface cracking to be measured are taken in Step 1. The cracked images of the soil surface to be measured are preprocessed according to Step 2. The texture feature data corresponding to the optimal prediction model are calculated according to Step 3. The calculated specific texture features are then input into the optimal salinity prediction model, thus achieving accurate, rapid, and non-destructive measurement of the salinity of the sample.

Claims

1. A method for online measurement of soil salinity based on surface crack texture characteristics, characterized in that, Includes the following steps: Step 1: Standardized acquisition of soil crack images: Standardized photography of cracked, sticky, saline-alkali soil surface images under natural field conditions at a fixed height. Step 2: Preprocessing of soil crack images: Under dry conditions, the geometric distortion of the standardized crack image is corrected using the geometric shape of the geometric calibration plate. The soil crack image is cropped according to the number of pixels corresponding to the actual size of the ruler. The cropped crack image of uniform size is then converted to grayscale and histogram equalization is performed on the grayscale image. Step 3, Crack Image Texture Feature Extraction: For the preprocessed histogram equalized image, calculate its second-order combination conditional probability density in different directions and variation intervals. Based on the second-order combination conditional probability values ​​of different gray values, construct a gray-level co-occurrence matrix. Then, use the element values ​​of the gray-level co-occurrence matrix to calculate different types of statistical texture features. Step 4: Establishment of the salinity prediction model: Using the random forest machine learning method, the importance of the extracted statistical texture features of all cracked soil samples is calculated and normalized. Based on the normalization results, the cumulative normalized importance threshold parameter is determined. Based on the selected cumulative importance threshold, texture features are selected to establish a soil salinity prediction model. Step 5: Non-destructive online measurement of soil salinity: Combining computational and time complexity, the optimal prediction model is selected from the texture feature prediction models corresponding to different importance thresholds. The importance threshold corresponding to the model and the specific texture features to be selected are determined. The specific texture features corresponding to the crack features on the soil surface in the field to be measured are extracted. The extraction results are then fed into the optimal prediction model to realize the measurement of soil salinity.

2. The method for online measurement of soil salinity based on surface crack texture features according to claim 1, characterized in that, The specific operations for standardized photography described in step 1 include: fixing the digital camera on a metal bracket, adjusting the camera to be horizontal using a spirit level, and setting a fixed height for the camera lens from the ground; marking the center position of the camera lens on the ground, using this position as the center of a rectangle and determining the direction of the rectangle using a compass; adjusting the white balance of the camera using a standard color chart and then photographing the area within the rectangle; finally, placing a geometric calibration plate inside the rectangle to complete the photograph.

3. The method for online measurement of soil salinity based on surface crack texture features according to claim 1, characterized in that, The geometric distortion correction process described in step 2 is implemented using ArcGIS software. Specifically, sample points of the geometric calibration plate are collected in the geometric correction module of ArcGIS software. A polynomial geometric correction model is established based on the sampling results of the correction points, and the model is used to correct the geometric distortion of the soil crack image. The grayscale processing involves extracting the red, green, and blue components of the cropped image, calculating the arithmetic mean of the three color components to obtain a grayscale image, performing histogram equalization on the grayscale image, and calculating the statistical texture features of the histogram equalized image in different directions.

4. The method for online measurement of soil salinity based on surface crack texture features according to claim 1, characterized in that, The different directions mentioned in step 3 are 0°, 45°, 90°, and 135°. The statistical texture features include contrast, energy, entropy, consistency, correlation, cluster shadow, cluster prominence, maximum probability, sum average, sum entropy, sum variance, related information feature one, and related information feature two. After removing the influence of direction, the texture feature extraction results of the same type of gray-level co-occurrence matrix in the four directions are arithmetically averaged to obtain the dataset of each statistical texture feature.

5. The method for online measurement of soil salinity based on surface crack texture characteristics according to claim 4, characterized in that, in, The datasets are: Contrast (T1), Energy (T2), Entropy (T3), Consistency (T4), Correlation (T5), Cluster Shading (T6), Cluster Salience (T7), Maximum Probability (T8), Sum Mean (T9), Sum Entropy (T10), Sum Variance (T11), Related Information Feature 1 (T12), and Related Information Feature 2 (T13). All feature datasets are merged into dataset T. The formulas for calculating each statistical texture feature are as follows: Contrast Ratio: energy: entropy: consistency: Correlation: Cluster shade: , Cluster prominence: Maximum probability: And average: Sum of entropy: Sum of variance: Feature 1 of relevant information: Related Information Feature Two: The calculation formulas for the intermediate variables in each formula are as follows: In the formula, It is a normalized gray-level co-occurrence matrix Position element value; It is the gray level of the co-occurrence matrix; All are positive integers; , In the horizontal direction and in the vertical direction The mean; , In the horizontal direction and in the vertical direction The variance of ; n is the gray level.

6. The method for online measurement of soil salinity based on surface crack texture features according to claim 1, characterized in that, The specific operations for importance calculation using the random forest machine learning method described in step 4 include: S41. Standardize the dataset of all statistical texture features so that the values ​​of each texture feature are between 0 and 1, thus obtaining a standardized texture feature dataset. S42. Load the normalized texture feature dataset into the Random Forest module of MATLAB and calculate the importance of each normalized texture feature. S43. Normalize the importance calculation results, sort all normalized importance values ​​from largest to smallest, and set multiple cumulative normalized importance threshold parameters. S44. Sum the normalized importance values ​​from largest to smallest, select the minimum number of texture features whose total normalized cumulative importance is greater than a set threshold as independent variables, and use the actual soil salinity dataset as the dependent variable to establish a multiple linear regression model for predicting soil salinity.

7. The online soil salinity measurement method based on surface crack texture features according to claim 6, characterized in that, In step 4, the cumulative normalized importance threshold parameters are set to 0.7, 0.8, and 0.9, respectively, which correspond to the establishment of three different soil salinity prediction models.

8. The method for online measurement of soil salinity based on surface crack texture features according to claim 1, characterized in that, The selection of the optimal prediction model in step 5 is based on the model's computational complexity and time complexity, and the measurement process of the soil in the area to be measured is consistent with the process of image acquisition, preprocessing, and feature extraction of the sample soil.