A method and system for layered pretreatment of sedimentary rock rock samples for nanoindentation testing
Patent Information
- Application Number
- CN202511568074.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-10-30
AI Technical Summary
[0004]本发明旨在解决沉积岩岩样检测中,镜下与宏观图像难关联、岩样特征难精准提取、测区定位不明确等问题
1.本发明的沉积岩岩样纳米压痕试验分层预处理方法,通过引入图像分层预处理与纳米压痕试验数据融合方法,实现了对洞穴次生化学沉积物风化分层的自动识别与评估,大幅提升了风化分层界限的识别精度,避免了传统方法中依赖人工判断的主观性与不一致性。
Smart Images

Figure CN121617085B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of sedimentary rock sample detection and image analysis technology, and more specifically, relates to a method and system for layered preprocessing of nanoindentation test of sedimentary rock samples. Background Technology
[0002] In geological engineering and rock mechanics research, well-behaved bedding rock samples are often used for nanoindentation tests to obtain mechanical parameters such as hardness and elastic modulus at the microscopic scale for different strata. These tests require extremely high precision in sample pretreatment, but traditional processing methods suffer from a series of technical problems, including difficulties in layer identification, coordinate mapping distortion, and lack of data integration, which limit experimental efficiency and the scientific rigor of parameter interpretation. The bedding structure of rock samples often exhibits complex variations in color, texture, and microstructure. Traditional manual bedding methods are limited by operational experience and visual errors, making it difficult to reliably identify diverse layers, especially under slowly changing lighting fields, speckled interference, or stained sample backgrounds, where the inaccuracy rate is high. Furthermore, significant differences in thickness between different layers can easily lead to misidentification or misclassification of bedding boundaries, affecting the representativeness and comparability of subsequent physical property analyses.
[0003] Automatic layer drawing faces challenges in image processing, including gradient noise, jagged edges, and boundary breaks. These issues can lead to discontinuous layer visualization or misjudgment of closed curves, affecting the accuracy and operability of microindentation test area positioning. Currently, there is a lack of image drawing algorithms that combine local edge tracking, noise suppression, and curve smoothing, failing to meet the demand for high-precision layer boundary representation in automated experimental workflows. In nanoindentation testing, the equipment acquires the relative coordinates of the indenter path, but cannot directly trace the specific distribution of the sample in the image, resulting in a mismatch between test points and actual images. This severely impacts data spatial interpretation and microstructural correlation analysis. Especially in batch testing points or large-field-of-view samples, coordinate matching and resetting accuracy are crucial for subsequent evaluation. After the experiment, data presentation is often dominated by text or charts, lacking a systematic integration of the relationship between "image-layering-physical properties-mineral composition," leading to scattered experimental results that fail to intuitively reflect the overall sample structure and interlayer differences. Existing platforms generally lack an integrated visual interface and cannot support interactive comparison and analysis of multi-source data. This patent proposes an image-assisted weathering layer identification, coordinate repositioning and positioning, and data integration visualization system suitable for rock samples with bedding characteristics. Combining algorithms such as image preprocessing, texture enhancement, clustering recognition, edge tracking, affine mapping and data fusion, it effectively improves the accuracy of layering and the efficiency of data interaction, serving multiple fields such as rock mechanics and geological disaster prediction. Summary of the Invention
[0004] This invention aims to solve problems in sedimentary rock sample testing, such as difficulty in correlating microscopic and macroscopic images, difficulty in accurately extracting rock sample features, and unclear test area positioning. Through a process involving rock sample preparation, image layering, coordinate repositioning and positioning, microscopic calibration, and data integration, it achieves rock sample texture preservation, bedding line visualization, accurate coordinate transformation, and visualization of comprehensive attributes, thereby improving the efficiency and accuracy of sedimentary rock sample testing and analysis.
[0005] To address the aforementioned deficiencies or improvement needs of existing technologies, as a first aspect of this invention, the present invention provides a method for pre-treatment of sedimentary rock samples for nanoindentation testing, comprising: S1. Complete the preparation of sedimentary rock samples; S2. First, local non-mean filtering is used to remove illumination interference, preserving the texture and true color difference of the rock sample; then, image channels are separated, features are extracted and optimized to obtain multi-dimensional feature data that can reflect the differences in the rock sample; next, k-means clustering is used to divide the image rows, and after determining the original layer boundaries, false layers are removed; finally, edge detection, curve drawing and smoothing adjustment are used to complete the visualization of the bedding lines. S3. Using the coordinate reset function, first select the puncture point on the image to obtain the pixel coordinates, and prepare the actual physical control point coordinates. Then, pair the puncture point with the corresponding physical control point coordinates one by one. Next, construct and solve the two-dimensional affine transformation model, and finally obtain the transformation relationship between pixel coordinates and actual coordinates. Realize the inverse calculation of coordinate transformation of any point, which is used for the location and framing of the indentation measurement area. S4. To correlate the color distribution of microscopic and macroscopic images, firstly, convert different types of microscopic test area photos into 8-bit depth images and perform corresponding adaptation based on image type; then, perform foreground and background segmentation, and combine Euclidean distance transformation and watershed method to separate adhering particles, and then trim qualified particles through filtering; finally, import relevant physical property parameters into the data integration module to obtain a visualized comprehensive property image of the sample.
[0006] Furthermore, the specific process for preparing and pretreating the sedimentary rock sample in S1 is as follows: During sampling, the sample is cut along the bedding direction and the surface is polished. The surface flatness of the polished sample must meet the requirements of the nano-indentation platform. After the non-test surface of the sample is evenly coated with glue, it is bonded to a metal carrier with calibration control points. Then, the orthogonal image is captured by the imaging equipment on a flat table or test bench.
[0007] Furthermore, the specific method for local non-mean filtering in S2 is as follows: Local non-mean filtering is used to remove slowly varying illumination fields from the image before channel separation and subsequent layering, retaining only local textures and true color differences. This makes the features more stable and closer to the rock sample color, by filtering out the slowly varying illumination fields from the original image. Split into slowly changing backgrounds And the texture and color difference of real rock samples as follows: , Using a "large-scale blur kernel" for smoothing, the transformation from M to B is as follows: , in, Indicates a partial background; This represents the local averaging filter operator; Indicates the filter kernel size; Use background subtraction mode to remove large areas of uneven brightness; preserve relative contrast and crop to [0, 255] to obtain the result. The conversion relationship is as follows: , in, This represents the enhanced image after background removal.
[0008] Furthermore, the specific process for obtaining the multidimensional feature data in S2 is as follows: Spectral features actually correspond to physical properties; RGB features of an image can capture chemical or mineral differences, while grayscale can record grain size and porosity. Separating the RGB and grayscale channels of an image, let's say the original image is... The row mean is defined as: , in, This represents the average color brightness of the y-th row; Indicates the image width; This represents the value of a specific channel among the three color channels of RGB; These represent the pixel values of the red, green, and blue channels of the image, respectively, with each value ranging from 0 to 255. Gray-scale components are defined as follows: , , in, Represents the luminance component of the Lab color space; This represents the RGB to Lab color space conversion operator; Represents the luminance component in the Lab model; This represents the average grayscale or brightness of the y-th row; Where the RGB range is [0,255] and the grayscale is [0,100], the RGB histogram and grayscale histogram of the image are derived through the in-layer values; The illuminance-reflection-noise model is established as follows: , in, Indicates the image in pixels The brightness value of color channel C, including reflectance and illuminance; This represents the reflectivity component, i.e., the true reflectivity characteristics of the rock sample surface in this channel. This represents the illuminance component, which is the intensity of light irradiated at that point. This indicates the noise term, which includes high-frequency components such as measurement errors or surface micro-reflections. If the light shines on If the direction is approximately constant, then the row mean mainly reflects the chromaticity of the sediment, and the expected value of the row mean can be obtained as follows: , in, This represents the expected value of the row mean, reflecting the overall average brightness trend of the channel; This represents the average brightness of color channel C in the y-th row; The average brightness of a row is mainly determined by reflectivity; After processing, Z-score normalization can be performed, which requires first obtaining the inter-row variance of the data. Then normalization was performed: , , in, This represents the row mean variance of channel C (characterizing the degree of brightness fluctuation with stratification). Indicates the image height; Z-score represents the normalized value of the y-th row on channel C, i.e., the row brightness after normalization. This indicates that the mean of all rows in channel C is the mean of the Z-score; This represents the normalized weight of each channel, used to fuse multi-channel features and characterize the importance or volatility of a channel. This represents the standardized channel weights. The normalized variance is the variance of the variance. The result after normalization or weighted correction; The amplitude limit is set as follows: , , , in, Indicates the weighting coefficient; Indicates the lower limit of the weight; Indicates the upper limit of the weight; The weighted features for each dimension are as follows: , in, The fused layered feature row vector, i.e., the weighted composite layered response value, is used to determine the layer boundary location. Represents the weight vector; This represents the channel feature vector in the y-th row, which is the normalized response intensity of each channel of R / G / B / L in the y-th row; These represent the weights corresponding to the R, G, B, and L channels, respectively.
[0009] Furthermore, the specific process of removing pseudo-layers after determining the original layer boundaries in S2 is as follows: After clustering, the labels In roll-up vertical browsing, a step signal is presented, and the change in adjacent row labels indicates the layer boundary: , in, This represents the initially detected set of boundary indices; Indicates the layer label number of the current row; Indicates the layer label number of the previous row; Considering that vertically close pixels actually constitute one layer, the vertical pixel distance between two layers is made smaller than... Determined to be one layer; passed To remove some of the pseudo-layers caused by blemishes and scratches: , in, This represents the set of valid layer boundaries after filtering, which is the actual layer boundary position retained after minimum spacing filtering. The location of the i-th layer boundary is used to calculate the spacing between adjacent layers; This represents the minimum effective interlayer spacing, controlling the minimum spacing between layer boundaries and eliminating false layers caused by noise. After the algorithm completes the layer preprocessing, the layer lines also need to be visualized and drawn.
[0010] Furthermore, the two-dimensional affine transformation model in S3 requires at least three pairs of coordinate points to determine the model. When there are more than three pairs of coordinate points, the least squares method is used for fitting to improve stability.
[0011] Furthermore, the specific process of completing the corresponding adaptation based on image type in S4 is as follows: The following adaptations are performed for several types of images: For RGB color, first convert to grayscale → then quantize: , in, This represents the standard image pixel value after grayscale conversion and quantization, ranging from [0, 255]. These represent the pixel values for the red, green, and blue channels, respectively. For 16-bit integers, the full dynamic range is stretched using ScaleWhenConverting: , in, This represents the pixel value (0–65535) in the original 16-bit image. This represents the minimum pixel value of the image; Indicates the maximum pixel value of the image; For 32-bit floating point: , in, This represents the pixel values of the original 32-bit floating-point image.
[0012] Furthermore, the specific process of obtaining qualified particles through filtration in step S4 is as follows: Area filtering: Retain ; Roundness Filtering: Retain ; Boundary exclusion: If There exist pixels that satisfy ; in, The minimum threshold representing the particle area; This represents the actual area of the k-th particle; The maximum threshold representing the particle area; The minimum threshold representing roundness or shape factor; This represents the actual roundness value of the k-th particle; The maximum threshold representing roundness; This represents the set of pixels corresponding to the k-th region; The above conditions for determining whether an edge is disregarded are all judged within the same loop. "Unqualified edges are skipped directly" to avoid unnecessary calculations. Visualization can quickly identify edge edges by simply overlaying a red layer.
[0013] As a second aspect of the present invention, a layering pretreatment system for nanoindentation experiments on sedimentary rock samples is also provided, comprising: Sedimentary rock sample preparation unit, used to complete the preparation of sedimentary rock samples; The image layering processing unit is used to first remove illumination interference by local non-mean filtering, preserving the texture and true color difference of the rock sample; then separate the image channels, extract features and optimize them to obtain multi-dimensional feature data that can reflect the differences of the rock sample; next, k-means clustering is used to divide the image rows, and after determining the original layer boundaries, false layers are removed; finally, edge detection, curve drawing and smoothing adjustment are used to complete the visualization layering of the bedding lines. The coordinate reset positioning unit is used to first select the puncture point on the image to obtain the pixel coordinates and prepare the actual physical control point coordinates through the coordinate reset function. Then, the puncture point and the corresponding physical control point coordinates are paired one by one. Next, a two-dimensional affine transformation model is constructed and solved to finally obtain the transformation relationship between the pixel coordinates and the actual coordinates, realizing the inverse calculation of coordinate transformation of any point, which is used for the positioning and framing of the indentation measurement area. The microscopic calibration and integration unit is used to correlate the color distribution of microscopic and macroscopic images. First, it converts different types of microscopic test area photos into 8-bit bit depth images and performs corresponding adaptation based on image type. Then, it performs foreground and background segmentation, and separates adhering particles by combining Euclidean distance transformation and watershed method. Then, it trims qualified particles through filtering. Finally, it imports relevant physical property parameters into the data integration module to obtain a visualized image of the comprehensive properties of the sample.
[0014] As a third aspect of the invention, a computer-readable storage medium is also provided, on which a computer program is stored, which is executed by a processor, any step of the described method for pre-treatment of sedimentary rock sample nanoindentation layering.
[0015] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects: 1. The sedimentary rock sample nanoindentation test layer preprocessing method of the present invention, by introducing image layer preprocessing and nanoindentation test data fusion method, realizes automatic identification and evaluation of weathering stratification of cave secondary chemical sediments, greatly improves the identification accuracy of weathering stratification boundaries, and avoids the subjectivity and inconsistency of relying on manual judgment in traditional methods.
[0016] 2. The layered preprocessing method for nanoindentation tests on sedimentary rock samples of the present invention achieves accurate mapping between image coordinates and actual physical coordinates by constructing a coordinate reset function based on two-dimensional affine transformation. It can accurately track and locate the position of nanoindentation test points and effectively support the coupling analysis of subsequent physical property parameters and layered structure.
[0017] 3. The layered preprocessing method for nanoindentation tests on sedimentary rock samples of the present invention organically integrates image information, indentation property data and mineral composition analysis through a comprehensive data integration module, providing an intuitive, systematic and interactive decision support interface for weathering degree evaluation, which greatly improves evaluation efficiency and engineering applicability. Attached Figure Description
[0018] Figure 1 This is a flowchart of a layered pretreatment method for nanoindentation testing of sedimentary rock samples according to an embodiment of the present invention; Figure 2This is a schematic diagram of the pretreatment process for weathering and stratification of cave secondary chemical sediments using nanoindentation, according to an embodiment of the present invention. Figure 3 This is a schematic diagram of the sample product according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the image layering processing flow according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the coordinate reset process according to an embodiment of the present invention; Figure 6 This is a schematic diagram of clustering hierarchy in an embodiment of the present invention; Figure 7 This is a schematic diagram of the microscopic color patch calibration process according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the data integration module in an embodiment of the present invention; Figure 9 This is a schematic diagram of the indentation in an embodiment of the present invention; Figure 10 This is a schematic diagram of the system units in an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0020] Example 1 Please refer to Figure 1 This embodiment 1 provides a method for pre-treatment of sedimentary rock samples for nanoindentation testing, including: S1. Complete the preparation of sedimentary rock samples; S2. First, local non-mean filtering is used to remove illumination interference, preserving the texture and true color difference of the rock sample; then, image channels are separated, features are extracted and optimized to obtain multi-dimensional feature data that can reflect the differences in the rock sample; next, k-means clustering is used to divide the image rows, and after determining the original layer boundaries, false layers are removed; finally, edge detection, curve drawing and smoothing adjustment are used to complete the visualization of the bedding lines. S3. Using the coordinate reset function, first select the puncture point on the image to obtain the pixel coordinates, and prepare the actual physical control point coordinates. Then, pair the puncture point with the corresponding physical control point coordinates one by one. Next, construct and solve the two-dimensional affine transformation model, and finally obtain the transformation relationship between pixel coordinates and actual coordinates. Realize the inverse calculation of coordinate transformation of any point, which is used for the location and framing of the indentation measurement area. S4. To correlate the color distribution of microscopic and macroscopic images, firstly, convert different types of microscopic test area photos into 8-bit depth images and perform corresponding adaptation based on image type; then, perform foreground and background segmentation, and combine Euclidean distance transformation and watershed method to separate adhering particles, and then trim qualified particles through filtering; finally, import relevant physical property parameters into the data integration module to obtain a visualized comprehensive property image of the sample.
[0021] This embodiment 1 further elaborates on the above steps.
[0022] (1) Preparation of sedimentary rock samples Please refer to Figure 2 as well as Figure 3 During sampling, the sample should be cut along the bedding direction and the surface of the sample should be polished. The flatness of the polished surface should meet the requirements of the nano-indentation platform. The sample should be evenly coated with glue on the non-test surface and then bonded to a metal carrier with calibrable control points. Then, the orthogonal image should be captured by the imaging equipment on a flat table or test bench.
[0023] (2) Image layering processing Please refer to Figure 4 as well as Figure 5 After entering the software image layering module, the algorithm uses local non-mean value filtering in the preprocessing stage. This is used to filter out slowly changing illumination fields in the image before channel separation and subsequent layering, retaining only local textures and true color differences. This makes the line features more stable and closer to the rock sample color. By using the original image... Split into slowly changing backgrounds And the texture and color difference of real rock samples as follows: , Using a "large-scale blur kernel" for smoothing, the transformation from M to B is as follows: , in, Indicates a local background (slowly changing illuminance); This represents the local averaging filter operator; Indicates the filter kernel size; Use background subtraction mode to remove large areas of uneven brightness; preserve relative contrast and crop to [0, 255] to obtain the result. The conversion relationship is as follows: , in, This represents the enhanced image after background removal.
[0024] Spectral features actually correspond to physical properties; RGB features of an image can capture chemical or mineral differences, while grayscale can record grain size and porosity. Separating the RGB and grayscale channels of an image, let's say the original image is... The row mean is defined as: , in, This represents the average color brightness of the y-th row (averaged by column). Indicates the image width (number of columns); This represents the value of a single channel among the three color channels of RGB. The pixel values of the red, green, and blue channels of the image, with each value ranging from 0 to 255; Gray-scale components are defined as follows: , , in, Represents the luminance component (L*) of the Lab color space; This represents the RGB to Lab color space conversion operator; This represents the luminance component (i.e., lightness) in the Lab model. This represents the average grayscale (brightness) value of the y-th row; Where the RGB range is [0,255] and the grayscale is [0,100], the RGB histogram and grayscale histogram of the image are derived through the in-layer values; The illuminance-reflection-noise model is established as follows: , in, This represents the brightness value (including reflectance and illuminance) of the image at pixel (x,y) in color channel C. This represents the reflectivity component, which is the true reflective properties of the rock sample surface in this channel (reflecting the color of the mineral / particle itself, which does not change with light). It represents the illuminance component, which is the intensity of light irradiated at that point (characterizing the spatial distribution of light during shooting). This indicates the noise term, which includes high-frequency components such as measurement errors or surface micro-reflections. If the light shines on If the direction is approximately constant, then the row mean mainly reflects the chromaticity of the sediment, and the expected value of the row mean can be obtained as follows: , in, The expected value of the row mean (statistical average brightness) reflects the overall average brightness trend of the channel; This represents the average brightness of color channel C in the y-th row (row feature, used to analyze layering variations); The average brightness of a row is mainly determined by reflectivity; After processing, Z-score normalization can be performed, which requires first obtaining the inter-row variance of the data. Then normalization was performed: , , in, This represents the row mean variance of channel C (characterizing the degree of brightness fluctuation with stratification). Indicates the image height (number of rows); This represents the normalized value (Z-score) of the y-th row on channel C, i.e., the row brightness after normalization. This means that the mean (expected Z-score) of all rows in channel C is the mean of the Z-score (which should be approximately 0). This represents the normalized weight of each channel, used to fuse multi-channel features (characterizing the importance or volatility of a channel). This represents the standardized channel weights. The normalized variance is the variance of the variance. The result after normalization or weighted correction; The amplitude limit is set as follows: , , , in, Indicates the weighting coefficient; Indicates the lower limit of the weight; Indicates the upper limit of the weight; The weighted features for each dimension are as follows: , in, The fused layered feature row vector, i.e., the weighted composite layered response value, is used to determine the layer boundary location. Represents the weight vector; The channel feature vector (after Z-score normalization) in the y-th row represents the normalized response intensity of each channel of R / G / B / L in the y-th row. These represent the weights for the R, G, B, and L channels, respectively. Multidimensional features significantly improve the stratification accuracy of color difference-dominated samples.
[0025] After the above feature processing, row K-means clustering is performed, and the weighted feature vector is: Given the number of clusters Divide all rows into mutually exclusive subsets: , definition Center of mass For the first The intra-class error of a cluster is minimized by the intra-class sum of squares: , Convergence criterion: SSE decreases < Or the number of iterations is ≤300, and the complexity is O(Hkt) (t≈10–30).
[0026] The algorithm iteration process is as follows: Initialization is performed by selecting the head center using k-means++. Random, followed by probability If the sample is far from the selected center, the E-step (“expected” step) in this algorithm—assigning samples to the nearest cluster—can be considered as follows: , M-step (“maximization” step) — Update cluster centers as follows: , in, Let represent the center vector (centroid) of the j-th cluster. This represents the number of samples in the j-th cluster. This represents the cluster center update formula. The weighted feature vector in row y represents the fused features (R, G, B, L, four dimensions) of row y in the rock sample image. The final convergence criterion is: if or Next → End.
[0027] After clustering, the labels In roll-up vertical browsing, a step signal is presented, and the change in adjacent row labels indicates the layer boundary: , in, This represents the initially detected set of boundary indices; Indicates the layer label number of the current row; Indicates the layer label number of the previous row; Considering that vertically close pixels actually constitute one layer, the vertical pixel distance between two layers is made smaller than... Determined to be one layer; passed To remove some of the pseudo-layers caused by blemishes and scratches: , in, This represents the set of valid layer boundaries after filtering, which is the actual layer boundary position retained after minimum spacing filtering. The location of the i-th layer boundary is used to calculate the spacing between adjacent layers; The minimum effective interlayer spacing (unit: pixels) controls the minimum spacing between layer boundaries, eliminating false layers caused by noise; after the algorithm completes the layer preprocessing, the layer lines also need to be visualized and drawn.
[0028] Canny edge pass: threshold 80 / 160, output binary image For grayscale: , During the drawing process, due to the multi-dimensional verification and judgment of layer boundaries, it is necessary to define... The radius of the tracking window (default is 1). The algorithm for controlling the instantaneous slope of the curve during drawing is as follows: , If there are no edge points in the column = Maintaining horizontal alignment is equivalent to taking the nearest edge of the midline at window x for each column, which can effectively suppress the identification of layer boundaries as closed curves. Since pixel jaggedness may occur when drawing layer boundaries, the drawn curves need to be smoothed using the following Gaussian smoothing: , After verification A kernel width of approximately 0.6-1.5mm is sufficient to smooth pixel jaggedness without erasing layer fluctuations of more than 5mm.
[0029] During curve plotting, excessive curve fluctuations in certain areas may cause layer lines to fail to display correctly. This can be corrected by manually adjusting the slider. Considering that layer lines typically penetrate the sample, the penetration slider can be used to filter out unsuitable layer lines. (Fluctuation amount...) and connectivity It can be defined as follows: , , The corresponding rock strata curves can be drawn on the original image using an enumeration algorithm.
[0030] (3) Coordinate reset and positioning During nanoindentation testing, the equipment itself can only obtain the coordinate information of each position after the sample is placed on the test platform. After the test is completed, it is not easy to re-obtain the specific test point on the sample. It is necessary to use the coordinate reset function of this patent to calculate the coordinates of all positions of each point under the microscope.
[0031] Figure 6This is a schematic diagram of the coordinate reset process in this invention. Coordinate reset establishes a mapping relationship between the image and the real space by selecting puncture points (pixel coordinates) on the image and pairing them with the coordinates of actual physical control points, thus realizing the transformation (or reversal) from image coordinates to actual coordinates. This step is a prerequisite for image measurement, positioning analysis, spatial reconstruction, and other functions. The core is to construct and solve a two-dimensional affine transformation model. An affine transformation is a mathematical model that describes linear changes in an image, including transformations such as rotation, scaling, translation, and shearing. In this model, let (x,y) be the selected pixel coordinates (puncture points) in the image, (X,Y) be the corresponding actual physical coordinates (control points), and a,b,c,d,e,f be the affine transformation parameters to be solved. Then the transformation of each point can be expressed as: , The main steps involve importing or manually inputting the actual coordinates of control points, typically physical coordinates measured on-site, in units such as millimeters or micrometers. Then, pixels are selected on the image by clicking the image magnification window, and the system records their pixel positions. Pairing control points with control points involves establishing a one-to-one correspondence between a specific control point and its coordinates. Finally, a system of affine line equations can be constructed and solved; at least three point pairs uniquely determine a two-dimensional affine transformation. If there are more than three pairs, the system uses least squares fitting to improve stability. The transformation matrix is calculated to derive the transformation formula from pixel to actual coordinates, based on which subsequent coordinates of any point can be transformed and inversely calculated. After completion, this coordinate system can be used in the nanoindentation module for positioning and defining the indentation measurement area.
[0032] (4) Microscopic calibration and integration Since the field-of-view difference makes it difficult to correlate the color distribution under the microscope with the macroscopic optical perspective, calibration is required to check the area distribution of bright and dark color blocks or pores in the rock sample test area. The microscope color block module can automatically calculate and calibrate the area size and proportion of each color block under the microscope.
[0033] Figure 7 This is a schematic diagram of the microscopic color patch calibration process in this invention. First, the test area photos taken under the microscope need to be converted into 8-bit depth images. The following adaptations are performed for several types of images: For RGB color, first convert to grayscale → then quantize: , in, This represents the standard image pixel value after grayscale conversion and quantization, ranging from [0, 255]. These represent the pixel values for the red, green, and blue channels, respectively. For 16-bit integers, the full dynamic range is stretched using Scale When Converting: , in, Represents the pixel values (0–65535) in the original 16-bit image; This represents the minimum pixel value of the image; Indicates the maximum pixel value of the image; For 32-bit floating point: , in, Represents the pixel values of the original 32-bit floating-point image.
[0034] Otsu adaptive thresholding works by considering all possible thresholds. Scan it once, and... Indicates threshold Time Pixel percentage of class (0=background, 1=foreground); This represents the average grayscale value of the corresponding class. To maximize the inter-class variance, the following is proposed: , For EDT+Watershed, the distance field from the nearest background pixel to the foreground mask B is mainly obtained through Euclidean distance transformation: , Combining local maxima selection, the h-maxima method retains only maxima at depths ≥ h as seeds to suppress shallow noise. Treating −D(x,y) as a terrain surface, water is "injected" from each marker downwards, and the confluence line becomes the particle boundary, thus obtaining the label map L (executed within the foreground mask). Connectivity labeling is then applied to L to obtain an independent number for each particle. The following rules are used to filter out unqualified particles: Area filtering: Retain ; Roundness Filtering: Retain ; Boundary exclusion: If There exist pixels that satisfy ; in, The minimum threshold representing the particle area; This represents the actual area of the k-th particle; The maximum threshold representing the particle area; The minimum threshold representing roundness (or shape factor); This represents the actual roundness value of the k-th particle; The maximum threshold representing roundness; This represents the set of pixels corresponding to the k-th region; The above conditions for determining whether an edge is disregarded are all judged within the same loop. "Unqualified edges are skipped directly" to avoid unnecessary calculations. Visualization can quickly identify edge edges by simply overlaying a red layer.
[0035] Figure 8 This is a schematic diagram of the data integration module of this invention. After importing or inputting hardness modulus and elastic modulus in this module, and completing various processing steps, a visualized image of the sample's comprehensive properties can be obtained in this module. This image includes: original image location markers of the sample measurement points, microscopic images of the measurement points, elastic modulus and hardness modulus of the measurement points, and mineral composition analysis of the sample. Figure 9 As shown.
[0036] The method described in Example 1 has broad application prospects in the field of geological exploration. It can provide accurate rock sample stratification data for oil and gas reservoir and mineral resource exploration, help researchers to better understand the internal structure and physical property distribution of sedimentary rocks, provide reliable technical support for reservoir evaluation and resource reserve estimation, help improve exploration efficiency and accuracy, and reduce ineffective exploration costs.
[0037] Meanwhile, this method also has significant application value in the fields of geotechnical engineering and geological disaster prevention. Through precise preprocessing and analysis of sedimentary rock samples from the engineering area, the mechanical properties and bedding characteristics of the rock samples can be more accurately determined, providing a scientific basis for engineering design such as tunnel excavation and slope support. It can also provide key data for risk assessment and early warning of geological disasters such as earthquakes and landslides, ensuring engineering safety and regional geological stability.
[0038] Example 2 Please refer to Figure 10 This embodiment 2 provides a layering pretreatment system for nanoindentation experiments on sedimentary rock samples, comprising: Sedimentary rock sample preparation unit, used to complete the preparation of sedimentary rock samples; The image layering processing unit is used to first remove illumination interference by local non-mean filtering, preserving the texture and true color difference of the rock sample; then separate the image channels, extract features and optimize them to obtain multi-dimensional feature data that can reflect the differences of the rock sample; next, k-means clustering is used to divide the image rows, and after determining the original layer boundaries, false layers are removed; finally, edge detection, curve drawing and smoothing adjustment are used to complete the visualization layering of the bedding lines. The coordinate reset positioning unit is used to first select the puncture point on the image to obtain the pixel coordinates and prepare the actual physical control point coordinates through the coordinate reset function. Then, the puncture point and the corresponding physical control point coordinates are paired one by one. Next, a two-dimensional affine transformation model is constructed and solved to finally obtain the transformation relationship between the pixel coordinates and the actual coordinates, realizing the inverse calculation of coordinate transformation of any point, which is used for the positioning and framing of the indentation measurement area. The microscopic calibration and integration unit is used to correlate the color distribution of microscopic and macroscopic images. First, it converts different types of microscopic test area photos into 8-bit bit depth images and performs corresponding adaptation based on image type. Then, it performs foreground and background segmentation, and separates adhering particles by combining Euclidean distance transformation and watershed method. Then, it trims qualified particles through filtering. Finally, it imports relevant physical property parameters into the data integration module to obtain a visualized image of the comprehensive properties of the sample.
[0039] Example 3 This embodiment 3 also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement any step of a layering pretreatment method for nanoindentation experiments on sedimentary rock samples.
[0040] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0041] For a description of the computer-readable storage medium provided in this application, please refer to the above method embodiments; further details will not be repeated here.
[0042] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for layered pretreatment of sedimentary rock samples for nanoindentation testing, characterized in that, include: S1. Complete the preparation of sedimentary rock samples; S2. First, remove lighting interference through local non-mean value filtering to preserve the texture and true color difference of the rock sample; The image channels are then separated, features are extracted and optimized to obtain multidimensional feature data that can reflect the differences in rock samples; then, k-means clustering is used to divide the image rows, and after determining the original layer boundaries, false layers are removed; finally, edge detection, curve drawing and smoothing adjustment are used to complete the visualization of the bedding lines. S3. Using the coordinate reset function, first select the puncture point on the image to obtain the pixel coordinates, and prepare the actual physical control point coordinates. Then, pair the puncture point with the corresponding physical control point coordinates one by one. Next, construct and solve the two-dimensional affine transformation model, and finally obtain the transformation relationship between pixel coordinates and actual coordinates. Realize the inverse calculation of coordinate transformation of any point, which is used for the location and framing of the indentation measurement area. S4. To correlate the color distribution of microscopic and macroscopic images, firstly, convert different types of microscopic test area photos into 8-bit depth images and perform corresponding adaptation based on image type; then, perform foreground and background segmentation, and combine Euclidean distance transformation and watershed method to separate adhering particles, and then trim qualified particles through filtering; finally, import relevant physical property parameters into the data integration module to obtain a visualized comprehensive property image of the sample.
2. The method for layered pretreatment of sedimentary rock samples for nanoindentation testing according to claim 1, characterized in that, The specific process for preparing and pretreating the sedimentary rock sample in S1 is as follows: During sampling, the sample is cut along the bedding direction and the surface is polished. The surface flatness of the polished sample must meet the requirements of the nano-indentation platform. After the non-test surface of the sample is evenly coated with glue, it is bonded to a metal carrier with calibration control points. Then, the orthogonal image is captured by the imaging equipment on a flat table or test bench.
3. The method for layered pretreatment of sedimentary rock samples for nanoindentation testing according to claim 1, characterized in that, The specific method for local non-mean filtering in S2 is as follows: Local non-mean filtering is used to remove slowly varying illumination fields from the image before channel separation and subsequent layering, retaining only local textures and true color differences. This makes the features more stable and closer to the rock sample color, by filtering out the slowly varying illumination fields from the original image. Split into slowly changing backgrounds And the texture and color difference of real rock samples as follows: , Using a large-scale blur kernel for smoothing, the transformation from M to B is as follows: , in, Indicates a partial background; This represents the local averaging filter operator; Indicates the filter kernel size; Use background subtraction mode to remove large areas of uneven brightness; preserve relative contrast and crop to [0, 255] to obtain the result. The conversion relationship is as follows: , in, This represents the enhanced image after background removal.
4. The method for layered pretreatment of sedimentary rock samples for nanoindentation testing according to claim 1, characterized in that, The specific process for obtaining the multidimensional feature data in S2 is as follows: Spectral features actually correspond to physical properties; RGB features of an image can capture chemical or mineral differences, while grayscale can record grain size and porosity. Separating the RGB and grayscale channels of an image, let's say the original image is... The row mean is defined as: , in, This represents the average color brightness of the y-th row; Indicates the image width; This represents the value of a specific channel among the three color channels of RGB; These represent the pixel values of the red, green, and blue channels of the image, respectively, with each value ranging from 0 to 255. Gray-scale components are defined as follows: , , in, Represents the luminance component of the Lab color space; This represents the RGB to Lab color space conversion operator; Represents the luminance component in the Lab model; This represents the average grayscale or brightness of the y-th row; Where the RGB range is [0,255] and the grayscale is [0,100], the RGB histogram and grayscale histogram of the image are derived through the in-layer values; The illuminance-reflection-noise model is established as follows: , in, Indicates the image in pixels The brightness value of color channel C, including reflectance and illuminance; This represents the reflectivity component, i.e., the true reflectivity characteristics of the rock sample surface in this channel. This represents the illuminance component, which is the intensity of light irradiated at that point. This indicates the noise term, which includes high-frequency components such as measurement errors or surface micro-reflections. If the light shines on If the direction is approximately constant, then the row mean mainly reflects the chromaticity of the sediment, and the expected value of the row mean can be obtained as follows: , in, This represents the expected value of the row mean, reflecting the overall average brightness trend of the channel; This represents the average brightness of color channel C in the y-th row; The average brightness of a row is mainly determined by reflectivity; After processing, Z-score normalization can be performed, which requires first obtaining the inter-row variance of the data. Then normalization was performed: , , in, This represents the row mean and variance of channel C; Indicates the image height; Z-score represents the normalized value of the y-th row on channel C, i.e., the row brightness after normalization. This indicates that the mean of all rows in channel C is the mean of the Z-score; This represents the normalized weight of each channel, used to fuse multi-channel features and characterize the importance or volatility of a channel. This represents the standardized channel weights. The normalized variance is the variance of the variance. The result after normalization or weighted correction; The amplitude limit is set as follows: , , , in, Indicates the weighting coefficient; Indicates the lower limit of the weight; Indicates the upper limit of the weight; The weighted features for each dimension are as follows: , in, The fused layered feature row vector, i.e., the weighted composite layered response value, is used to determine the layer boundary location. Represents the weight vector; This represents the channel feature vector in the y-th row, which is the normalized response intensity of each channel of R / G / B / L in the y-th row; These represent the weights corresponding to the R, G, B, and L channels, respectively.
5. The method for layered pretreatment of sedimentary rock samples for nanoindentation testing according to claim 1, characterized in that, The specific process of removing pseudo-layers after determining the original layer boundaries in S2 is as follows: After clustering, the labels In roll-up vertical browsing, a step signal is presented, and the change in adjacent row labels indicates the layer boundary: , in, This represents the initially detected set of boundary indices; Indicates the layer label number of the current row; Indicates the layer label number of the previous row; Considering that vertically close pixels actually constitute one layer, the vertical pixel distance between two layers is made smaller than... Determined to be one layer; passed To remove some of the pseudo-layers caused by blemishes and scratches: , in, This represents the set of valid layer boundaries after filtering, which is the actual layer boundary position retained after minimum spacing filtering. The location of the i-th layer boundary is used to calculate the spacing between adjacent layers; This represents the minimum effective interlayer spacing, controlling the minimum spacing between layer boundaries and eliminating false layers caused by noise. After the algorithm completes the layer preprocessing, the layer lines also need to be visualized and drawn.
6. The method for layered pretreatment of sedimentary rock samples for nanoindentation testing according to claim 1, characterized in that, The two-dimensional affine transformation model in S3 requires at least three pairs of coordinate points to determine the model. When there are more than three pairs of coordinate points, the least squares method is used for fitting to improve stability.
7. The method for layered pretreatment of sedimentary rock samples for nanoindentation testing according to claim 1, characterized in that, The specific process of completing the corresponding adaptation based on image type in S4 is as follows: The following adaptations are performed for several types of images: For RGB color, first convert to grayscale → then quantize: , in, This represents the standard image pixel value after grayscale conversion and quantization, ranging from [0, 255]. These represent the pixel values for the red, green, and blue channels, respectively. For 16-bit integers, the full dynamic range is stretched using ScaleWhenConverting: , in, This represents the pixel value (0–65535) in the original 16-bit image. Represents the minimum pixel value of the image; Indicates the maximum pixel value of the image; For 32-bit floating point: , in, This represents the pixel values of the original 32-bit floating-point image.
8. The method for layered pretreatment of sedimentary rock samples for nanoindentation testing according to claim 1, characterized in that, The specific process of obtaining qualified particles through filtration and trimming in S4 is as follows: Area filtering: Retain ; Roundness Filtering: Retain ; Boundary exclusion: If There exist pixels that satisfy ; Indicates the image width; Indicates the image height; in, The minimum threshold representing the particle area; This represents the actual area of the k-th particle; The maximum threshold representing the particle area; The minimum threshold representing roundness or shape factor; This represents the actual roundness value of the k-th particle; The maximum threshold representing roundness; This represents the set of pixels corresponding to the k-th region; All the above conditions are judged within the same loop, and if they are not qualified, they are skipped directly to avoid unnecessary calculations; at the same time, in the visualization process, the unqualified areas are quickly identified simply by overlaying a red layer.
9. A layered pretreatment system for nanoindentation testing of sedimentary rock samples, characterized in that, include: Sedimentary rock sample preparation unit, used to complete the preparation of sedimentary rock samples; The image layering processing unit is used to first remove illumination interference through local non-mean value filtering, while preserving the texture and true color difference of the rock sample; The image channels are then separated, features are extracted and optimized to obtain multidimensional feature data that can reflect the differences in rock samples; then, k-means clustering is used to divide the image rows, and after determining the original layer boundaries, false layers are removed; finally, edge detection, curve drawing and smoothing adjustment are used to complete the visualization of the bedding lines. The coordinate reset positioning unit is used to first select the puncture point on the image to obtain the pixel coordinates through the coordinate reset function, and then prepare the actual physical control point coordinates. Next, the puncture point and the corresponding physical control point coordinates are paired one by one. Then, a two-dimensional affine transformation model is constructed and solved to finally obtain the transformation relationship between the pixel coordinates and the actual coordinates, realizing the inverse calculation of coordinate transformation of any point, which is used for the positioning and framing of the indentation measurement area. The microscopic calibration and integration unit is used to correlate the color distribution of microscopic and macroscopic images. First, it converts different types of microscopic test area photos into 8-bit bit depth images and performs corresponding adaptation based on image type. Then, it performs foreground and background segmentation, and separates adhering particles by combining Euclidean distance transformation and watershed method. Then, it trims qualified particles through filtering. Finally, it imports relevant physical property parameters into the data integration module to obtain a visualized image of the comprehensive properties of the sample.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed by a processor according to any one of claims 1-8, a method for layering pretreatment of sedimentary rock sample nanoindentation test.
Citation Information
Patent Citations
Rock macroscopic fracture toughness calculation method based on nanoindentation technology
CN112364514A
Model training method and extraction method for surrounding rock fracture information
CN114913423A