Method for adaptive selection of soil identification subgraph

CN116168294BActive Publication Date: 2026-09-18CHONGQING NORMAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310129860.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-17
Publication Date
2026-09-18
Estimated Expiration
2043-02-17

AI Technical Summary

Technical Problem

[0003]现有技术中对于土壤识别图像中存在空洞、阴影等因素,使得土壤图像中的土壤特征不明显,从而导致土壤图像无法直接应用于深度学习训练识别网络模型进行土种识别分析,从而需要对土壤图像进行处理,但是,通过现有技术所获取的土壤识别子图存在土种识别结果准确性差,不利于后续的土壤分析

Benefits of technology

[0040] The beneficial effects of this invention are as follows: This invention can accurately extract soil identification sub-images from the original soil image, avoiding the influence of shadows and holes in the original image, reducing the degree of sample overlap of the identification sub-images, ensuring the diversity of sample identification sub-images, thereby providing accurate data support for subsequent soil type identification and subsequent analysis. Moreover, the whole method has high robustness and fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116168294B_ABST
    Figure CN116168294B_ABST
Patent Text Reader

Abstract

This invention provides an adaptive method for selecting soil identification sub-images, comprising the following steps: S1. Acquiring image information of the target soil, segmenting the background and soil portions of the image, and determining the minimum bounding graph T and minimum bounding matrix t for extracting the soil sub-image; S2. Reconstructing the soil sub-image center point matrix C based on the minimum bounding matrix t; S3. Reconstructing the local brightness matrix W of the soil sub-image based on the reconstructed soil sub-image center point matrix C; S4. Calculating the Euclidean distance between the initial center point and the corresponding marker point in the reconstructed soil sub-image center point matrix C, and constructing a distance matrix D based on the Euclidean distance; S5. Constructing a soil sub-image center point optimization model, solving the soil sub-image center point optimization model, and using the pixel p corresponding to the maximum value obtained from the solution. i,j S6. Calculate the Euclidean distance between the center point determined in step S5 and the corresponding marker point in the reconstructed soil sub-image center point matrix C, and construct a distance matrix D' based on the Euclidean distance. Reconstruct the distance matrix D”, and substitute the reconstructed distance matrix D” into the optimization model to solve for the pixel point corresponding to the maximum value as the next new center point for the soil sub-image. S7. Repeat step S6 until N soil sub-image center points are selected, and extract image data from the soil image information using a window of size s×s based on the soil sub-image center points as the soil recognition sub-image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an image processing method, and more particularly to a method for adaptively selecting soil identification sub-images. Background Technology

[0002] Soil images are unique in that their features are global and generally consistent; the local texture of one region is not exactly the same as that of another region, but the detailed textures are quite similar. A sub-image of a certain size filled with soil is obtained from a soil image; this sub-image contains the image feature information of that soil and is called a soil sub-image.

[0003] Existing technologies often encounter issues with soil identification images due to factors such as voids and shadows, which obscure soil features. Consequently, these images cannot be directly used to train deep learning networks for soil species identification and analysis. Therefore, soil image processing is necessary. However, existing technologies often result in sub-images with poor soil species identification accuracy, which is detrimental to subsequent soil analysis.

[0004] Therefore, in order to solve the above-mentioned technical problems, it is urgent to propose a new technical approach. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide an adaptive method for selecting soil identification sub-images, which can accurately extract soil identification sub-images from the original soil image, avoid the influence of shadows and holes in the original image, reduce the degree of sample overlap of identification sub-images, and ensure the diversity of sample identification sub-images, thereby providing accurate data support for subsequent soil type identification and subsequent analysis. Moreover, the whole method has high robustness and fault tolerance.

[0006] The present invention provides a method for adaptively selecting soil identification sub-maps, comprising the following steps:

[0007] S1. Obtain the image information of the target soil, use the improved FCM algorithm to process the soil image information to segment the background and soil parts in the image, and determine the minimum bounding graph T of the soil sub-image and the minimum bounding matrix t corresponding to the minimum bounding graph T based on the soil part;

[0008] S2. Reconstruct the soil subgraph center point matrix C based on the minimum outer circumscribing matrix t;

[0009] S3. Reconstruct the local brightness matrix W of the soil submap based on the reconstructed soil submap center point matrix C;

[0010] S4. Take the pixel (i,j) corresponding to the maximum value in the local brightness matrix W of the reconstructed soil sub-image as the initial center point, calculate the Euclidean distance between the initial center point and the corresponding marker point in the center point matrix C of the reconstructed soil sub-image, and construct the distance matrix D based on the Euclidean distance;

[0011] S5. Construct an optimization model for the center points of the soil submap. The expression for this optimization model is:

[0012] M = argmax(W × D); This solves the optimization model for the center point of the soil submap, and sets the pixel p corresponding to the maximum value obtained from the solution. i,j A new center point is cut from the soil subgraph;

[0013] S6. Calculate the Euclidean distance between the center point determined in step S5 and the corresponding marked point in the reconstructed soil sub-map center point matrix C, and construct a distance matrix D' based on the Euclidean distance. Compare the corresponding elements in the distance matrix D' with the corresponding elements in the distance matrix D. Select the minimum value among the corresponding elements in the distance matrix D' and the distance matrix D to reconstruct the distance matrix of the new center point, forming the reconstructed distance matrix D”. Substitute the reconstructed distance matrix D” into the optimization model to solve for the pixel point corresponding to the maximum value, which is used as the next new center point for cutting the soil sub-map.

[0014] S7. Repeat step S6 until N soil sub-map center points are selected, and extract image data from the soil image information as soil identification sub-maps based on the soil sub-map center points in a window of size s×s.

[0015] Furthermore, in step S1, the minimum bounding graph T for extracting the soil subgraph is determined using the following method:

[0016] The soil image is converted into a grayscale matrix, and soil areas are labeled with 1 and non-soil areas with 0, thus constructing a soil image labeling matrix L. m×n ;

[0017] Determine rows containing soil pixels:

[0018] R m×1 =L m×n ×E n×1 ; where: E n×1 Let R represent an n-dimensional column vector consisting entirely of 1s. m×1 Let R be an m-dimensional labeled column vector. m×1 The i-th element R i,1 When the value is greater than zero, it indicates that the label matrix L m×n The i-th row contains non-zero elements, and the i-th row of the soil image contains soil elements. Store the index i in the set Φ.

[0019] Determine columns containing soil pixels:

[0020] B 1×n =E 1×m ×L m×n Among them: B 1×n B represents an m-dimensional row vector consisting entirely of 1s. 1×nFor an n-dimensional labeled row vector, when B 1×n The j-th element B 1,j When the value is greater than zero, it indicates that the label matrix L m×n The j-th column contains non-zero elements, and the j-th column of the soil image contains soil elements. Store the index j in the set Ψ.

[0021] Using the maximum and minimum values ​​of sets Φ and Ψ as boundaries, the region corresponding to these boundaries is used as the minimum bounding graph T to cut out the soil image, resulting in a soil image sub-image. The label matrix corresponding to the minimum bounding graph T is used as the minimum bounding matrix t.

[0022] Furthermore, step S2 includes:

[0023] Reconstructing the soil submap center point matrix C using a mean filter:

[0024] Mean filtering is applied to the minimum bounding matrix t:

[0025] k represents the size of the mean filter. When s is odd, k = s. When s is odd, k = s + 1. Ω is the neighborhood centered at (x,y) in the coverage t(x,y). t(i,j) is the binary point in Ω in the minimum outer label matrix t.

[0026] The soil subgraph center point matrix C is constructed using C(x,y).

[0027] Furthermore, step S3 specifically includes:

[0028] Convert the soil image to the HSV color space;

[0029] The local brightness matrix W' of the soil image is constructed based on the mean of the V channel in the HSV color space of the soil image, where any element W'(x,y) in W' is calculated using the following formula:

[0030]

[0031] The local brightness matrix W of the reconstructed soil submap is:

[0032] in, It represents the Hadamardi (or Hadama) stack.

[0033] Furthermore, in step S4, the distance matrix D is determined using the following method:

[0034] Determine the Euclidean distance between any point (x, y) and the center point (i, j):

[0035] Where: C'(x,y) is the label value of the subgraph center point matrix;

[0036] With D i,j Construct the distance matrix D from (x,y).

[0037] Furthermore, the value of N is determined using the following method:

[0038]

[0039] Where: α is a weighting factor used to adaptively adjust the number of subgraphs to be cut, where m and n represent the number of rows and columns of the distance matrix D, and s is the set window size.

[0040] The beneficial effects of this invention are as follows: This invention can accurately extract soil identification sub-images from the original soil image, avoiding the influence of shadows and holes in the original image, reducing the degree of sample overlap of the identification sub-images, ensuring the diversity of sample identification sub-images, thereby providing accurate data support for subsequent soil type identification and subsequent analysis. Moreover, the whole method has high robustness and fault tolerance. Attached Figure Description

[0041] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0042] Figure 1 This is a flowchart of the present invention.

[0043] Figure 2 This is a schematic diagram of the local brightness matrix reconstruction of the present invention.

[0044] Figure 3 This is a schematic diagram of the original soil image training for a specific example of the present invention.

[0045] Figure 4 This is a schematic diagram illustrating the training process of soil submap datasets constructed with different α values ​​for specific examples of the present invention.

[0046] Figure 5 This is a schematic diagram illustrating the training process of the soil subgraph dataset constructed with the same subgraph size according to the present invention.

[0047] Figure 6 This is a schematic diagram illustrating the training process of inserting soil submap datasets with different degrees of damage according to the present invention.

[0048] Figure 7 This is a time distribution diagram of different adaptive weight factors α in a specific example of the present invention.

[0049] Figure 8 This is a time distribution diagram of the algorithm for different subgraph sizes in a specific example of the present invention. Detailed Implementation

[0050] The present invention will be further described in detail below:

[0051] The present invention provides a method for adaptively selecting soil identification sub-maps, comprising the following steps:

[0052] S1. Obtain the image information of the target soil, and use the improved FCM algorithm to process the soil image information to segment the background and soil parts in the image. Based on the soil parts, determine the minimum bounding graph T of the soil sub-image and the minimum bounding matrix t corresponding to the minimum bounding graph T. The improved FCM algorithm is an existing technology and will not be described in detail here.

[0053] S2. Reconstruct the soil subgraph center point matrix C based on the minimum outer circumscribing matrix t;

[0054] S3. Reconstruct the local brightness matrix W of the soil submap based on the reconstructed soil submap center point matrix C;

[0055] S4. Take the pixel (i,j) corresponding to the maximum value in the local brightness matrix W of the reconstructed soil sub-image as the initial center point, calculate the Euclidean distance between the initial center point and the corresponding marker point in the center point matrix C of the reconstructed soil sub-image, and construct the distance matrix D based on the Euclidean distance;

[0056] S5. Construct an optimization model for the center points of the soil submap. The expression for this optimization model is:

[0057] M = argmax(W × D); This solves the optimization model for the center point of the soil submap, and sets the pixel p corresponding to the maximum value obtained from the solution. i,j The new center point is cut out for the soil sub-image; that is, a new matrix is ​​determined by the cross product of matrix W and matrix D, and the pixel point corresponding to the maximum value of the elements in the new matrix is ​​used as the new center point.

[0058] S6. Calculate the Euclidean distance between the center point determined in step S5 and the corresponding marked point in the reconstructed soil sub-map center point matrix C, and construct a distance matrix D' based on the Euclidean distance. Compare the corresponding elements of distance matrix D' with those of distance matrix D, and select the minimum value among the corresponding elements of distance matrix D' and distance matrix D to reconstruct the distance matrix of the new center point, forming the reconstructed distance matrix D”. Substitute the reconstructed distance matrix D” into the optimization model to solve for the pixel point corresponding to the maximum value, which is used as the next new center point for cutting the soil sub-map. For example: when A is the initial center point, the determined distance matrix is ​​D, when... After determining the distance matrix D' of the new center point B, the values ​​of corresponding elements in the two matrices are compared. When constructing matrix D”, each element in D” is the minimum value of the corresponding element in matrix D and matrix D'. For example, if the value of the first row and first column of D' is 2 and the value of the first row and first column of D is 1.5, then the value of the first row and first column of D” is 1.5. That is, the element at each position in D” is the minimum value of the corresponding element in D' and D. In this step, the overlap of the final soil identification submap can be minimized to ensure the diversity and independence of the soil submap samples.

[0059] S7. Repeat step S6 until N soil sub-image center points are selected, and extract image data from the soil image information using an s×s window based on the soil sub-image center points as soil identification sub-images. That is, after each center point is determined, extract the coordinates of N center points and map them to the original soil image. Then, extract the soil identification sub-image from the original soil image using an s×s window. Through the above method, the soil identification sub-image can be accurately extracted from the original soil image, avoiding the influence of shadows and holes in the original image, reducing the degree of sample overlap of the identification sub-image, and ensuring the diversity of sample identification sub-images. This provides accurate data support for subsequent soil type identification and subsequent analysis. Moreover, the whole method has high robustness and fault tolerance.

[0060] In this embodiment, in step S1, the minimum bounding graph T for extracting the soil subgraph is determined by the following method:

[0061] The soil image is converted into a grayscale matrix, and soil areas are labeled with 1 and non-soil areas with 0, thus constructing a soil image labeling matrix L. m×n ;

[0062] Determine rows containing soil pixels:

[0063] R m×1 =L m×n ×E n×1 ; where: E n×1 Let R represent an n-dimensional column vector consisting entirely of 1s. m×1 Let R be an m-dimensional labeled column vector. m×1The i-th element R i,1 When the value is greater than zero, it indicates that the label matrix L m×n The i-th row contains non-zero elements, and the i-th row of the soil image contains soil elements. Store the index i in the set Φ.

[0064] Determine columns containing soil pixels:

[0065] B 1×n =E 1×m ×L m×n Among them: B 1×n B represents an m-dimensional row vector consisting entirely of 1s. 1×n For an n-dimensional labeled row vector, when B 1×n The j-th element B 1,j When the value is greater than zero, it indicates that the label matrix L m×n The j-th column contains non-zero elements, and the j-th column of the soil image contains soil elements. Store the index j in the set Ψ.

[0066] Using the indices of the maximum and minimum values ​​of sets Φ and Ψ as boundaries, the region corresponding to these boundaries is used as the minimum bounding graph T to cut out soil image sub-images. The label matrix corresponding to the minimum bounding graph T is used as the minimum bounding matrix t. Through the above process, the invalid calculation of the background part of the image can be effectively avoided, reducing the amount of computation and improving the computational efficiency.

[0067] In this embodiment, step S2 includes:

[0068] Reconstructing the soil submap center point matrix C using a mean filter:

[0069] Mean filtering is applied to the minimum bounding matrix t:

[0070] k represents the size of the mean filter. When s is odd, k = s. When s is odd, k = s + 1. Ω is the neighborhood centered at (x,y) in the coverage t(x,y). t(i,j) is the binary point in Ω in the minimum outer label matrix t.

[0071] The soil submap center point matrix C is constructed using C(x,y). Through the above process, non-soil parts in the minimum bounding map can be effectively removed, so that the final soil identification submap contains only soil pixels, ensuring the accuracy of the final soil species identification and analysis results.

[0072] In this embodiment, step S3 specifically includes:

[0073] Convert the soil image to the HSV color space;

[0074] The local brightness matrix W' of the soil image is constructed based on the mean of the V channel in the HSV color space of the soil image, where any element W'(x,y) in W' is calculated using the following formula:

[0075]

[0076] The local brightness matrix W of the reconstructed soil submap is:

[0077] in, The Hadamard deposit is characterized by uneven natural soil fractures, including cavities and cracks, which cause shadows and voids in the soil image. If a sub-image of the soil is cut at these shadows, cavities, or cracks, the sub-image will not fully reveal the characteristics of the soil itself. Therefore, the method described above can effectively avoid this situation.

[0078] In this embodiment, in step S4, the distance matrix D is determined by the following method:

[0079] Determine the Euclidean distance between any point (x, y) and the center point (i, j):

[0080] Where: C'(x,y) is the label value of the subgraph center point matrix;

[0081] With D i,j Construct the distance matrix D from (x,y).

[0082] In this embodiment, the value of N is determined by the following method:

[0083]

[0084] Wherein: α is a weighting factor used to adaptively adjust the number of sub-images to be cut, where m and n represent the number of rows and columns of the distance matrix D, and s is the set window size; α is determined through experimentation or experience. In the above way, the number of soil identification sub-images is guaranteed, thus ensuring the diversity of soil identification sub-images, fully reflecting soil characteristics, and ensuring the final soil identification accuracy, while effectively avoiding inefficiency caused by excessive data volume.

[0085] The present invention will be further illustrated by a specific example below:

[0086] Taking the 3 genera and 11 species of purple soil as an example:

[0087] Table 1 Soil species distribution in soil images

[0088]

[0089] Sample Set 1: Based on a 224×224 pixel center in the soil image, square soil regions were cropped to replace the original soil image with side lengths of 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, and 2.5 times 224, respectively, forming 7 subsets of the original soil image. Based on soil type, 80% of each subset was randomly selected to form the Training Set, and the remaining 20% ​​formed the Validation Set. The Test Set consisted of square soil regions cropped from the test images.

[0090] For a sample set consisting of soil subgraphs, for each training image, a subgraph is cut out, and 80% of the subgraphs are randomly selected and placed into the soil subgraph training set TrainSet of this sample set; the remaining 20% ​​of the subgraphs are placed into the soil subgraph validation set ValSet of this sample set; and the subgraphs cut out from the test image are placed into the test set TestSet of this sample set.

[0091] Sample set 2: The soil subgraph size is 224×224. The subgraph selection algorithm proposed in this paper is used to cut the soil subgraph into 5 subsets with 5 different α parameters.

[0092] Sample set 3: Using side lengths of 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, and 2.5 times that of 224 pixels respectively, square soil sub-images were cut using the sub-image selection algorithm proposed in this paper to form 7 subsets.

[0093] Sample set 4: Soil submaps were cut using the submap selection algorithm proposed in this paper and experiments to obtain the optimal soil submap size. Five subsets were formed by incorporating 0%, 5%, 10%, 20%, and 30% of soil submap samples containing large areas of shadow or voids that are destructive.

[0094] (1) Experiment 1: Soil original map recognition accuracy experiment.

[0095] Using sample set 1, experiments were conducted on three networks with different depths, including ResNet-18, to obtain the accuracy of soil original image recognition.

[0096] (2) Experiment 2: Comparison of soil subgraphs with different α parameters.

[0097] Using sample set 2, we experimentally obtained the optimal soil subgraph cutting parameter α on three networks with different depths, including ResNet-18.

[0098] (3) Experiment 3: Comparison of soil sub-map cutting dimensions.

[0099] Using sample set 3, experiments were conducted on three networks with different depths, including ResNet-18, to obtain the optimal size for cutting soil submaps.

[0100] (4) Experiment 4: Performance comparison of subgraph selection algorithms.

[0101] Using sample set 4, experiments were conducted on three networks with different depths, including ResNet-18, to obtain the performance of the subgraph selection algorithm presented in this paper.

[0102] (5) Experiment 5: Performance test of subgraph selection algorithm using minimum outer matrix.

[0103] For 71 test images, experiments were conducted with and without minimum bounding matrix acceleration to compare the acceleration performance and obtain the acceleration efficiency using minimum bounding matrix.

[0104] The soil original image training set (TrainSet) consists of 160 images, the soil original image validation set (ValSet) consists of 39 images, and the soil original image test set (TestSet) consists of 71 images.

[0105] Due to data limitations, the batch size was uniformly set to 40. Seven different sizes of original soil image subsets were used for training and testing on three network models of varying depths, including ResNet-18. The training process and recognition results are as follows: Figure 3 As shown:

[0106] Most models exhibited oscillations during training, as shown in Figure 2:

[0107] Table 2 Soil Original Map Recognition Results

[0108]

[0109] Table 2 shows the following results: The recognition accuracy is low; the recognition results do not improve with increasing model depth; even with a larger subset of soil regions cropped from the original image, soil features are better represented, but the test results are still poor. The reasons are: Due to the limited amount of soil image data, direct recognition from the original image results in significant fluctuations and cannot achieve ideal recognition results. Furthermore, soil texture and other features are uncertain; when the cropped soil features contain many shadows, cavities, and cracks, soil type cannot be effectively identified.

[0110] Sample set 2 was trained and used for recognition on three network models with different depths, including ResNet-18. To maximize GPU memory utilization and ensure that the GPU memory for each model did not exceed the maximum value, the BatchSize model parameter was uniformly set to 600 when training the model with a sub-image size of 224×224. The training process and recognition results are as follows. Figure 4 As shown:

[0111] Figure 4The results show that the soil submap dataset has better training convergence characteristics than the original soil map. Table 3 shows that identifying each soil submap of a soil image frame by frame, with the decision result that identifies all submaps of the soil image as having the highest probability of a certain soil type, can greatly improve the model's robustness and fault tolerance, effectively enhancing the soil type identification performance.

[0112] The soil submap dataset significantly improves the accuracy of the recognition model in all aspects compared to training the model directly on the original soil map. Different numbers of samples in the soil submap datasets constructed with different α parameters result in varying degrees of overlap between the submap samples. As the number of samples increases, the overlap between the submaps becomes higher, and the overall accuracy of the test and validation sets shows an upward trend.

[0113] The optimal soil submap parameter α varies depending on the network model depth. For specific soil images, simply increasing network depth does not necessarily lead to better recognition results. In the ResNet-18 network, optimal test results were obtained when α was set to 1.0, 1.5, and 2.0. Considering the algorithm time cost, submap overlap, and data volume in Experiment 5, a value of 1 for α is more appropriate.

[0114] Table 3. Identification results of soil submap datasets constructed with different α values.

[0115]

[0116] Sample set 3 was trained and used for recognition on three network models with different depths, including ResNet-18. To maximize GPU memory utilization and ensure that the GPU memory usage of each model did not exceed the maximum value, the BatchSize parameter for the three models with subimage sizes of 56, 112, 168, 224, 336, 448, and 560 was set to 9600, 2400, 1066, 600, 266, 150, and 96 respectively during training. Training process and recognition results are presented below. Figure 5 As shown:

[0117] Figure 5 The results show that both excessively small and excessively large subgraph sizes can cause training convergence oscillations. Table 4 indicates that neither excessively small nor excessively large subgraph sizes can effectively perform recognition; at the same size, shallower networks generally achieve better recognition results, and the optimal subgraph size is not exactly the same for models of different depths. The best test results are obtained when the subgraph size is 224×224.

[0118] Table 4. Identification results of soil submap datasets constructed with different submap sizes.

[0119]

[0120] The soil submap dataset, TrainSet, was constructed at the optimal soil submap resolution of 224×224. To investigate the impact of shadows, cavities, and cracks on the recognition results, 5%, 10%, 20%, and 30% of destructive submap samples were manually added, respectively, forming the destructive submap datasets TrainBroke_0.05, TrainBroke_0.1, TrainBroke_0.2, and TrainBroke_0.3. Destructive submap samples were randomly selected from the center points of submaps that were less than 30% of the overall range in the local brightness matrix. The validation and test sets remained the same as TrainSet.

[0121] Sample set 4 was trained and tested on three network models of different depths, including ResNet-18. The training process and recognition results are as follows: Figure 6 As shown:

[0122] Figure 6 The results show that the oscillations in the training convergence process intensify with the addition of destructive samples. Table 5 indicates that the overall accuracy of the validation set gradually decreases with the addition of destructive samples; the recognition result is determined collectively by identifying each soil submap during testing. When the number of destructive samples is small, the test set exhibits uncertain fluctuations due to the instability of soil characteristics; when a large number of destructive samples are added, the accuracy of the test set gradually decreases. Therefore, soil submaps with numerous shadows, cavities, and cracks significantly affect the recognition results.

[0123] Table 5 shows the identification results of soil submap datasets with different degrees of damage.

[0124]

[0125] The TrainSet dataset, consisting of sub-images of size 224×224, achieves a best test result of 92.95% under ResNet-18. The classification evaluation metrics for the best soil type identification test results are shown in Table 6.

[0126] Table 6. Classification Evaluation Indicators of the Optimal Soil Type Identification Model

[0127]

[0128]

[0129] The subgraph size is 224×224. Different subgraph selection algorithm α parameters are set, and soil subgraphs are extracted to construct a soil subgraph dataset. The time consumption of using the minimum outer matrix to accelerate the subgraph selection algorithm is calculated as follows: Figure 7 As shown:

[0130] Figure 7The results show that using the minimum outer matrix to accelerate the subgraph selection algorithm improves the algorithm's running speed by 37.91%, 38.88%, 41.49%, 42.06%, and 41.37% when the α parameter is 0.5, 1.0, 1.5, 2.0, and 2.5, respectively.

[0131] When the adaptive parameter α of the subgraph selection algorithm is 1, soil subgraphs of different sizes are selected to construct a soil subgraph dataset.

[0132] Statistical analysis of whether to use the minimum outer matrix to accelerate subgraph selection algorithm time consumption, such as Figure 8 As shown:

[0133] Figure 8 The results show that using the minimum bounding matrix to accelerate the subgraph selection algorithm improves the algorithm's running speed by 38.17%, 39.43%, 39.31%, 38.88%, 40.68%, 45.77%, and 47.38% when the subgraph sizes are 56, 112, 168, 224, 336, 448, and 560, respectively.

[0134] The experimental results above all demonstrate that using the minimum outer matrix can effectively accelerate the running speed of the subgraph selection algorithm.

[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for adaptively selecting soil identification sub-maps, characterized in that: Includes the following steps: S1. Obtain the image information of the target soil, use the improved FCM algorithm to process the soil image information to segment the background and soil parts in the image, and determine the minimum bounding graph T of the soil sub-image and the minimum bounding matrix t corresponding to the minimum bounding graph T based on the soil part; S2. Reconstruct the soil subgraph center point matrix C based on the minimum outer circumscribing matrix t; S3. Reconstruct the local brightness matrix W of the soil submap based on the reconstructed soil submap center point matrix C; S4. Take the pixel (i,j) corresponding to the maximum value in the local brightness matrix W of the reconstructed soil sub-image as the initial center point, calculate the Euclidean distance between the initial center point and the corresponding marker point in the center point matrix C of the reconstructed soil sub-image, and construct the distance matrix D based on the Euclidean distance; S5. Construct an optimization model for the center points of the soil submap. The expression for this optimization model is: Solve the optimization model for the center point of the soil submap, and use the pixel corresponding to the maximum value obtained from the solution. A new center point is cut from the soil subgraph; S6. Calculate the Euclidean distance between the center point determined in step S5 and the corresponding marked point in the reconstructed soil submap center point matrix C, and construct a distance matrix based on the Euclidean distance. and the distance matrix Compare with the corresponding element in the distance matrix D, in the distance matrix The minimum value is selected from the corresponding elements in the distance matrix D to reconstruct the distance matrix of the new center point, forming the reconstructed distance matrix. The distance matrix will be reconstructed. Substitute the pixel corresponding to the maximum value into the optimization model and use it as the next new center point for cutting the soil sub-image; S7. Repeat step S6 until N soil sub-map center points are selected, and extract image data from the soil image information as soil identification sub-maps based on the soil sub-map center points in a window of size s×s.

2. The method for adaptively selecting soil identification sub-maps according to claim 1, characterized in that: In step S1, the minimum bounding graph T for extracting the soil subgraph is determined using the following method: The soil image is converted into a grayscale matrix, and soil areas are labeled as 1 and non-soil areas as 0, thus constructing a soil image labeling matrix. ; Determine rows containing soil pixels: ;in: Represents an n-dimensional column vector consisting entirely of 1s. For an m-dimensional labeled column vector, when The i-th element When the value is greater than zero, it indicates a label matrix. The i-th row contains non-zero elements, and the i-th row of the soil image contains soil elements. Store the index i in the set Φ. Determine columns containing soil pixels: ;in: This represents an m-dimensional row vector consisting entirely of 1s. For an n-dimensional labeled row vector, when The j-th element When the value is greater than zero, it indicates a label matrix. The j-th column contains non-zero elements, and the j-th column of the soil image contains soil elements. Store the index j in the set Ψ. Using the maximum and minimum values ​​of sets Φ and Ψ as boundaries, the region corresponding to these boundaries is used as the minimum bounding graph T to cut out the soil image, resulting in a soil image sub-image. The label matrix corresponding to the minimum bounding graph T is used as the minimum bounding matrix t.

3. The method for adaptively selecting soil identification sub-maps according to claim 2, characterized in that: Step S2 includes: Reconstructing the soil submap center point matrix C using a mean filter: Mean filtering is applied to the minimum bounding matrix t: k represents the size of the mean filter. When s is odd, k = s. When s is even, k = s + 1. Ω is the neighborhood centered at (x,y) in t(x,y). t(i,j) is the binary point in Ω in the minimum outer label matrix t. by Construct the soil submap center point matrix C.

4. The method for adaptively selecting soil identification sub-maps according to claim 3, characterized in that: Step S3 specifically includes: Convert the soil image to the HSV color space; A local brightness matrix of the soil image was constructed based on the mean values ​​of the V channel in the HSV color space of the soil image in the Ω domain. ,in, any element Calculated using the following formula: ; The local brightness matrix W of the reconstructed soil submap is: ,in, It represents the Hadamardi (or Hadama) stack.

5. The method for adaptively selecting soil identification sub-maps according to claim 4, characterized in that: In step S4, the distance matrix D is determined as follows: Determine the Euclidean distance between any point (x, y) and the center point (i, j): ;in: These are the label values ​​for the subgraph's center point matrix; by Construct the distance matrix D.

6. The method for adaptively selecting soil identification sub-maps according to claim 5, characterized in that: The value of N is determined using the following method: ; Where: α is a weighting factor used to adaptively adjust the number of subgraphs to be cut, where m and n represent the number of rows and columns of the distance matrix D, and s is the set window size.

Citation Information

Patent Citations

  • Initial clustering center selecting method and clustering method

    CN106570528A

  • FCM algorithm-based adaptive soil image shadow detection method

    CN111754501A