A method for image recognition and processing of wetting front depth and wetted area of unconfined permeable soil samples
Through image recognition technology, including binary processing and Fourier transform, it solves the problem of large measurement errors in the depth of the wetting front and the area of the wetted area in unconfined soil samples, and achieves high-precision shape description and area calculation of the wetted area. Improved work efficiency.
Patent Information
- Application Number
- CN202210038673.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-13
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-01-13
AI Technical Summary
The existing technology has large errors in measuring the wetting front depth and wet zone area of unconfined penetration soil samples, and it is difficult to accurately describe the shape of the wet zone.
Image recognition technology is used to calculate the depth and area of the wet zone through binary processing, median filtering, Fourier transform and spectrogram operations, including morphological operations, cropping area definition, grayscale image conversion, and spectrogram processing. Wait for steps.
It achieves accurate measurement and quantitative description of the shape of the wetting front depth and wetted area area of unconfined penetration soil samples, improving measurement accuracy and work efficiency.
Smart Images

Figure CN115018858B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an image recognition and processing method for the depth of a wetting front and a wetting area of an unconfined permeability soil sample, and belongs to the technical field of wetting area recognition in an unconfined permeability test of red soil. Background Art
[0002] Unconfined infiltration refers to the infiltration of water from the soil surface during natural rainfall and the rise and fall of reservoir water levels; the wetting front refers to the obvious interface formed by the leading part of the soil being wetted and the dry soil layer during the infiltration of water; at the wetting front, the soil moisture gradient is very large, so there will be a large soil moisture force to drive the wetting front to continue to move downward. The existing technology for measuring the depth of the wet area mostly relies on conventional means similar to a ruler, but the wet area is an irregular shape. If conventional means are used, there will be large measurement errors. Image recognition can not only accurately measure the depth of the wet front and the area of the wet area, but also quantitatively describe the shape of the wet area. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide an image recognition and processing method for the depth of the wetting front and the area of the wetting zone of an unconfined permeable soil sample, thereby solving the above-mentioned problem.
[0004] The technical solution of the present invention is: a method for identifying and processing the image of the wetting front depth and the wet zone area of an unconfined infiltration soil sample, which is suitable for identifying the wetting front depth and the wet zone area and shape of an unconfined infiltration sample, and calculates the wet zone depth and the wet zone area by binarizing the image, eliminating noise through median filtering, Fourier transforming, retaining the low-frequency components within the circle in the spectrum diagram, and truncating the high-frequency components outside the circle in the spectrum diagram.
[0005] The specific steps are:
[0006] Step 1: By photographing the sample, collect water infiltration images on the side of the unconfined sample to form an initial wetting front image.
[0007] Step 2: Read the initial wet peak image and perform binarization processing.
[0008] Step 3: Define the binary image cropping area based on morphological operations.
[0009] Step 4: Crop the original image based on the median filter of the image and determine the image intensity range value.
[0010] Step 5: Obtain the high-frequency enhancement image based on Fourier transform and inverse transform.
[0011] Step 6: Based on the transformation of the high-frequency enhanced binary image, a rough estimate of the wet area in the binary image is made.
[0012] Step 7: Calculate the depth and area pixels of the infiltration area.
[0013] The Step 3 is specifically as follows:
[0014] Step 3.1: Perform an open operation on the binary image to remove isolated small dots, burrs and small bridges (small dots connecting two areas), while the overall position and shape remain unchanged.
[0015] Step 3.2: Perform a mathematical closing operation on the binary image to fill small holes and bridge small cracks while keeping the overall position and shape unchanged.
[0016] Step 3.3: Find the index and value of non-zero elements and determine the clipping range.
[0017] The Step 4 is specifically as follows:
[0018] Step 4.1: Crop the original image based on the cropping range in Step 3.3 and convert it into a grayscale image.
[0019] Step 4.2: Perform two-dimensional median filtering on the grayscale image, so that pixels with large grayscale values different from those of surrounding pixels are changed and take values close to those of surrounding pixels, thereby eliminating isolated noise points.
[0020] Step 4.3: Adjust the intensity range of the grayscale image after two-dimensional median filtering.
[0021] The Step 5 is specifically as follows:
[0022] Step 5.1: Perform a two-dimensional fast Fourier transform and move the zero-frequency component to the center of the spectrum.
[0023] Step5.2: For the result of Step5.1, retain the low-frequency components inside the circle in the spectrum graph and truncate the high-frequency components outside the circle in the spectrum graph.
[0024] Step 5.3: Perform inverse zero-frequency shift and two-dimensional inverse fast Fourier transform.
[0025] The Step 6 is specifically as follows:
[0026] Step6.1: Select the required color range and fill the holes in the binary image.
[0027] Step 6.2: The basis and threshold are used to remove discrete small areas from the binary image.
[0028] Step 6.3: Perform morphological closing operation to eliminate the darker areas under the bright background.
[0029] Step 6.4: Perform morphological opening operation to eliminate the brighter areas under the dark background.
[0030] Step 6.5: Fill the holes in the binary image and estimate the wetting front area.
[0031] The Step 7 is specifically as follows:
[0032] Step 7.1: Label the connected components in the two-dimensional binary image and measure a set of area attributes of each labeled region of the labeled image.
[0033] Step 7.2: Calculate the area properties of the wetted area and verify it with the area value in Step 6.5.
[0034] Step 7.3: According to the index and value of the non-zero element found in step Step 3.3, determine the new clipping range interval and clip it.
[0035] Step 7.4: Label the connected components of the two-dimensional image values cropped in Step 7.3, and measure the extreme points in the labeled image area to obtain the wetting front depth.
[0036] The beneficial effects of the present invention are as follows: the present invention is suitable for quantitative description of soil permeability, quantitative expression of water shadow area in wetted zone, quantitative description of seepage of unconfined soil from naked eye observation to numerical value, and has higher accuracy and improved work efficiency than conventional wetting front depth measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a flow chart of the steps of the present invention;
[0038] Figure 2 is a gamma correction image after two-dimensional median filtering of the present invention;
[0039] Figure 3 It is a spectrum diagram obtained by Fourier transformation and shifting of the present invention;
[0040] Figure 4 It is a spectrum diagram obtained after modulo logarithmic transformation after Fourier transformation shift in the present invention;
[0041] Figure 5 It is the graph obtained by high-pass filtering of the present invention;
[0042] Figure 6 It is a high-frequency enhanced binary image of the present invention;
[0043] Figure 7 It is the area calculation region diagram obtained by the present invention after filling, removing discrete small area objects, closing operation and opening operation;
[0044] Figure 8It is the correspondence diagram between the original binary image and the extreme value coordinates of the present invention. DETAILED DESCRIPTION
[0045] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation methods.
[0046] like Figure 1 As shown, a method for identifying and processing images of the wetting front depth and the wetting area of an unconfined permeable soil sample is provided, and the specific steps are as follows:
[0047] Step 1: Photograph and collect water infiltration images from the side of the unconfined sample to form an initial wetting front image.
[0048] Step 2: Read the initial wet peak image and perform binarization processing.
[0049] Step 3: Define the binary image cropping area based on morphological operations.
[0050] Step 4: Crop the original image based on the median filter of the image and determine the image intensity range value.
[0051] Step 5: Obtain the high-frequency enhancement image based on Fourier transform and inverse transform.
[0052] Step 6: Based on the transformation of the high-frequency enhanced binary image, a rough estimate of the wet area in the binary image is made.
[0053] Step 7: Calculate the depth and area pixels of the infiltration area.
[0054] The Step 3 is specifically as follows:
[0055] Step 3.1: Perform an open operation on the binary image to remove isolated small dots, burrs and small bridges (small dots connecting two areas), while the overall position and shape remain unchanged.
[0056] Step 3.2: Perform a mathematical closing operation on the binary image to fill small holes and bridge small cracks while keeping the overall position and shape unchanged.
[0057] Step 3.3: Find the index and value of non-zero elements and determine the clipping range.
[0058] The Step 4 is specifically as follows:
[0059] Step 4.1: Crop the original image based on the cropping range in Step 3.3 and convert it into a grayscale image.
[0060] Step 4.2: Perform two-dimensional median filtering on the grayscale image, so that pixels with large grayscale values different from those of surrounding pixels are changed and take values close to those of surrounding pixels, thereby eliminating isolated noise points.
[0061] Step 4.3: Adjust the intensity range of the grayscale image after two-dimensional median filtering.
[0062] The Step 5 is specifically as follows:
[0063] Step 5.1: Perform a two-dimensional fast Fourier transform and move the zero-frequency component to the center of the spectrum.
[0064] Step5.2: For the result of Step5.1, retain the low-frequency components inside the circle in the spectrum graph and truncate the high-frequency components outside the circle in the spectrum graph.
[0065] Step 5.3: Perform inverse zero-frequency shift and two-dimensional inverse fast Fourier transform.
[0066] The Step 6 is specifically as follows:
[0067] Step6.1: Select the required color range and fill the holes in the binary image.
[0068] Step 6.2: The basis and threshold are used to remove discrete small areas from the binary image.
[0069] Step 6.3: Perform morphological closing operation to eliminate the darker areas under the bright background.
[0070] Step 6.4: Perform morphological opening operation to eliminate the brighter areas under the dark background.
[0071] Step 6.5: Fill the holes in the binary image and estimate the wetting front area.
[0072] The Step 7 is specifically as follows:
[0073] Step 7.1: Label the connected components in the two-dimensional binary image and measure a set of area attributes of each labeled region of the labeled image.
[0074] Step 7.2: Calculate the area properties of the wetted area and verify it with the area value in Step 6.5.
[0075] Step 7.3: According to the index and value of the non-zero element found in step Step 3.3, determine the new clipping range interval and clip it.
[0076] Step 7.4: Label the connected components of the two-dimensional image values cropped in Step 7.3, and measure the extreme points in the labeled image area to obtain the wetting front depth.
[0077] like Figure 2-8As shown, further, in Step 3, morphological closing and opening operations are performed on the binary image, and the cropping range is determined according to the index and value of the non-zero element being found.
[0078] Furthermore, in Step 4, the image is cropped according to the cropping range value. After the original image is cropped based on the cropping range of Step 3.3, the true color image is converted into a grayscale image, and a two-dimensional median filter is performed on the grayscale image to eliminate isolated noise points and adjust the grayscale image intensity range value.
[0079] Furthermore, the cropped image is converted into a grayscale image, and the grayscale image is subjected to median filtering. The specific functions of the median filtering are as follows:
[0080] Median filtering is a commonly used nonlinear operation in image processing to reduce "salt and pepper" noise. When the goal is to reduce noise and preserve edges at the same time, median filtering is more efficient than convolution.
[0081] Furthermore, in Step 5.1, a two-dimensional fast Fourier transform is performed and the zero-frequency component is moved to the center of the spectrum.
[0082] Furthermore, the purpose of performing a two-dimensional fast Fourier transform is as follows: Since the noise in an image often represents a sudden change in the grayscale value on the image, which corresponds to the high-frequency part, and most of the other content in the image is mainly concentrated in the low-frequency part. Therefore, by performing a Fourier transform on the spatial image and converting it to the frequency domain, we can obtain the phase and amplitude values of each pixel of the image. For the phase, it represents the position and shape information in the image. Generally, we do not process it, otherwise we may not be able to restore the shape of the original image. The amplitude value mainly represents the size of the energy, that is, the energy size at each frequency. We only need to set the energy value of the high-frequency part to 0 to remove the noise.
[0083] Furthermore, the two-dimensional fast Fourier transform is to transform the grayscale distribution function of the image into the frequency distribution function of the image. The specific steps are as follows:
[0084] Transpose the image, perform one-dimensional Fourier transform on the transposed image matrix row by row, transpose the intermediate matrix of the transformation again, and perform one-dimensional Fourier transform on the transposed matrix again.
[0085] Furthermore, the two-dimensional fast Fourier transform is defined as follows:
[0086]
[0087] Where: and are the forward transform kernel and inverse transform kernel respectively; m and n are the spatial domain sampling values; F(p, q) is the frequency spectrum of the discrete signal f(x, y).
[0088] Furthermore, after Fourier transform, the low-frequency parts are concentrated in the four corners, and after shifting, they are concentrated in the center of the image for easy processing.
[0089] Furthermore, Step 5.2 retains the low-frequency components within the circle in the spectrum graph and cuts off the high-frequency components outside the circle in the spectrum graph:
[0090]
[0091] Furthermore, assuming that the center of the spectrum is at (M / 2, N / 2), the distance D(u, v) from any spectrum component (u, v) to the center (origin) is defined as:
[0092]
[0093] Where D0 is the cutoff frequency of the low-pass filter.
[0094] Furthermore, Step 5.3 performs inverse zero frequency shift and two-dimensional inverse fast Fourier transform.
[0095] The inverse zero-frequency shift is restored to the original distribution, and then the inverse Fourier transform is performed to restore the time domain image, at which point the noise on the image can be removed.
[0096] Further, the two-dimensional inverse fast Fourier transform:
[0097]
[0098] The meanings of each term in the formula are as above.
[0099] Furthermore, Step 6 selects the required color range based on the threshold value, fills the holes of the binary image, deletes small discrete areas, performs morphological closing and opening operations, and then fills the holes in the binary image and estimates the wetting front area.
[0100] The specific implementation method is as follows: select the required color range and fill the holes in the binary image, use the basis and threshold to delete discrete small areas from the binary image, perform morphological closing and opening operations to eliminate darker areas under a bright background and brighter areas under a dark background, fill the holes in the binary image and estimate the wetting front area.
[0101] Furthermore, Step 7 annotates the connected components of the two-dimensional binary image, measures a set of area attributes of the annotated image region, calculates the area pixels and verifies them with the area values in Step 6.4.
[0102] The specific implementation method is as follows: mark the connected components in the two-dimensional binary image, and measure a set of area attributes of each marked area of the marked image, calculate the area attributes of the wet area and verify them with the area value in step Step6.5, determine the new cropping range interval and crop according to the index and value of the non-zero elements found in step Step3.3, mark the connected components of the two-dimensional image value cropped in step Step7.3, and measure the extreme points in the marked image area to obtain the wet front depth.
[0103] Furthermore, the connected components of the two-dimensional binary image are annotated, all attributes of the annotated image region are measured, the extreme points in the region are calculated, and the annotated points are made on the original binary image.
[0104] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A method for identifying and processing images of the wetting front depth and the wetting area of an unconfined permeable soil sample, characterized in that: Step 1: By photographing the sample, collect the water infiltration picture on the side of the unconfined sample to form the initial wetting front picture; Step 2: Read the initial wet peak image and perform binarization processing; Step 3: Define the binary image cropping area based on morphological operations; Step 4: Crop the original image based on the median filter of the image and determine the image intensity range value; Step 5: Obtain high-frequency enhancement image based on Fourier transform and inverse transform; Step 6: Based on the transformation of the high-frequency enhanced binary image, a rough estimate of the wet area in the binary image is made; Step 7: Calculate the depth and area pixels of the infiltration area; The Step 3 is specifically as follows: Step 3.1: Perform an open operation on the binary image to remove isolated small dots, burrs and small bridges, while the overall position and shape remain unchanged; Step 3.2: Perform a mathematical closing operation on the binary image to fill small holes and close small cracks, while the overall position and shape remain unchanged; Step 3.3: Find the index and value of non-zero elements and determine the clipping range; The Step 6 is specifically as follows: Step 6.1: Select the required color range and fill the holes in the binary image; Step 6.2: The basis and threshold are used to remove discrete small areas from the binary image; Step 6.3: Perform morphological closing operation to eliminate the darker areas under the bright background; Step 6.4: Perform morphological opening operation to eliminate the brighter areas under the dark background; Step 6.5: Fill the holes in the binary image and estimate the wetting front area; The Step 7 is specifically as follows: Step 7.1: Annotate the connected components in the two-dimensional binary image and measure a set of area attributes of each annotated region of the annotated image; Step 7.2: Calculate the area attribute of the wet area and verify it with the area value in Step 6.5; Step 7.3: According to the index and value of the non-zero element found in step 3.3, determine the new clipping range interval and clip it; Step 7.4: Label the connected components of the two-dimensional image values cropped in Step 7.3, and measure the extreme points in the labeled image area to obtain the wetting front depth.
2. The method for identifying and processing the wetting front depth and the wetting area image of an unconfined permeable soil sample according to claim 1 is characterized in that The Step 4 is specifically as follows: Step 4.1: Crop the original image based on the cropping range in Step 3.3 and convert it into a grayscale image; Step 4.2: Perform two-dimensional median filtering on the grayscale image; Step 4.3: Adjust the intensity range of the grayscale image after two-dimensional median filtering.
3. The method for identifying and processing the wetting front depth and the wetting area image of an unconfined permeable soil sample according to claim 1 is characterized in that The Step 5 is specifically as follows: Step 5.1: Perform a two-dimensional fast Fourier transform and move the zero-frequency component to the center of the spectrum; Step 5.2: For the result of Step 5.1, the low-frequency components inside the circle in the spectrum graph are retained, and the high-frequency components outside the circle in the spectrum graph are truncated; Step 5.3: Perform inverse zero-frequency shift and two-dimensional inverse fast Fourier transform.
