A method for extracting soil profile features based on multi-color space

By using a multi-color space soil profile feature extraction method and employing standard colorimetric cards and orthogonal decomposition technology, the problem of decoupling the physical structure and chemical composition characteristics of soil profiles under uncontrolled lighting conditions was solved, enabling accurate detection of soil profiles and accurate assessment of organic carbon content.

CN121904493BActive Publication Date: 2026-06-12GUIZHOU INST OF SOIL & FERTILIZER +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUIZHOU INST OF SOIL & FERTILIZER
Filing Date
2026-03-24
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately decouple the physical structure and chemical composition of soil profiles under uncontrolled lighting and variable-scale observation conditions, leading to inaccurate soil profile feature extraction. In particular, geometric shadows are confused with chemical dark colors under natural lighting, affecting the detection of organic carbon content and the diagnosis of soil compaction.

Method used

A feature extraction method based on multi-color space is adopted for soil profile maps. Real-time light attenuation unit vector and basic noise are obtained through standard colorimetric cards. Orthogonal decomposition and feature matrix analysis are performed to distinguish geometric shadows from matrix color and construct directional compaction index map to achieve effective separation of soil physical structure and chemical composition.

Benefits of technology

This method enables precise quantification of soil physical compaction and surface micromorphology simultaneously within a single image, eliminating interference from illumination and distance, and improving the accuracy of soil profile feature extraction and organic carbon content detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121904493B_ABST
    Figure CN121904493B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image feature extraction, and particularly relates to a soil profile feature extraction method based on a multi-color space. The method uses built-in colorimetric card calibration light direction and noise to orthogonally decompose soil pixel color under uncontrolled light in a Lab color space into a projection brightness component representing topography and an intrinsic chroma component representing matter, and maps them into geometric shadow probability and substrate chroma probability. A feature matrix is constructed through multi-directional weighted analysis of soil pixel points based on effective geometric shadow probability in each direction, and soil profile features are decoupled through feature matrix decomposition. The present application effectively eliminates the spectral confusion of microscopic shadows and dark organic matter through mathematical decoupling of physical and chemical features, and realizes effective feature extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image feature extraction technology, specifically to a method for extracting features from soil profile images based on multiple color spaces. Background Technology

[0002] In modern precision agriculture and soil quality assessment systems, soil profile images are a crucial data source for obtaining information on the physical structure and chemical fertility of the topsoil. Analyzing in-situ captured soil profile images allows for non-contact assessment of soil physical compaction (e.g., identifying plow pan depth) and detection of chemical components such as organic carbon. Compared to traditional ring sampling and laboratory physicochemical analysis, machine vision-based image analysis methods offer advantages such as high throughput, low cost, and minimal damage to soil structure, and have been widely applied in farmland soil quality surveys, land degradation monitoring, and field soil classification and grading.

[0003] Existing soil image-based analysis techniques face the challenge of accurately decoupling physical structure and chemical composition characteristics in practical applications. Firstly, the surface of a naturally occurring soil profile exhibits irregular microscopic undulations due to disturbance from excavation tools and the influence of root distribution. Under natural lighting conditions, these microscopic undulations generate numerous geometric shadows between soil particles, resulting in a significant reduction in local image brightness. These physical shadows caused by geometric morphology have highly similar spectral characteristics to the chemically dark colors of high organic matter content in the color space, making it easy for color-based organic carbon content detection to overestimate due to confusion between the two. Secondly, existing soil compaction diagnosis mainly relies on texture feature analysis, but this method struggles to distinguish between pore closure caused by physical compaction and loss of texture details due to excessive shooting distance. Simple image filtering often destroys key microstructural information characterizing soil compaction, making it impossible to simultaneously and accurately detect both "physical structural barrier layers" and "true chemical composition" in a single image. Therefore, existing technologies cannot extract effective soil profile features under uncontrolled lighting and variable-scale observation conditions, thus affecting the effective diagnosis and detection of target soil profiles. Summary of the Invention

[0004] To address the technical problem that existing technologies cannot extract effective soil profile features under uncontrolled lighting and variable-scale observation conditions, the present invention aims to provide a soil profile feature extraction method based on a multi-color space. The specific technical solution adopted is as follows:

[0005] This invention proposes a method for extracting features from soil profile maps based on multiple color spaces, the method comprising:

[0006] Obtain a soil profile image of the target soil profile, which includes a soil region and a standard colorimetric card region; perform a standardization analysis on the standard colorimetric card region using the standard colors and standard sizes of the standard colorimetric card to obtain a real-time illumination attenuation unit vector and a real-time baseline noise level.

[0007] The color vector of each soil pixel in the Lab color space is obtained. The color vector of the soil pixel is orthogonally decomposed based on the real-time illumination attenuation unit vector. The geometric shadow probability of each soil pixel is obtained according to the magnitude of the parallel component. The matrix chromaticity probability is obtained by comparing the vertical component with the real-time base noise. The geometric shadow probability and the matrix chromaticity probability are fused to obtain the effective geometric shadow intensity of each soil pixel.

[0008] For each soil pixel, a region to be analyzed is constructed with the soil pixel as the center; on the region to be analyzed, the overall effective geometric shadow intensity of the center pixel in each direction is obtained; the semi-positive definite symmetric matrix corresponding to each direction is weighted and fused with the overall effective geometric shadow intensity to obtain the feature matrix of each soil pixel;

[0009] Solve for the eigenvalues ​​of the feature matrix, and obtain soil profile features based on the magnitude and differences of the eigenvalues.

[0010] Furthermore, the method for obtaining the real-time illumination attenuation unit vector includes:

[0011] Extract the set of color vectors in the Lab color space for all pixels in the central region of all neutral grayscale color blocks in the standard colorimetric card area; perform principal component analysis on the set of color vectors, and select the direction with the smallest angle with the negative L-axis direction in the color space from the two directions of the first principal component to construct a unit vector, thereby obtaining the real-time illumination attenuation unit vector.

[0012] Furthermore, the method for obtaining the real-time baseline noise level includes:

[0013] Obtain the vertical Euclidean distance from each vector in the color vector set to the real-time illumination attenuation unit vector, calculate the standard deviation and average value of the vertical Euclidean distance, and obtain the real-time basic noise floor based on the 3sigma principle.

[0014] Furthermore, the method for obtaining the geometric shadow probability includes:

[0015] The average parallel projection component of the color vector of all pixels in the darkest grayscale color block area of ​​the statistical standard color chart is obtained by subtracting the average parallel projection component from the parallel component and normalizing the difference to obtain the geometric shadow probability.

[0016] Furthermore, the method for obtaining the matrix chromaticity probability includes:

[0017] If the vertical component is less than the real-time baseline noise, then the corresponding matrix chromaticity probability is set to 0.

[0018] If the vertical component is not less than the real-time base noise, then the difference between the vertical component and the real-time base noise is mapped to a range of 0 to 1 to obtain the matrix chromaticity probability.

[0019] Furthermore, the method for obtaining the effective geometric shadow intensity includes:

[0020] The effective geometric shadow intensity is obtained by mapping the matrix chromaticity probability negatively to the geometric shadow probability.

[0021] Furthermore, the method for constructing the region to be analyzed includes:

[0022] Using the actual size of the standard colorimetric card as the denominator and the size of the standard colorimetric card region in the soil profile image as the numerator, the pixel resolution ratio is obtained; based on the pixel resolution ratio, the mapped size of the preset actual soil aggregate diameter in the image field of view is obtained; and a circular region to be analyzed is constructed with each soil pixel as the center and the mapped size as the diameter.

[0023] Furthermore, the method for obtaining the overall effective geometric shadow intensity includes:

[0024] For any direction of the center pixel, the average effective geometric shadow intensity of the soil pixels in the area to be analyzed is taken as the overall effective geometric shadow intensity.

[0025] Furthermore, the method for obtaining the soil profile features includes:

[0026] Solve for the two non-negative eigenvalues ​​of the characteristic matrix to obtain the first eigenvalue and the second eigenvalue, where the first eigenvalue is greater than or equal to the second eigenvalue;

[0027] The sum of the first and second eigenvalues ​​is used as the surface roughness.

[0028] The difference between the first and second eigenvalues ​​is normalized and mapped to obtain the directional compaction index;

[0029] The surface roughness and the directional compaction index are used as soil profile features for each soil pixel.

[0030] Furthermore, after obtaining the soil profile characteristics, the process further includes:

[0031] A directional compaction index map composed of directional compaction indices of soil pixels is obtained; the directional compaction index map is the same size as the soil region; at each depth coordinate of the target soil profile, the average directional compaction index on the directional compaction index map is calculated, and a depth distribution curve is constructed with the depth of the target soil profile as the abscissa and the corresponding average directional compaction index as the ordinate; based on a preset compaction discrimination threshold, the soil compaction layer interval is found in the depth distribution curve.

[0032] After negatively mapping the surface roughness, the smoothness weight of each soil pixel is obtained; the color vector of all soil pixels is weighted and averaged based on the smoothness weight to obtain the overall true color vector of the soil profile image after removing the shadow effect; the soil organic carbon content is evaluated based on the overall true color vector.

[0033] The present invention has the following beneficial effects:

[0034] This invention utilizes a standard colorimetric chart area for standardized analysis to obtain real-time illumination attenuation vectors and baseline noise, and uses this as a benchmark to orthogonally decompose the color vectors of soil pixels. This method effectively decouples mixed color information into parallel components representing illumination intensity and vertical components representing material properties, thereby distinguishing between physical shadows caused by terrain undulations and chemical dark colors caused by soil materials, solving the problem in existing technologies where these two are easily confused, leading to inaccurate feature extraction.

[0035] Furthermore, the effective geometric shadow intensity is obtained by fusing geometric shadow probability and matrix chromaticity probability, and a multi-directional overall intensity weighted fusion feature matrix is ​​constructed. This process effectively filters shadow statistics using chromaticity information, retaining only shadow features related to physical structure. Simultaneously, soil profile features are obtained based on the magnitude and difference of eigenvalues ​​in the feature matrix, mathematically separating the total feature characterizing surface roughness from the anisotropic feature characterizing pore orientation. This enables precise quantification of soil physical compaction state (such as highly directional layers) and surface micromorphology in a single image, eliminating interference from shooting distance or detail loss in single texture analysis.

[0036] In summary, this invention achieves effective separation of soil physical structure information and chemical color information through standardized orthogonal decomposition and decoupling analysis based on feature matrices. Attached Figure Description

[0037] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 This is a flowchart of a method for extracting features from a soil profile based on a multi-color space, provided as an embodiment of the present invention. Detailed Implementation

[0039] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a soil profile feature extraction method based on a multi-color space proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0041] The following describes in detail, with reference to the accompanying drawings, a specific scheme of the soil profile feature extraction method based on multi-color space provided by the present invention.

[0042] Please see Figure 1 The diagram illustrates a flowchart of a soil profile feature extraction method based on a multi-color space, according to an embodiment of the present invention. The method includes:

[0043] Step S1: Obtain a soil profile image of the target soil profile, which includes a soil region and a standard colorimetric card region; perform a standardization analysis on the standard colorimetric card region using the standard colors and standard sizes of the standard colorimetric card to obtain a real-time illumination attenuation unit vector and a real-time baseline noise level.

[0044] Since this invention focuses on image feature extraction from soil profiles, it is first necessary to acquire a soil profile image of the target soil slope. To address the problem of poor feature extraction results under uncontrolled lighting and variable-scale observation conditions in existing technologies, this invention first introduces a standard colorimetric card during the shooting stage. This means that the soil profile image simultaneously includes the soil area of ​​the target soil profile and the standard colorimetric card area. The standard colorimetric card can be an X-Rite ColorChecker or a grayscale card used in photography. It is typically a rectangular plate with several known, uniformly arranged color blocks printed on its surface, and also includes a row of neutral grayscale blocks that do not contain color information; that is, this row of neutral grayscale blocks is arranged in a gradient from the whitest to the blackest.

[0045] It should be noted that standard colorimetric cards typically have fixed shapes and features. Therefore, the standard colorimetric card region in a soil profile image can be directly extracted through feature point matching. The area outside the standard colorimetric card region is the soil region. The specific feature point matching method is a well-known technique in the art and will not be elaborated here.

[0046] Because the shooting distance during field soil surveys is not fixed, and color temperature drift under natural lighting conditions and sensor thermal noise introduce non-material-caused color deviations, the color deviations and other information generated in the image are not constant. Therefore, this embodiment of the invention introduces a standard colorimetric card, enabling the generation of a series of real-time benchmark features for the current scene based on the image information presented in the standard colorimetric card area of ​​the image, combined with the standard information of the standard colorimetric card itself. This allows for color decoupling of soil pixel information in subsequent steps. The real-time benchmark features mainly include a real-time illumination attenuation unit vector and a real-time base noise floor.

[0047] The real-time illumination attenuation unit vector can be analyzed by examining changes in standard grayscale color patches within a standard colorimetric chart area. It characterizes the direction of color change as light weakens in the current imaging environment. Since pits, cracks, and other features on the soil surface can cause shadows due to light occlusion, these shadows, created by soil geometry, share the same formation mechanism as the dark gray patches on the standard colorimetric chart—both are caused by reduced light reflection. Therefore, if the direction of color change in soil pixels within the soil area coincides with the direction of the real-time illumination attenuation unit vector, it indicates that the darkening of the soil pixel is most likely due to geometric occlusion. Conversely, it may be due to the darkening of its own color. Thus, the real-time illumination attenuation unit vector in the color space can define an axis of illumination change solely caused by geometric occlusion, reflecting the illumination change characteristics of the current scene.

[0048] The baseline noise level defines the maximum permissible chromaticity deviation that is considered background noise under the current imaging environment.

[0049] Preferably, in this embodiment of the invention, the method for obtaining the real-time illumination attenuation unit vector includes:

[0050] The attenuation of light intensity causes non-colored soil particles to exhibit a color change trajectory from light gray to dark black. The color vector set of all pixels in the central region of all neutral grayscale color patches in the standard colorimetric card area is extracted in the Lab color space. Principal component analysis is performed on this color vector set. The resulting first principal component can capture the main axis of light change, i.e., the trajectory from light to dark. However, since the first principal component contains both positive and negative directions, this embodiment of the invention needs to find the direction towards "darkening." Therefore, among the two directions of the first principal component, the direction with the smallest angle to the negative L-axis in the color space is selected to construct a unit vector, obtaining the real-time light attenuation unit vector. That is, the L-axis square represents light, and the negative direction represents dark. Therefore, the direction with the smallest angle to the negative direction among the two directions of the first principal component is the real-time light attenuation unit vector desired in this embodiment of the invention.

[0051] It should be noted that the central region in this embodiment of the invention is a preset neighborhood of each grayscale color block centered on its center point. The neighborhood size in this embodiment is 10×10. Furthermore, to avoid noise contamination of a single center point or the influence of stains on the color chart surface on the color value, this embodiment further averages all color vectors within this neighborhood, using this average as a vector within the color vector set for the corresponding color block. That is, the number of elements in the color vector set is the same as the number of neutral grayscale color blocks. Principal component analysis algorithms are well-known techniques to those skilled in the art and will not be elaborated upon or limited here.

[0052] It should be noted that the color vector is composed of components in the Lab color space, that is, the color vector contains three elements, which correspond to the values ​​of the three component channels in the Lab color space.

[0053] Furthermore, in this embodiment of the invention, considering that the real-time illumination attenuation unit vector can characterize the direction of color change when the light weakens under the current imaging environment, when analyzing the noise floor during the normalization process, mapping analysis can be directly performed based on the real-time illumination attenuation unit vector and the color vector set corresponding to the center region of the neutral grayscale color block. Specifically, this includes:

[0054] The vertical Euclidean distance from each vector in the color vector set to the real-time illumination attenuation unit vector is obtained. This vertical Euclidean distance characterizes the chromaticity deviation of a color vector relative to the real-time illumination attenuation unit vector. Because the neutral grayscale distribution on the standard colorimetric chart is standardized and uniform, the standard deviation and average value of the vertical Euclidean distance can be statistically analyzed. Based on the 3-sigma principle, the real-time baseline noise is obtained. Specifically, the sum of the average value and three times the standard deviation is used as the real-time baseline noise. This real-time baseline noise is relative to soil pixels and standardizes the maximum permissible chromaticity deviation considered as background noise under the current imaging environment.

[0055] Step S2: Obtain the color vector of each soil pixel in the Lab color space within the soil area. Perform orthogonal decomposition on the color vector of the soil pixel based on the real-time illumination attenuation unit vector. Obtain the geometric shadow probability of each soil pixel according to the magnitude of the parallel component. Compare the vertical component with the real-time base noise to obtain the matrix chromaticity probability. Fuse the geometric shadow probability and the matrix chromaticity probability to obtain the effective geometric shadow intensity of each soil pixel.

[0056] In directly acquired soil profile images, the color information of soil pixels in the soil region is actually a superposition of two types of information: the influence of light and the color of the soil material itself. The embodiments of the present invention aim to distinguish between the shadows caused by the unevenness of the soil geometry and the dark colors caused by the high organic matter content. Therefore, based on the obtained real-time light attenuation unit vector, the color vector of each soil pixel in the soil region in the Lab color space can be obtained, and the color vector of the soil pixel is orthogonally decomposed based on the real-time light attenuation unit vector.

[0057] The parallel components of the orthogonal decomposition represent the projection length of the color component of the soil pixel in the direction of the real-time illumination attenuation unit vector. This projection length can quantify how much the soil pixel is affected by illumination. That is, the larger the projection length, the darker the soil pixel is on the brightness change trajectory pointed to by the real-time illumination attenuation unit vector. This shows that if the soil pixel does not have its own color, it is only the darkness reflected by the illumination under the current imaging environment.

[0058] The vertical component of orthogonal decomposition is the opposite of the parallel component. The vertical component represents the degree to which the color component of the soil pixel deviates from the trajectory of pure illumination change. That is, the smaller the vertical component, the more the color information of the soil pixel almost completely conforms to the trajectory of the real-time illumination decay unit vector. The color depth of the soil pixel is purely due to the occlusion of light or shadow, and its own color information is weak. Conversely, the larger the vertical component, the further the color component of the soil pixel deviates from the trajectory of the real-time illumination decay unit vector. It contains colors that cannot be explained by the darkening of light, such as red iron oxides and black organic matter.

[0059] Based on the above explanation of the orthogonal decomposition results, statistical analysis of the parallel components can determine whether the dark features of soil pixels are caused by occlusion due to geometric shapes, thus yielding the geometric shadow probability. Further comparison of the vertical component with the real-time baseline noise shows that a larger vertical component relative to the baseline noise indicates that the soil pixel is more likely to contain its own color, i.e., a higher matrix chromaticity probability. Each soil pixel can further yield both geometric shadow probability and matrix chromaticity probability, which show a significant negative correlation. Therefore, fusing these two probabilities yields the effective geometric shadow intensity for each soil pixel. That is, the effective geometric shadow intensity is positively correlated with the geometric shadow probability and negatively correlated with the matrix chromaticity probability; a larger effective geometric shadow intensity indicates that the soil pixel is more likely to be darkened due to geometric occlusion.

[0060] It should be noted that the quantization methods for the vertical and parallel components during orthogonal decomposition are well-known techniques to those skilled in the art. The parallel component can be directly obtained by the dot product between the color component and the real-time illumination attenuation unit vector; the vertical component can be obtained by subtracting the vector corresponding to the parallel component from the color vector and then calculating the magnitude. Ultimately, two scalar values ​​are obtained: the parallel component represents the projection length, and the vertical component represents the vertical distance.

[0061] Preferably, in this embodiment of the invention, the method for obtaining the geometric shadow probability includes:

[0062] Because the parallel component only characterizes the brightness of soil pixels under pure illumination, it cannot be directly correlated with the probability of geometric shadows. Considering that geometric shadows can cause illumination occlusion, resulting in significantly darker pixels, the dark grayscale patches on the colorimetric chart can serve as a reference for "dark information." That is, the closer or darker the information of the parallel component is to the darkest grayscale patch on the colorimetric chart, the more likely the soil pixel is occluded by geometric topography.

[0063] Therefore, in order to achieve effective comparison, this embodiment of the invention first calculates the average parallel projection component of the color vectors of all pixels in the darkest grayscale color block area of ​​the standard color chart onto the real-time illumination attenuation unit vector. That is, this average parallel projection component, like the parallel component of the soil pixels, is based on the projection information of the real-time illumination attenuation unit vector. Therefore, the difference between the parallel component and the average parallel projection component can be directly normalized to obtain the geometric shadow probability. In other words, the larger the difference, the darker the soil pixels appear on the illumination attenuation unit vector, and the higher the corresponding geometric shadow probability should be.

[0064] As a specific example, in one implementation of this invention, the geometric shadow probability is expressed by the formula:

[0065] ;in Let represent the geometric shadow probability of the soil pixel at coordinates (x, y), and let exp be an exponential function with the natural constant as the base. Let (x, y) be the parallel component of the soil pixel at coordinates (x, y). This represents the average parallel projection component of the color vector of all pixels in the darkest grayscale area of ​​the standard color chart, under real-time illumination attenuation unit vector. Adjust the parameters for the first preset.

[0066] In the above formula, after obtaining the difference between the two components, it is divided by a first preset adjustment parameter to adjust the value range. Then, an exponential function exp(-x) with the natural constant as the base is used for mapping. This exponential function achieves negative correlation mapping and normalization of the difference after adjusting the value range. Therefore, negative correlation is achieved again through the reciprocal form. Simultaneously, to avoid the denominator being 0, a positive integer 1 is added to the denominator. Ultimately, the darker the parallel component is relative to the average projection component, the larger the difference, and the greater the corresponding geometric shadow probability. In this embodiment of the invention, the first preset adjustment parameter can be set to 10.

[0067] Preferably, in some implementations of the embodiments of the present invention, the method for obtaining the matrix chromaticity probability includes:

[0068] Since the real-time baseline noise represents a maximum permissible chromaticity deviation, if the vertical component is less than the real-time baseline noise, it means that the chromaticity deviation generated by the soil pixel can be considered as a small deviation caused by the baseline noise, and the corresponding matrix chromaticity probability can be directly set to 0, that is, it can be considered as not having its own color information.

[0069] If the vertical component is not less than the real-time baseline noise, the difference between the vertical component and the real-time baseline noise is mapped to a range of 0 to 1 to obtain the matrix chromaticity probability. That is, the greater the difference, the larger the vertical component is relative to the real-time baseline noise, which means that the soil pixel itself should have a more significant color, i.e., the greater the matrix chromaticity probability.

[0070] As a specific example, in one implementation of this invention, the matrix chromaticity probability is expressed by the formula:

[0071] ;in This represents the matrix chromaticity probability of a soil pixel at coordinates (x, y). The Clamp function is a truncation function that restricts the... It should be between the maximum value of 1 and the minimum value of 0. This represents the vertical component of the soil pixel at coordinates (x, y). For real-time baseline noise, Adjust the parameters for the second preset.

[0072] In the above formula, the truncation function is used to limit the range of the final result. That is, when the vertical component is less than the real-time base noise, the matrix chromaticity probability should be set to 0. If the value is greater than 1, then the matrix chromaticity probability is forcibly set to 1. In the formula, the rate of change of the vertical component relative to the real-time baseline noise is represented. The second preset adjustment parameter in the denominator is used to adjust the range of the final value, which can be regarded as a kind of sensitivity adjustment. That is, by adjusting the second preset adjustment parameter, the cutoff position of the cutoff function with respect to the upper limit can be adjusted. Ultimately, the more the vertical component deviates from the real-time baseline noise, the closer the matrix chromaticity probability is to 1, indicating that the soil pixel has significant soil matrix coloring substances.

[0073] Preferably, in this embodiment of the invention, the method for obtaining the effective geometric shadow intensity includes:

[0074] The effective geometric shadow intensity is obtained by mapping the matrix chromaticity probability negatively to the geometric shadow probability.

[0075] As a concrete example, since the matrix chromaticity probability ranges from 0 to 1, the negative correlation mapping result can be obtained by directly subtracting the matrix chromaticity probability from the positive integer 1. Then, the effective geometric shadow intensity, also within the range of 0 to 1, is obtained through multiplication. If the soil pixel represents a high-confidence chemically dark substance (i.e., its own color is darker), the corresponding matrix chromaticity probability is higher, and the result after negative correlation mapping will approach 0. Consequently, the corresponding effective geometric shadow intensity will also approach 0. Therefore, the information influence should be reduced in subsequent geometric occlusion analysis.

[0076] Step S3: For each soil pixel, construct the region to be analyzed with the soil pixel as the center; on the region to be analyzed, obtain the overall effective geometric shadow intensity of the center pixel in each direction; weight and fuse the semi-positive definite symmetric matrix corresponding to each direction with the overall effective geometric shadow intensity to obtain the feature matrix of each soil pixel.

[0077] To analyze the geometric shadow features of the area where each soil pixel is located, it is necessary to construct the region to be analyzed with each soil pixel as the center. That is, the region to be analyzed can be regarded as the neighborhood of the central soil pixel. The distribution of effective geometric shadow intensity is analyzed as a whole within this neighborhood, which can effectively characterize the geometric shadow features of the location of the central soil pixel.

[0078] In this embodiment of the invention, the region to be analyzed can be considered as a set of pixels contained in the central soil pixel in each direction. Since the positive semi-definite symmetric matrix in each direction can be regarded as the outer product of the direction vectors, which is a projection operator, the overall effective geometric shadow intensity on the region to be analyzed can be statistically calculated for each direction. The larger the overall effective geometric shadow intensity, the more severe the undulations in that direction, that is, the more obvious the geometric undulation structure in that direction. The overall effective geometric shadow intensity in each direction is then projected into two-dimensional space using the positive semi-definite symmetric matrix projection operator. That is, the positive semi-definite symmetric matrix corresponding to each direction is weighted and fused with the overall effective geometric shadow intensity. Finally, the weighted fusion result of all directions can obtain an elliptical model describing the energy distribution shape of the local region to be analyzed, that is, the feature matrix of each soil pixel. The weighted fusion process of a semi-definite symmetric matrix can be viewed as an expansion of the space around the center of a circle in corresponding directions, based on the overall effective geometric shadow intensity. If the overall effective geometric shadow intensity is large in all directions, the final circle will be expanded into a large circle; if the overall effective geometric shadow intensity is large only in one direction, the final circle will be expanded into an elongated ellipse. That is, this feature matrix is ​​mathematically equivalent to an ellipse, where the major axis represents the intensity in the main direction where the geometric features such as pores or shadows are most densely distributed, and the minor axis represents the intensity in the direction perpendicular to the main direction. Therefore, subsequent steps can perform eigenvalue decomposition on this feature matrix to obtain the soil profile features.

[0079] In this embodiment of the invention, multiple directions can be uniformly set in the region to be analyzed for the acquisition of the feature matrix. In one specific implementation of this embodiment, eight directions can be set. In other implementations of this embodiment, more directions can be selected for analysis in order to obtain more effective results. This will not be elaborated or limited here.

[0080] It should be noted that during the process of dividing the area to be analyzed, there may be extreme issues such as exceeding the boundaries of the soil area. When analyzing, it is only necessary to analyze the actual soil pixels contained in the area to be analyzed. For example, if there are no soil pixels in a certain direction, then that direction can be excluded from the analysis.

[0081] As a specific example, in this embodiment of the invention, the feature matrix is ​​expressed by the formula:

[0082] ;in, Let K be the feature matrix of the soil pixels with coordinates (x, y), and K be the number of directions to be analyzed in the region to be analyzed. Let be the overall effective geometric shadow intensity of the soil pixel with coordinates (x, y) in the k-th direction. Let be the angle in the k-th direction, where sin represents sine and cos represents cosine.

[0083] It should be noted that the weighted fusion process of matrices and the concept of positive semidefinite symmetric matrices are well-known techniques to those skilled in the art, and will not be elaborated upon here.

[0084] Preferably, to ensure a consistent physical observation range during feature extraction at different shooting distances and to completely eliminate the interference of chemical dark components on porosity statistics, this embodiment of the invention further uses the known true size of the standard colorimetric card as a benchmark to determine the division size of the region to be analyzed in the image, thereby obtaining an adaptive size that conforms to the current imaging scene. Specifically, this includes:

[0085] Using the actual size of the standard colorimetric card as the denominator and the size of the standard colorimetric card region in the soil profile image as the numerator, the pixel resolution ratio is obtained; based on the pixel resolution ratio, the mapped size of the preset actual soil aggregate diameter in the image field of view is obtained; and a circular region to be analyzed is constructed with each soil pixel as the center and the mapped size as the diameter.

[0086] In this embodiment of the invention, the mapping size is the product of the pixel resolution ratio and the preset true soil aggregate diameter. That is, the preset true soil aggregate diameter is scaled by the pixel resolution ratio to obtain a reasonable mapping size. The preset true soil aggregate diameter can be set to 2 mm, corresponding to the average diameter of a typical large soil aggregate.

[0087] Preferably, in this embodiment of the invention, the method for obtaining the overall effective geometric shadow intensity includes:

[0088] For any direction of the center pixel, the average effective geometric shadow intensity of the soil pixels within the region to be analyzed is taken as the overall effective geometric shadow intensity. That is, the average value represents the overall level in the corresponding direction.

[0089] Step S4: Solve for the eigenvalues ​​of the feature matrix, and obtain the soil profile features based on the magnitude and differences of the eigenvalues.

[0090] As explained in step S3 above regarding the feature matrix, the eigenvalues ​​of the feature matrix can be considered as the major and minor axes of an ellipse. The smaller the eigenvalue, the more likely the ellipse represented by the feature matrix is ​​a single point, indicating that the overall effective shadow intensity in all directions is close to 0, and that the area where the soil pixel is located has no uneven geometric features, so no shadow can be seen in any direction. Conversely, the larger the eigenvalue, the greater the overall effective shadow intensity in each direction, indicating that there are uneven pores or shadows in each direction, and the ellipse is expanded into a huge circle or ellipse during the weighted fusion process.

[0091] For two feature values, a greater difference indicates a flatter ellipse shape. In healthy soil aggregates, the resulting pores are random, with no significant overall effective shadow intensity in any particular direction. The shadow intensity is relatively uniform across all directions, meaning the less flat the ellipse shape, the closer it is to a circle. However, in compacted plow pans, due to the external force of compaction, the pores are flattened, forming horizontal stratification or cracks. The shadows along the crack direction will merge, resulting in a significantly larger overall effective shadow intensity. Conversely, the vertical direction lacks shadows, leading to a significantly smaller overall effective shadow intensity. Therefore, the difference between feature values ​​can isolate the influence of the total shadow amount, determining whether pores have undergone directional flattening, i.e., whether the corresponding soil pixel has undergone directional compaction.

[0092] Therefore, soil profile characteristics can be obtained by solving for the eigenvalues ​​of the characteristic matrix and based on the magnitude and differences of the eigenvalues.

[0093] Preferably, based on the above logic, the specific method for obtaining soil profile features in this embodiment of the invention includes:

[0094] Solve for the two non-negative eigenvalues ​​of the characteristic matrix to obtain the first eigenvalue and the second eigenvalue, where the first eigenvalue is greater than or equal to the second eigenvalue;

[0095] The sum of the first and second eigenvalues ​​is used as the surface roughness. That is, the surface roughness is the trace of the feature matrix, which represents the overall magnitude of the two eigenvalues ​​and the total energy of the effective geometric shadow around the soil pixel. The larger the value, the rougher the surface of the corresponding region, the more severe the microscopic fluctuations, and the more serious the influence of ensemble occlusion.

[0096] The difference between the first and second eigenvalues ​​is normalized and mapped to obtain the directional compaction index. That is, the greater the difference, the more likely the soil pixel has undergone directional compaction, and thus the larger the directional compaction index.

[0097] As a specific example, in one implementation of this invention, the directional compaction index is expressed by the formula:

[0098] ; This represents the directional compaction index of the soil pixel at coordinates (x, y). The second eigenvalue, The first eigenvalue, This is a preset hyperparameter. In this formula, since the first eigenvalue is greater than the second eigenvalue, a larger ratio obtained by using it as the denominator indicates a smaller difference between the two. Therefore, a negative correlation is established using the difference of a positive integer 1, so that the greater the difference between the two, the larger the result. The purpose of the preset hyperparameter is to prevent the denominator from being 0 in extreme cases. Specifically, it can be set to a small positive number, for example... .

[0099] The surface roughness and the directional compaction index are used as soil profile features for each soil pixel.

[0100] Furthermore, in this embodiment of the invention, after obtaining two soil slope features, the soil properties can be further diagnosed and evaluated based on the feature results, specifically including:

[0101] Long-term mechanical tillage of soil forms a dense plow pan, which, in its microstructure, exhibits vertically compressed and closed pores with a significant horizontally oriented arrangement, demonstrating high structural anisotropy. Conversely, a healthy topsoil layer typically consists of aggregates with a random, isotropic pore distribution. The directional compaction index characterizes the degree and probability of compaction at a soil pixel, thus a directional compaction index map can be obtained, composed of the directional compaction indices of soil pixels. The distribution pattern of this directional compaction index map at vertical depth on the soil profile can be used to locate the compacted layer. Since the directional compaction index map is the same size as the soil region, it can be considered as replacing the pixel values ​​in the soil region with the corresponding directional compaction indices.

[0102] For each depth coordinate of the target soil slope, there is a corresponding set of directional compaction indices. Therefore, by calculating the average directional compaction index on the directional compaction index map, and using the depth of the target soil profile as the x-axis and the corresponding average directional compaction index as the y-axis, a depth distribution curve is constructed. On the depth distribution curve, a continuous interval with a large value represents a distinct soil compaction layer. Therefore, based on a preset compaction discrimination threshold, the soil compaction layer interval can be found in the depth distribution curve.

[0103] It should be noted that, in one specific implementation of this invention, the y-axis of the soil profile image is vertical, meaning each y-axis coordinate represents a depth. Therefore, the average directional compaction index of each row in the directional compaction index map can be used to construct a depth distribution curve. Furthermore, a compaction discrimination threshold of 0.6 is set. This threshold corresponds to a state of significant imbalance in the ratio of the pore length to the minor axis. By traversing the depth distribution curve, intervals greater than the compaction discrimination threshold and with a continuous length greater than a preset minimum physical thickness are identified as soil compaction layer intervals. The preset minimum physical thickness is set to the mapped length of a true physical length of 5 cm on the image, which is 50 multiplied by the pixel resolution ratio.

[0104] Furthermore, considering that the microscopic roughness of the soil surface generates a large number of geometric shadows, the low brightness of these shadow areas is due to light occlusion and cannot accurately reflect the light absorption characteristics of soil organic matter. If the average value of the entire image is directly used to invert the soil organic carbon content, the shadows will be misclassified as dark organic matter, leading to an overestimation of the predicted value. Surface roughness measures the degree of geometric occlusion of each soil pixel. Therefore, by negatively mapping the surface roughness, a credential weight can be obtained for each soil pixel, automatically reducing the contribution of shadow areas to color information and thus extracting spectral color features that are closer to the intrinsic color of the material.

[0105] As an example, in one specific implementation of this invention, the reciprocal of the result of adding the surface roughness to a positive integer 1 can be used as the smoothing weight, where the positive integer 1 serves to prevent the denominator from being 0.

[0106] Based on the aforementioned leveling weights, a weighted average is applied to the color vectors of all soil pixels to obtain the overall true color vector of the soil profile image after removing the influence of shadows. That is, through the weighted averaging operation, the final overall true color vector represents the predominantly well-lit pixels, statistically mitigating the false dark color bias caused by microscopic geometric shadows. The weighted averaging of the vectors utilizes a numerical superposition technique, where the leveling weights are multiplied by their corresponding color vectors, and the multiplication results for all soil pixels are accumulated. The accumulated vector is then divided by the accumulated value of the leveling weights to obtain the weighted average result.

[0107] Soil organic carbon content can be assessed based on the overall true color vector. In a specific implementation of this invention, the overall true color vector can be directly input into a pre-trained linear regression model or partial least squares regression (PLSR) model to calculate the predicted value of soil organic carbon content. The regression model is trained by pre-collecting multiple sets of standard soil samples, extracting the overall true color vector using the same method, and using the true value of organic carbon content measured by standard laboratory chemical analysis methods (such as the potassium dichromate titration method) as the dependent variable. The specific process is a well-known technique and will not be elaborated upon here.

[0108] In summary, this invention utilizes a built-in colorimetric card to calibrate the illumination direction and noise floor. Under uncontrolled illumination, the soil pixel color is orthogonally decomposed in Lab space into a projected luminance component representing morphology and an intrinsic chromaticity component representing the material, and mapped to geometric shadow probabilities and matrix chromaticity probabilities. Based on the effective geometric shadow probabilities in each direction, a feature matrix is ​​constructed through multi-directional weighted analysis of soil pixels, and soil profile features are decoupled through feature matrix decomposition. This invention effectively eliminates spectral confusion between microscopic shadows and dark organic matter through mathematical decoupling of physical and chemical features, achieving effective feature extraction.

[0109] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0110] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A method for extracting features of a soil profile map based on a multi-color space, characterized by, The method includes: Obtain a soil profile image of the target soil profile, which includes a soil region and a standard colorimetric card region; perform a standardization analysis on the standard colorimetric card region using the standard colors and standard sizes of the standard colorimetric card to obtain a real-time illumination attenuation unit vector and a real-time baseline noise level. The color vector of each soil pixel in the Lab color space is obtained. The color vector of the soil pixel is orthogonally decomposed based on the real-time illumination attenuation unit vector. The geometric shadow probability of each soil pixel is obtained according to the magnitude of the parallel component. The matrix chromaticity probability is obtained by comparing the vertical component with the real-time base noise. The geometric shadow probability and the matrix chromaticity probability are fused to obtain the effective geometric shadow intensity of each soil pixel. For each soil pixel, a region to be analyzed is constructed with the soil pixel as the center; on the region to be analyzed, the overall effective geometric shadow intensity of the center pixel in each direction is obtained; the semi-positive definite symmetric matrix corresponding to each direction is weighted and fused with the overall effective geometric shadow intensity to obtain the feature matrix of each soil pixel; Solve for the eigenvalues ​​of the feature matrix, and obtain soil profile features based on the magnitude and differences of the eigenvalues.

2. The method according to claim 1, wherein, The method for obtaining the real-time illumination attenuation unit vector includes: Extract the set of color vectors in the Lab color space for all pixels in the central region of all neutral grayscale color blocks in the standard colorimetric card area; perform principal component analysis on the set of color vectors, and select the direction with the smallest angle with the negative L-axis direction in the color space from the two directions of the first principal component to construct a unit vector, thereby obtaining the real-time illumination attenuation unit vector.

3. The method according to claim 2, wherein, The method for obtaining the real-time baseline noise includes: Obtain the vertical Euclidean distance from each vector in the color vector set to the real-time illumination attenuation unit vector, calculate the standard deviation and average value of the vertical Euclidean distance, and obtain the real-time basic noise floor based on the 3sigma principle.

4. The method for extracting features from soil profile maps based on multi-color space according to claim 1, characterized in that, The method for obtaining the geometric shadow probability includes: The average parallel projection component of the color vector of all pixels in the darkest grayscale color block area of ​​the statistical standard color chart is obtained by subtracting the average parallel projection component from the parallel component and normalizing the difference to obtain the geometric shadow probability.

5. The method for extracting features from soil profile maps based on multi-color space according to claim 1, characterized in that, The method for obtaining the matrix chromaticity probability includes: If the vertical component is less than the real-time baseline noise, then the corresponding matrix chromaticity probability is set to 0. If the vertical component is not less than the real-time base noise, then the difference between the vertical component and the real-time base noise is mapped to a range of 0 to 1 to obtain the matrix chromaticity probability.

6. The method for extracting features from soil profile maps based on multi-color space according to claim 1, characterized in that, The method for obtaining the effective geometric shadow intensity includes: The effective geometric shadow intensity is obtained by mapping the matrix chromaticity probability negatively to the geometric shadow probability.

7. The method for extracting features from soil profile maps based on multi-color space according to claim 1, characterized in that, The method for constructing the region to be analyzed includes: Using the actual size of the standard colorimetric card as the denominator and the size of the standard colorimetric card region in the soil profile image as the numerator, the pixel resolution ratio is obtained; based on the pixel resolution ratio, the mapped size of the preset actual soil aggregate diameter in the image field of view is obtained; and a circular region to be analyzed is constructed with each soil pixel as the center and the mapped size as the diameter.

8. The method for extracting features from soil profile maps based on multi-color space according to claim 1, characterized in that, The method for obtaining the overall effective geometric shadow intensity includes: For any direction of the center pixel, the average effective geometric shadow intensity of the soil pixels in the area to be analyzed is taken as the overall effective geometric shadow intensity.

9. The method for extracting features from soil profile maps based on multi-color space according to claim 1, characterized in that, The methods for obtaining the soil profile features include: Solve for the two non-negative eigenvalues ​​of the characteristic matrix to obtain the first eigenvalue and the second eigenvalue, where the first eigenvalue is greater than or equal to the second eigenvalue; The sum of the first and second eigenvalues ​​is used as the surface roughness. The difference between the first and second eigenvalues ​​is normalized and mapped to obtain the directional compaction index; The surface roughness and the directional compaction index are used as soil profile features for each soil pixel.

10. The method for extracting features from soil profile maps based on multi-color space according to claim 9, characterized in that, After obtaining the soil profile characteristics, the following is also included: A directional compaction index map composed of directional compaction indices of soil pixels is obtained; the directional compaction index map is the same size as the soil region; at each depth coordinate of the target soil profile, the average directional compaction index on the directional compaction index map is calculated, and a depth distribution curve is constructed with the depth of the target soil profile as the abscissa and the corresponding average directional compaction index as the ordinate; based on a preset compaction discrimination threshold, the soil compaction layer interval is found in the depth distribution curve. After negatively mapping the surface roughness, the smoothness weight of each soil pixel is obtained; based on the smoothness weight, the color vectors of all soil pixels are weighted and averaged to obtain the overall true color vector of the soil profile image after removing the shadow effect; and the soil organic carbon content is evaluated based on the overall true color vector.