Machine vision-based automatic identification and calculation method for pore change of rock section under SEM (scanning electron microscope)
The automatic identification and calculation of rock cross-sectional pore changes using machine vision technology under SEM solves the problems of insufficient accuracy and low automation in pore segmentation and edge extraction. It achieves accurate, efficient, and automatic identification of rock pore changes and multi-batch data processing, and is applicable to rock samples with different lithologies and pore development levels.
Patent Information
- Application Number
- CN202511667788.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-11-14
AI Technical Summary
Existing technologies for identifying and calculating pore changes in rock cross sections under SEM suffer from insufficient accuracy in pore segmentation and edge extraction, as well as low levels of automation and integration. This results in pore structures that easily include false pores or miss small pores, affecting the accuracy of subsequent topology analysis and parameter calculation. Furthermore, they cannot achieve parallel processing and real-time analysis of multiple batches of SEM image data.
A machine vision-based approach was adopted, using scanning electron microscopy to acquire rock cross-sectional image data. The machine vision SEM porosity intelligent quantification cloud platform was used for region division, two-phase porosity threshold inversion, pore edge gradient enhancement, and topology analysis to construct a pore spatial topology network. This enabled automatic identification and calculation of pore parameters, and the results were stored and displayed on the cloud platform.
It achieves accurate and efficient automatic identification and calculation of pore changes in rock cross sections under SEM, improves the accuracy and stability of pore parameter analysis, adapts to rock samples with different lithologies and different pore development degrees, meets the needs of engineering fields for dynamic monitoring of rock pores, reduces reliance on manual operation, and improves the processing efficiency of multiple batches of image data.
Smart Images

Figure CN121505339A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of rock section pore change identification calculation, and particularly to a rock section pore change automatic identification calculation method under SEM based on machine vision. BACKGROUND
[0002] In rock mechanics, oil and gas exploration and geological engineering activities, the parameters such as the shape, quantity and connectivity of rock section pores directly affect the key mechanical properties such as the permeability and strength of the rock, and are of great significance to engineering design and resource development efficiency. At present, the scanning electron microscope (SEM) has become the core equipment for observing the micro-pore structure of the rock section due to its high-resolution imaging capability. However, the traditional pore analysis based on SEM relies on manual or semi-automatic means, which requires manual selection of image regions and adjustment of analysis parameters, and is difficult to adapt to rock samples of different lithology and different pore development degrees, and cannot realize efficient processing of large-scale SEM image data. With the increasing requirements of engineering on the accuracy and efficiency of rock pore analysis, there is an urgent need for a technical solution based on machine vision technology that can integrate threshold inversion, edge enhancement, topological analysis and other functions, and rely on a cloud platform to realize automatic identification and calculation, in order to meet the needs of dynamic monitoring and accurate quantification of rock section pore changes.
[0003] The existing technology has two significant shortcomings in the identification and calculation of rock section pore changes under SEM: first, the accuracy of pore segmentation and edge extraction is insufficient. Traditional techniques mostly use single threshold models or simple gradient algorithms, which cannot adaptively adjust the threshold value for the dual-phase gray scale characteristics of rock matrix and pores, and also cannot effectively enhance the contrast of weak pore edges, resulting in the segmented pore structure including false pores or missing small pores, which affects the accuracy of subsequent topological analysis and parameter calculation; second, the degree of automation and integration is low. The existing technology lacks an integrated platform that can integrate image reception, region division, model operation, result storage and display, and requires manual data transmission and operation switching between different devices or software, which not only increases the operation complexity and human error, but also cannot realize parallel processing and real-time analysis of multiple batches of SEM image data, making it difficult to meet the needs of rapid identification and calculation of rock pore changes in engineering scenarios. SUMMARY
[0004] In order to overcome the shortcomings and deficiencies of the existing technology, the present application provides a rock section pore change automatic identification calculation method under SEM based on machine vision.
[0005] The technical scheme adopted by the present application is an automatic identification and calculation method for rock section pore changes under SEM based on machine vision, comprising the following steps: S1, obtaining original image data of a rock section through a scanning electron microscope, the original image data including gray scale information and spatial distribution information of different regions of the rock section, and transmitting the original image data to a machine vision SEM pore intelligent quantification cloud platform; S2, in the machine vision SEM pore intelligent quantification cloud platform, performing regional division processing on the original image data to divide a plurality of non-overlapping image sub-regions, each image sub-region corresponding to a calibrated local region of the rock section, and recording position coordinate information of each image sub-region; S3, calling a dual-phase pore threshold inversion model to analyze the gray scale information of each image sub-region, determining an initial threshold range according to the gray scale value distribution characteristics of the pixel points in the image sub-region, adjusting the threshold parameter through iterative operation to obtain a dual-phase pore segmentation threshold corresponding to each image sub-region; S4, using a pore edge gradient enhancement algorithm to perform edge extraction on the image sub-region processed by the dual-phase pore segmentation threshold, calculating the gray scale gradient value of each pixel point and adjacent pixel points, enhancing the pixel contrast of the pore edge region according to the change law of the gray scale gradient value, and generating intermediate image data including pore edge characteristics; S5, using a dual-phase pore topology inversion model to analyze the topology structure of the intermediate image data, constructing a pore space topology network, extracting the spatial distribution coordinates of the pores, the connected path information between the pores and the morphological characteristic parameters of the pores, optimizing the pore space topology network, and eliminating false pore structure data; S6, according to the optimized pore space topology network, calculating the number of pores, the equivalent diameter of pores, the area proportion of pores and the connectivity parameters of pores in each image sub-region, integrating the calculation results of all image sub-regions to obtain the pore change identification and calculation result of the entire rock section, and storing the result in the machine vision SEM pore intelligent quantification cloud platform.
[0006] Further, the expression of the dual-phase pore threshold inversion model is: wherein is a dual-phase pore segmentation threshold, is a gray scale mean value of rock matrix region pixel points, is a gray scale standard deviation of rock matrix region pixel points, is a gray scale mean value of pore region pixel points, is a gray scale standard deviation of pore region pixel points, is a threshold adjustment coefficient, is the total number of pixel points in the image sub-region, is the coordinate of the i-th pixel point, is the coordinate of the j-th pixel point, and is the gradient value of the i-th pixel point in the gray scale gradient matrix. is the gradient value of the j-th pixel point in the gray scale gradient matrix.
[0007] Further, the expression of the pore edge gradient enhancement algorithm is:
[0008]
[0009] wherein, is the enhanced pixel gray scale gradient value, is the original pixel gray scale gradient value, is the gradient enhancement coefficient, is the gradient attenuation coefficient, is the average gray scale gradient value of all pixel points in the image sub-region, is the maximum value of the original gray scale gradient value in the image sub-region, is the minimum value of the original gray scale gradient value in the image sub-region.
[0010] Further, the expression of the dual-phase pore topology inversion model is: wherein, is the pore connectivity parameter, is the total number of connected paths between pores, is the length of the th connected path, is the equivalent diameter of the th connected path, is the total area of pores in the image sub-region, is the total area of the image sub-region, is the topology correction coefficient.
[0011] Further, the parameter calculation model expression for image sub-region division in the machine vision SEM pore intelligent quantification cloud platform is: wherein, is the number of image sub-regions, is the width of the original image data, is the height of the original image data, is the width of a single image sub-region, is the height of a single image sub-region, is the upward rounding function, is the sub-region number correction coefficient, used to adjust the sub-region number deviation caused by the insufficient single sub-region size of the image edge region.
[0012] Further, the calculation model expression of the pore equivalent diameter in the rock section pore change identification calculation result is: wherein, is the pore equivalent diameter, is the area of a single pore, is the number of pixel points on the edge of a single pore, For the first The distance from each edge pixel to the center of the aperture This is the equivalent diameter correction factor, used to compensate for calculation deviations caused by differences in image resolution.
[0013] Further, step S3 includes the following sub-steps: S31, retrieve grayscale data of each image sub-region from the database of the machine vision SEM porosity intelligent quantization cloud platform, establish a grayscale value statistical matrix, count the number of pixels corresponding to each grayscale value, and form a grayscale histogram; S32, divide the grayscale values in the grayscale histogram into multiple intervals, calculate the cumulative proportion of pixels in each interval, and determine two grayscale value concentration intervals that may correspond to the rock matrix and pores; S33, based on the grayscale mean and standard deviation of the two grayscale value concentration intervals, initialize the parameters of the two-phase pore threshold inversion model, and set the upper limit of the number of iterations and the threshold convergence accuracy; S34, perform iterative calculations on the two-phase pore threshold inversion model according to the set upper limit of the number of iterations and the threshold convergence accuracy, calculate the segmentation effect evaluation index corresponding to the current threshold after each iteration, and stop the iteration and output the two-phase pore segmentation threshold when the evaluation index meets the convergence accuracy requirements.
[0014] Further, step S4 includes the following sub-steps: S41, traversing pixels in the image sub-region after the biphasic aperture segmentation thresholding process, obtaining the grayscale values of the 8 neighboring pixels of each pixel, and calculating the grayscale difference between the pixel and its 8 neighboring pixels; S42, constructing a grayscale gradient matrix based on the grayscale difference, and using the Sobel operator to filter the grayscale gradient matrix to highlight the gradient change characteristics of the aperture edge region; S43, normalizing the gradient values in the filtered grayscale gradient matrix to ensure that the gradient values are within a preset numerical range, avoiding the impact of excessively large or small gradient values on the subsequent edge enhancement effect; S44, calling the aperture edge gradient enhancement algorithm, substituting the normalized grayscale gradient values into the algorithm expression to calculate the enhanced grayscale gradient values, adjusting the grayscale values of the corresponding pixels based on the enhanced grayscale gradient values, and generating intermediate image data including aperture edge features.
[0015] Further, the step S5 includes the following sub-steps: S51, binarizing the intermediate image data, marking the pore region as a target pixel and marking the rock matrix region as a background pixel to form a binary image; S52, using a region growing algorithm to extract the connected region of the target pixel in the binary image, determining the boundary range of each independent pore, and recording the boundary pixel coordinates of each pore; S53, inputting the boundary pixel coordinates of each pore into a dual-phase pore topology inversion model to calculate the center coordinates, equivalent radius of the pore, and Euclidean distance between pores, and constructing the initial structure of the pore space topology network; and S54, removing redundant data from the initial pore space topology network, deleting false pore structures with an area less than a preset threshold, and correcting pore boundary deviation caused by image noise to obtain an optimized pore space topology network.
[0016] The method for automatically identifying and calculating the pore change of a rock section under SEM based on machine vision is implemented by different units, including: a SEM image data receiving and analyzing unit connected with a scanning electron microscope through a data transmission interface, receiving original image data and analyzing the format, and transmitting the analyzed data to an image sub-region division unit; the image sub-region division unit receives the analyzed data, divides it according to a preset sub-region size and coordinate rule, generates multiple image sub-region data, and transmits them to a dual-phase pore threshold inversion unit and a data temporary storage unit; the dual-phase pore threshold inversion unit calls a dual-phase pore threshold inversion model in an algorithm model library to perform threshold analysis and calculation on the image sub-region data, obtains a dual-phase pore segmentation threshold, and transmits it to a pore edge gradient enhancement unit; the pore edge gradient enhancement unit receives the dual-phase pore segmentation threshold, combines the pore edge gradient enhancement algorithm stored therein, performs edge enhancement on the threshold-processed image sub-region data, generates intermediate image data, and transmits it to a dual-phase pore topology inversion unit; the dual-phase pore topology inversion unit calls a dual-phase pore topology inversion model to analyze the intermediate image data, constructs and optimizes a pore space topology network, and transmits the extracted pore feature parameters to a pore change calculation and integration unit; the pore change calculation and integration unit receives the pore feature parameters, integrates and calculates them according to a preset rule to obtain rock section pore change identification and calculation results, and transmits them to a result storage and display unit; the result storage and display unit receives the calculation results, stores them according to time stamps and rock sample numbers, and displays them in the form of charts through a visual interface for user query and call.
[0017] Beneficial effects: This invention proposes an automatic identification and calculation method for changes in rock cross-section porosity under SEM based on machine vision. This method achieves accurate and efficient automatic identification and calculation of changes in rock cross-section porosity under SEM, improving the accuracy and stability of porosity parameter analysis. At the same time, it relies on a cloud platform to realize centralized processing and result storage of multiple batches of image data, reducing reliance on manual operation, adapting to rock samples with different lithologies and different porosity development levels, and meeting the needs of engineering fields for dynamic monitoring of rock porosity. To address the issue of insufficient accuracy in pore segmentation and edge extraction, this method first divides the image into sub-regions, and then adaptively determines the segmentation threshold based on the gray-level characteristics of the sub-regions using a specialized threshold inversion model, avoiding the limitations of a single threshold. Subsequently, an edge gradient enhancement algorithm is used to strengthen the contrast of pore edges, reducing the omission of false and small pores and providing a reliable foundation for topology analysis. To address the issue of low automation and integration, this method relies on a machine vision SEM pore intelligent quantization cloud platform, integrating the entire process of image reception and analysis, sub-region segmentation, threshold inversion, edge enhancement, topology analysis, result calculation, integration, storage, and display. It eliminates the need for manual switching between different devices or software, automating data transmission and processing. At the same time, it supports parallel computation of multiple sub-regions, improving the processing efficiency of multiple batches of image data, effectively reducing human error, and meeting the needs of rapid recognition calculation. Attached Figure Description
[0018] Figure 1 This is a flowchart of the method steps of the present invention;
[0019] Figure 2 This is a diagram showing the unit composition for implementing the method of the present invention. Detailed Implementation
[0020] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0021] like Figure 1 As shown, the automatic identification and calculation method for rock cross-sectional porosity variations based on machine vision under SEM includes the following steps:
[0022] S1. Obtain raw image data of rock cross-section using a scanning electron microscope. The raw image data includes grayscale information and spatial distribution information of different regions of the rock cross-section. Transmit the raw image data to the machine vision SEM porosity intelligent quantification cloud platform.
[0023] Specifically, step S1 acquires rock section original image data and completes data transmission. In implementation, first, fix the rock sample on the sample stage of the scanning electron microscope, adjust the acceleration voltage of the microscope to 10-15 kV, the magnification to 500-2000 times, and ensure that the imaging resolution reaches 1-5 nm to clearly capture the micro-pore structure of the rock section; after starting the microscope, control the sample stage to move at a step length of 0.1-0.5 mm to scan the entire rock section, and generate original image data with a size of 2048x2048 pixels or 4096x4096 pixels. The image data format uses TIFF or BMP format, and the gray scale information is completely retained (gray scale is 8 bits or 16 bits, corresponding to 256 or 65536 gray levels); after scanning, transmit the original image data to the machine vision SEM pore intelligent quantification cloud platform through a gigabit Ethernet interface or a USB3.0 interface, and the transmission rate is not less than 100 Mbps, ensuring that the data is transmitted within 5-10 seconds for a single image to avoid data loss or damage. This step lays the data foundation for the entire recognition and calculation process. The acceleration voltage of 10-15 kV can ensure imaging clarity and reduce damage to the sample by the electron beam. The magnification of 500-2000 times is suitable for different pore size samples (1-10 μm pores use 500-1000 times, and 0.1-1 μm pores use 1000-2000 times). The image size of 2048x2048 pixels or above includes sufficient area information, and the 8-bit or 16-bit gray scale accurately reflects the gray scale difference between the matrix and the pores (matrix 150-255 or 30000-65536, and pores 0-50 or 0-10000). The high-speed interface meets the data transmission requirements of large size, ensures uninterrupted transmission when multiple images are continuously scanned, and improves the overall analysis efficiency.
[0024] S2, in the machine vision SEM pore intelligent quantification cloud platform, the original image data is subjected to region division processing, and a plurality of non-overlapping image sub-regions are divided, each image sub-region corresponding to a calibrated local region of the rock section, and the position coordinate information of each image sub-region is recorded.
[0025] Specifically, step S2 performs image sub-region division in the machine vision SEM pore intelligent quantification cloud platform. When implemented, the original image data transmitted in S1 is first read, the width and height pixel values of the image are obtained, and the size parameters of the sub-regions are determined according to the image size (a single sub-region is 256x256 pixels, 512x512 pixels or 1024x1024 pixels, for example, a 2048x2048 pixel image can be divided into 64 256x256 pixel sub-regions, 16 512x512 pixel sub-regions or 4 1024x1024 pixel sub-regions); the division process uses a sliding window method, and the window overlap rate is set to 0-10%. When the overlap rate is 10%, the adjacent sub-regions have an overlapping area of 25.6 pixels (256x10%) or 51.2 pixels (512x10%) in the horizontal and vertical directions. After the division is completed, a unique identification number is assigned to each sub-region, and the upper left corner and lower right corner coordinates (in pixels, with an accuracy of up to an integer) of each sub-region in the original image are recorded. This step improves the analysis accuracy and efficiency through regional processing. The sub-region size of 256x256 to 1024x1024 pixels can ensure sufficient pore information and reduce the amount of processing per region, so that the subsequent operation can complete the processing of a single sub-region within 1-3 seconds. The overlap rate of 0-10% solves the problem of insufficient analysis of edge pixels (a 10% overlap rate is used for small-size sub-regions to ensure that small pores are covered, and a 0% overlap rate is used for large-size sub-regions to avoid repeated calculation). Recording the coordinates of the sub-regions can accurately map the pore parameters to the corresponding positions in the original image when integrating the results, forming a complete pore distribution map and providing a precise spatial reference for engineering analysis.
[0026] S3, calling a two-phase pore threshold inversion model to analyze the gray scale information of each image sub-region, determining an initial threshold range according to the gray scale value distribution characteristics of the pixel points in the image sub-region, adjusting the threshold parameters through iterative operation, and obtaining the two-phase pore segmentation threshold corresponding to each image sub-region;
[0027] Specifically, step S3 calls the two-phase pore threshold inversion model to process each image sub-region. When implemented, the gray data of each sub-region is first called from the cloud platform database, the gray value distribution of all pixel points is counted, the maximum value, minimum value, mean value and standard deviation of the gray value are calculated, and the initial threshold range (usually 1 / 3 to 2 / 3 interval between the minimum and maximum gray values) is determined. The model operation adopts an iterative optimization method, and the number of iterations is set to 20-50 times. In each iteration, the pixels are divided into foreground (pore) and background (rock matrix) according to the current threshold, the threshold is adjusted after calculating the gray mean and variance of the two types of pixels, and the adjustment step is initially 5-10 gray levels, which gradually decreases to 1-2 gray levels as the number of iterations increases. When the threshold difference of two consecutive iterations is less than 2 gray levels or the maximum number of iterations reaches 50 times, the iteration is stopped and the two-phase pore segmentation threshold is output, and evaluation indexes such as inter-class variance and mean absolute error are calculated. When the inter-class variance is greater than 1000 or the mean absolute error is less than 50, the threshold is determined to be valid, otherwise the iteration is restarted. This step provides an adaptive threshold for pore and matrix segmentation, solves the limitations of traditional single threshold, and the statistical gray parameters can quickly determine the initial threshold range, avoiding the iteration from falling into a local optimal solution. The 20-50 iterations balance accuracy and efficiency (20-30 iterations for gray uniform sub-regions to converge, and 40-50 iterations for complex sub-regions to ensure accuracy); 5-10 initial steps quickly approach the optimal threshold, and 1-2 steps in the later stage accurately optimize, ensuring that the threshold error is less than 2 gray levels; the evaluation index selects the effective threshold, avoiding noise-induced false segmentation, and providing accurate pixel classification results for subsequent edge extraction.
[0028] S4, a pore edge gradient enhancement algorithm is used to extract the edges of the image sub-regions processed by the two-phase pore segmentation threshold, the gray gradient values of each pixel point and adjacent pixel points are calculated, the pixel contrast of the pore edge region is enhanced according to the change rule of the gray gradient values, and intermediate image data including pore edge features are generated;
[0029] Specifically, step S4 processes the sub-regions after threshold segmentation using a pore edge gradient enhancement algorithm. In implementation, first, neighborhood analysis is performed on each pixel point, a 3x3 or 5x5 pixel neighborhood window is selected, the gray difference between the current pixel point and 8 or 24 pixel points in the neighborhood is calculated, and an initial gray gradient value (0-255 or 0-65535, corresponding to 8-bit or 16-bit gray images) is obtained. Then, the initial gradient value is normalized and mapped to the value interval of 0-1. Next, a gradient enhancement coefficient of 1.2-1.8 is set according to the gradient value distribution characteristics, the gradient of pixel points with a gradient value greater than 0.3 (high gradient region) is amplified (amplification factor is 1.5-2 times the coefficient), the gradient of pixel points with a gradient value less than 0.1 (low gradient region) is suppressed (suppression factor is 0.5-0.8 times), and the gradient value of pixel points between 0.1 and 0.3 is kept unchanged. Finally, the enhanced gradient value is mapped back to the original gray range, the corresponding pixel point gray value is adjusted, and intermediate image data including clear pore edge features are generated, which are consistent with the original sub-regions. This step highlights the gray difference between the pore edge and the matrix, solves the problem of blurred edges and easy confusion with noise in traditional edge extraction, and selects a 3x3 or 5x5 window according to the pore size (greater than 5μm uses a 5x5 window, less than 5μm uses a 3x3 window); 0-1 interval normalization unifies the calculation standard, avoiding the influence of different sub-regional gray range differences; the enhancement coefficient of 1.2-1.8 and the regional adjustment strategy make the high gradient region gray difference increase from 50-100 to 75-200, the low gradient region decrease from 10-30 to 5-24, and the transition region remains unchanged, highlighting the edge without amplifying the noise, making the intermediate image pore edge gray contrast increase by 30%-50%, and significantly improving the subsequent boundary recognition accuracy.
[0030] S5, using a two-phase pore topology inversion model to analyze the topology structure of the intermediate image data, constructing a pore space topology network, extracting the spatial distribution coordinates of the pores, the connected path information between the pores, and the morphological feature parameters of the pores, and optimizing the pore space topology network to eliminate false pore structure data;
[0031] Specifically, step S5 uses a dual-phase pore topology inversion model to analyze intermediate image data. During implementation, the intermediate image is first binarized. Based on the segmentation threshold in S3, pixels with grayscale values below the threshold are marked as pore pixels (assigned a value of 1), and those above the threshold are marked as matrix pixels (assigned a value of 0), forming a binary image. Then, a connected component analysis algorithm is used to traverse the pore pixels, identifying independent pore regions using either 8-connectivity or 4-connectivity rules (8-connectivity includes diagonal neighbors, 4-connectivity only includes top, bottom, left, and right neighbors). The number of pixels, boundary pixel coordinates, and center pixel coordinates (center coordinates are the coordinates of pixels within the region) are recorded for each region. (The average value is calculated, with precision retained to one decimal place). Next, a pore space topology network is constructed. Using the pore center coordinates as nodes, the Euclidean distance between nodes is calculated (in pixels, with precision retained to one decimal place). When the distance is less than a preset threshold of 50-100 pixels, a connected path is determined and a connection is established. At the same time, the equivalent radius is calculated (with precision 0.1-0.5nm) by converting the number of pore pixels and the image resolution (1-5nm / pixel). Finally, the topology network is optimized by deleting pore regions with less than 20 pixels (determined as false pores) and correcting the boundary coordinates caused by edge enhancement deviation, resulting in the optimized topology network. This step constructs a pore space structure model, extracts key topological parameters, and addresses the problem of neglecting spatial connectivity in traditional analysis. Binarization processing based on the S3 threshold ensures consistent classification. The choice between 8-connectivity or 4-connectivity rules is based on the pore morphology (8-connectivity for irregular pores and 4-connectivity for regular pores). The 50-100 pixel distance threshold is set according to the resolution and pore density (50 pixels for 2nm / pixel and high density, and 100 pixels for 5nm / pixel and low density). Small pixel regions are deleted to eliminate false pores caused by electronic noise or impurities (usually less than 10 pixels). The equivalent radius accuracy of 0.1-0.5nm meets the high-precision quantization requirements of engineering, providing structured data support for subsequent pore change calculations.
[0032] S6. Based on the optimized pore space topology network, calculate the number of pores, the equivalent diameter of pores, the area ratio of pores, and the connectivity parameters of pores in each image sub-region. Integrate the calculation results of all image sub-regions to obtain the pore change recognition calculation result of the entire rock cross section, and store the result in the machine vision SEM pore intelligent quantification cloud platform.
[0033] Specifically, step S6 completes the pore change identification calculation and result integration based on the optimized pore space topology network. During implementation, the pore parameters of each sub-region are first calculated. The number of pores is the total number of nodes in the topology network (accuracy 1). The equivalent diameter is the equivalent radius multiplied by 2 (accuracy 0.2-1nm). The area ratio is the ratio of the total number of pore pixels to the total number of pixels in the sub-region (retaining 4 decimal places, accuracy 0.01%). The connectivity parameter is the ratio of the total number of connected paths to the total number of nodes (retaining 3 decimal places). When the number of pores is 0, the parameter is directly recorded as 0; when it is greater than 100 (high pore density region), the sub-region is... The region is divided into four smaller sub-blocks, and the average value is calculated for each. Then, based on the sub-region coordinates recorded by S2, the parameters are mapped to the corresponding positions in the original image to generate a pore parameter distribution matrix (with the same dimensions as the original image). Finally, a 3×3 matrix smoothing window is used to smooth the distribution matrix, and the average value of the elements within the window is used as the final value of the central element to eliminate abrupt changes in the sub-region boundary parameters. The pore change identification calculation results of the entire rock cross section are obtained and stored in the cloud platform database in XML or JSON format. The stored data includes the result matrix, calculation timestamp (accurate to the second), and rock sample number. This step enables full-domain quantification and precise storage of pore parameters, solving the problems of fragmented and difficult-to-integrate traditional analytical parameters. The 0.2-1nm diameter accuracy is suitable for calculating permeability in oil and gas exploration, and the 0.01% area ratio accuracy reflects subtle differences in pore development. Three-decimal-digit connectivity parameters distinguish connectivity efficiency. Block calculation reduces errors in high-porosity areas (from ±5% to ±2%). 3×3 window smoothing eliminates boundary effects (e.g., adjacent area ratios of 5.20% and 5.80% are smoothed to 5.50%). XML or JSON format facilitates subsequent calls, and timestamps and sample numbers enable multi-batch data classification and management, providing data traceability capabilities for long-term monitoring.
[0034] Preferably, the expression for the two-phase porosity threshold inversion model is: ,in The threshold for two-phase pore segmentation. This represents the average grayscale value of the pixels in the rock matrix region. The grayscale standard deviation of the pixels in the rock matrix region. This represents the average grayscale value of the pixels in the pore region. The grayscale standard deviation of the pixels in the pore region. This is the threshold adjustment coefficient. This represents the total number of pixels within a sub-region of the image. For the first The coordinates of each pixel For the first The gradient value of each pixel in the grayscale gradient matrix.
[0035] Specifically, when implementing the dual-phase porosity threshold inversion model, pixel grayscale data of the rock matrix and pore regions are first extracted from the image sub-regions. The average pixel grayscale value of the matrix region is typically 150-255 (8-bit grayscale image) or 30000-65536 (16-bit grayscale image), with a standard deviation controlled between 20-50. The average pixel grayscale value of the pore region is typically 0-50 (8-bit) or 0-10000 (16-bit), with a standard deviation controlled between 10-30. The threshold adjustment coefficient is set to 0.8-1.2, specifically adjusted according to the uniformity of grayscale distribution in the sub-region; the more uniform the grayscale distribution, the closer the coefficient is to 1.0. The total number of pixels in the image sub-region is determined by the size of the sub-region. For example, a 256×256 pixel sub-region corresponds to 65536 pixels, and a 4096×4096 pixel sub-region corresponds to 16,777,216 pixels. The gradient value of each pixel in the gray-level gradient matrix is calculated, ranging from 0 to 255, and then the dual-phase pore segmentation threshold is obtained through model calculation. This model integrates the gray-level statistical features, gradient information, and adjustment coefficients of the matrix and pores to achieve adaptive threshold calculation, solving the problem that traditional single thresholds cannot adapt to the gray-level differences of different sub-regions. This improves the segmentation threshold accuracy to ±2 gray levels, ensuring accurate differentiation between the matrix and pores, providing a reliable basis for subsequent edge extraction, and is suitable for the analysis of rock samples with different lithologies and different pore development levels.
[0036] Preferably, the expression for the pore edge gradient enhancement algorithm is:
[0037]
[0038] in, The enhanced pixel grayscale gradient value. This represents the original pixel grayscale gradient value. For gradient enhancement coefficients, The gradient decay coefficient is... This represents the average grayscale gradient of all pixels within a sub-region of the image. This represents the maximum value of the original gray-level gradient within a sub-region of the image. It represents the minimum value of the original gray-level gradient within a sub-region of the image.
[0039] Specifically, the gradient enhancement algorithm for pore edges first calculates the original grayscale gradient value of each pixel within a sub-region of the image. This value is determined based on the grayscale difference between the pixel and its neighboring pixels, typically ranging from 0-255 (8-bit image) or 0-65535 (16-bit image). Simultaneously, the average grayscale gradient of the entire sub-region is calculated, generally between 50-150. The gradient enhancement coefficient is set to 1.2-1.8, and the gradient decay coefficient is set to 0.5-1.0. The coefficients are adjusted according to the sharpness of the pore edges; the more blurred the edges, the larger the enhancement coefficient and the smaller the decay coefficient. The maximum value of the original grayscale gradient within the sub-region is typically between 200-255, and the minimum value is between 0-20. The enhanced grayscale gradient value is calculated using the model. During implementation, the original gradient values are first processed, combining the mean, maximum, minimum values, and coefficients to amplify the gradient value in high-gradient regions (pore edges) and suppress the gradient value in low-gradient regions (within the matrix), while maintaining stability in transition regions. This algorithm improves the grayscale gradient value of the pore edge by 30%-50% by precisely adjusting the pixel contrast in different gradient regions. It effectively solves the problems of blurred edges and easy confusion with noise in traditional gradient algorithms, ensuring that subsequent topology analysis can accurately identify pore boundaries, improve the accuracy of pore morphology parameter calculation, and adapt to SEM image data of different resolutions.
[0040] Preferably, the expression for the two-phase pore topology inversion model is: ,in For pore connectivity parameters, This represents the total number of connected paths between pores. For the first The length of the connected path, For the first The equivalent diameter of a connected path. The total area of pores within the image sub-region. The total area of the image sub-region. This is the topology correction coefficient.
[0041] Specifically, when implementing the two-phase pore topology inversion model, the total number of connected paths between pores within a sub-region of the image is first counted. This number is determined based on the pore density. In low-pore-density regions (10-50 pores), the number of connected paths is typically 5-20, while in high-pore-density regions (50-200 pores), it is typically 30-100. The length of each connected path is calculated based on the center-to-center distance between pores, ranging from 10-200 pixels. The equivalent diameter is calculated based on the pixel width of the path, ranging from 2-20 pixels. The total area of pores within a sub-region is calculated by combining the total number of pore pixels with the area of a single pixel (determined by the SEM image resolution, e.g., 1nm / pixel corresponds to 1nm² / pixel). The total area of the sub-region is the actual area corresponding to the sub-region size (e.g., 256×256 pixels, 1nm / pixel corresponds to 65536nm²). The topology correction coefficient is set to 0.9-1.1, adjusted according to the integrity of the connected paths; the more complete the paths, the closer the coefficient is to 1.0. The pore connectivity parameters are calculated using a model, typically ranging from 0.1 to 0.9. This model integrates the length and diameter of the connectivity path and the proportion of pore area to quantify pore connectivity efficiency. It addresses the problem of traditional analysis focusing only on the number of pores while ignoring connectivity, keeping the calculation error of connectivity parameters within ±5%. This provides crucial data for assessing rock permeability and is applicable to scenarios such as oil and gas exploration and geological engineering.
[0042] Preferably, the parameter calculation model expression for image sub-region segmentation in the machine vision SEM porosity intelligent quantization cloud platform is as follows: ,in The number of image sub-regions. The width of the original image data. The height of the original image data. The width of a single image sub-region The height of a single image sub-region. It is a rounding function. This is a sub-region number correction coefficient, used to adjust the deviation in the number of sub-regions caused by the image edge region being insufficient to meet the size of a single sub-region.
[0043] Specifically, the image sub-region segmentation parameter calculation of the machine vision SEM porosity intelligent quantization cloud platform involves first obtaining the width and height of the original image data, typically 2048 pixels, 4096 pixels, or 8192 pixels. The width and height of a single image sub-region are then set to 256 pixels, 512 pixels, or 1024 pixels, adjusted according to the original image size to ensure the number of sub-regions is an integer. A sub-region number correction coefficient is set to 1.0-1.2. When the original image size cannot be divided evenly by the sub-region size, the coefficient is greater than 1.0 to compensate for edges that are smaller than the size of a single sub-region. For example, if the original image is 4000×4000 pixels and the sub-region is 512×512 pixels, the correction coefficient is set to 1.05, adjusting the number of sub-regions from 62 (4000 / 512≈7.81, 7×7=49, corrected to 52) to fit the edge region. The number of sub-regions is calculated through the model, typically ranging from 16, 64, 256, or 1024. This model ensures that the entire original image is covered by accurately calculating the number of sub-regions, avoiding the loss of edge region information. It solves the problem of inconsistent sub-region sizes caused by traditional fixed-number division, controls the sub-region division error to ±1, improves the consistency of subsequent threshold inversion, edge enhancement and other steps, ensures the stability of the entire analysis process, and is adaptable to SEM image data of different sizes.
[0044] Preferably, the calculation model expression for the equivalent diameter of pores in the rock fracture pore change identification calculation result is as follows: ,in The equivalent diameter of the pores. The area of a single pore. This refers to the number of pixels on the edge of a single aperture. For the first The distance from each edge pixel to the center of the aperture This is the equivalent diameter correction factor, used to compensate for calculation deviations caused by differences in image resolution.
[0045] Specifically, the calculation of the equivalent diameter of rock fracture pores involves first calculating the area of a single pore. This area is determined by the region enclosed by the pixels at the pore's edge, typically ranging from 100 nm² to 100,000 nm², adjusted according to the pore size. The number of pixels on the edge of a single pore depends on the pore size: 20-50 pixels for small pores (100-1000 nm²), 50-200 for medium pores (1000-10000 nm²), and 200-1000 for large pores (10000-100000 nm²). The distance from each edge pixel to the pore center is calculated using coordinates, ranging from 5-500 nm, with the average of all distances used as a reference. The equivalent diameter correction factor is set to 0.95-1.05, adjusted according to the pore shape. The coefficient for circular pores is close to 1.0, while the coefficient for irregular pores is adjusted based on shape deviation; the greater the deviation, the more the coefficient deviates from 1.0. The equivalent pore diameter is calculated using a model, typically ranging from 10nm to 500nm. This model integrates pore area, edge pixel distribution, and shape correction coefficients to accurately quantify pore size, solving the problem of traditional methods that only convert diameter by area while ignoring the influence of shape. This keeps the calculation error of the equivalent diameter within ±3%, providing key parameters for evaluating the flow capacity and mechanical properties of rock pores. It is suitable for scenarios such as rock mechanics experiments and engineering material screening.
[0046] Preferably, step S3 includes the following sub-steps: S31, retrieve grayscale data of each image sub-region from the database of the machine vision SEM porosity intelligent quantization cloud platform, establish a grayscale value statistical matrix, count the number of pixels corresponding to each grayscale value, and form a grayscale histogram; S32, divide the grayscale values in the grayscale histogram into multiple intervals, calculate the cumulative proportion of pixels in each interval, and determine two grayscale value concentration intervals that may correspond to the rock matrix and pores; S33, based on the grayscale mean and standard deviation of the two grayscale value concentration intervals, initialize the parameters of the two-phase pore threshold inversion model, and set the upper limit of the number of iterations and the threshold convergence accuracy; S34, perform iterative calculations on the two-phase pore threshold inversion model according to the set upper limit of the number of iterations and the threshold convergence accuracy, calculate the segmentation effect evaluation index corresponding to the current threshold after each iteration, and stop the iteration and output the two-phase pore segmentation threshold when the evaluation index meets the convergence accuracy requirements.
[0047] Specifically, step S3 includes sub-steps S31 to S34: S31 retrieves grayscale data of each image sub-region from the machine vision SEM aperture intelligent quantization cloud platform database, establishes a grayscale value statistical matrix, counts the number of pixels corresponding to each grayscale value to form a grayscale histogram, and the pixel counting precision is 1 during the statistics. The grayscale value interval is divided according to the image grayscale level (8-bit image is divided into 256 intervals from 0 to 255, and 16-bit image is divided into 65536 intervals from 0 to 65535); S32 divides the grayscale values of the grayscale histogram into 10-20 intervals, and calculates the grayscale values within each interval. The cumulative percentage of pixels (retaining 4 decimal places) determines two grayscale value concentration intervals corresponding to the rock matrix and pores, with the pixel percentage within each interval exceeding 30%. S33 initializes the dual-phase pore threshold inversion model parameters based on the grayscale mean and standard deviation of the two concentration intervals, setting an upper limit of 20-50 iterations and a threshold convergence accuracy of ±2 grayscale levels. S34 iterates according to the set parameters, calculating segmentation performance evaluation indicators after each iteration (inter-class variance must be greater than 1000, mean absolute error must be less than 50). If the convergence accuracy is met, iteration stops and the dual-phase pore segmentation threshold is output. This refinement process ensures the accuracy of threshold calculation by controlling grayscale data processing, interval division, parameter initialization, and iteration convergence criteria step by step. It solves the problem of parameter ambiguity in traditional threshold determination, making the segmentation threshold adaptable to the grayscale characteristics of different sub-regions, providing a reliable basis for subsequent pore segmentation, and improving overall recognition accuracy.
[0048] Preferably, step S4 includes the following sub-steps: S41, traversing pixels in the image sub-region after the biphasic aperture segmentation thresholding process, obtaining the grayscale values of the 8 neighboring pixels of each pixel, and calculating the grayscale difference between the pixel and its 8 neighboring pixels; S42, constructing a grayscale gradient matrix based on the grayscale difference, and using the Sobel operator to filter the grayscale gradient matrix to highlight the gradient change characteristics of the aperture edge region; S43, normalizing the gradient values in the filtered grayscale gradient matrix to ensure that the gradient values are within a preset numerical range, avoiding the impact of excessively large or small gradient values on the subsequent edge enhancement effect; S44, calling the aperture edge gradient enhancement algorithm, substituting the normalized grayscale gradient values into the algorithm expression to calculate the enhanced grayscale gradient values, adjusting the grayscale values of the corresponding pixels based on the enhanced grayscale gradient values, and generating intermediate image data including aperture edge features.
[0049] Specifically, step S4 includes sub-steps S41 to S44: S41 performs pixel traversal on the image sub-regions after the dual-phase aperture segmentation thresholding process, obtains the grayscale values of the 8 neighboring pixels of each pixel, and calculates the grayscale difference (range 0-255, 8-bit image), with the traversal speed controlled to be completed within 1-3 seconds for each sub-region; S42 constructs a grayscale gradient matrix based on the grayscale difference, and uses the Sobel operator for filtering, with a filter template size of 3×3. After filtering, the value range of the gradient matrix is compressed to 0-200, highlighting the gradient change characteristics at the aperture edges. S43 normalizes the filtered grayscale gradient values to a range of 0-1, retaining three decimal places to prevent excessively large or small gradient values from affecting subsequent processing. S44 calls the pore edge gradient enhancement algorithm, substituting the normalized gradient values into the calculation to obtain the enhanced grayscale gradient values (enhanced range 0-255). Based on the enhanced gradient values, the grayscale values of corresponding pixels are adjusted to generate intermediate image data including pore edge features. The resolution of the intermediate image remains consistent with the original sub-region (e.g., 256×256 pixels, 512×512 pixels). This refinement process, through step-by-step grayscale difference calculation, filtering, normalization, and gradient enhancement, accurately enhances pore edge details, solving the problem of blurred edges in traditional edge extraction and providing clear pore boundary data for subsequent topology analysis.
[0050] Preferably, step S5 includes the following sub-steps: S51, binarize the intermediate image data, mark the pore region as the target pixel, and mark the rock matrix region as the background pixel to form a binarized image; S52, use a region growing algorithm to extract connected regions from the target pixels in the binarized image, determine the boundary range of each independent pore, and record the boundary pixel coordinates of each pore; S53, input the boundary pixel coordinates of each pore into the two-phase pore topology inversion model, calculate the center coordinates, equivalent radius, and Euclidean distance between pores, and construct the initial structure of the pore space topology network; S54, remove redundant data from the initial pore space topology network, delete false pore structures with an area smaller than a preset threshold, correct the pore boundary deviation caused by image noise, and obtain the optimized pore space topology network.
[0051] Specifically, step S5 includes sub-steps S51 to S54: S51 performs binarization processing on the intermediate image data, marking the pore region as the target pixel (assigned a value of 1) and the rock matrix region as the background pixel (assigned a value of 0) to form a binarized image. The grayscale judgment error during binarization processing must be less than one grayscale level; S52 uses a region growing algorithm to extract the connected regions of the target pixels in the binarized image. The seed point for growth is selected from pixels with a grayscale value of 1 and whose proportion of target pixels in the neighborhood pixels exceeds 50%. The boundary range of each independent pore is determined, and the coordinates of the boundary pixels are recorded. (Precision retained to integer places); S53 inputs the boundary pixel coordinates into the two-phase pore topology inversion model to calculate the pore center coordinates (precision retained to one decimal place), equivalent radius (precision 0.1-0.5nm), and Euclidean distance between pores (precision retained to one decimal place), constructing the initial structure of the pore space topology network; S54 removes redundant data from the initial topology network, deletes false pore structures with an area less than 20 pixels, and corrects pore boundary deviations caused by image noise (deviation correction range ±1 pixel), obtaining the optimized pore space topology network. This refinement process completes binarization, connected region extraction, topology parameter calculation, and network optimization in steps, accurately constructing the pore space structure, solving the problems of false pore interference and large parameter errors in traditional topology analysis, and providing accurate topology data support for subsequent pore parameter calculations.
[0052] The dual-phase pore threshold inversion model is the core model in this invention used to determine the pore and matrix segmentation threshold within a sub-region of a rock cross-section image. Essentially, it integrates gray-level statistical features and gradient information to achieve an adaptive threshold calculation algorithm. The implementation of this model involves multiple steps: First, gray-level data of the rock matrix and pores are extracted from the image sub-region. The mean and standard deviation of the gray levels for both types of regions are statistically analyzed (matrix mean 150-255 or 30000-65536, standard deviation 20-50; pore mean 0-50 or 0-10000, standard deviation 10-30). Simultaneously, the gray-level gradient value of each pixel is calculated. Next, a threshold adjustment coefficient (0.8-1.2) and iteration parameters are set (20-50 iterations, convergence accuracy ±2 gray levels). The threshold is continuously adjusted through iterative optimization. After each iteration, evaluation indicators such as inter-class variance (must be greater than 1000) and mean absolute error (must be less than 50) are calculated until the convergence condition is met, at which point the final segmentation threshold is output. This model provides adaptive segmentation criteria for image sub-regions, accurately distinguishing between pore and matrix pixels, avoiding the limitations of traditional single thresholds. It solves the threshold adaptation problem for samples with different lithologies and pore development levels, improving segmentation accuracy to ±2 gray levels. This provides a reliable pixel classification foundation for subsequent edge extraction and topology analysis, ensuring the accuracy of the entire pore identification calculation process.
[0053] The pore edge gradient enhancement algorithm is the key algorithm in this invention used to enhance the pore edge features of rock cross-section images. It aims to improve the contrast between the pore edge and the matrix by adjusting the gradient, thereby solving the edge blurring problem. The algorithm is implemented step-by-step: First, the sub-regions of the image after thresholding are traversed pixel by pixel, and the gray-level difference between each pixel and its neighboring pixels is calculated using a 3×3 or 5×5 neighborhood window to obtain the original gray-level gradient value (0-255 or 0-65535). Then, the original gradient value is normalized to the 0-1 range to eliminate the influence of gray-level range differences between different sub-regions. Subsequently, enhancement coefficients (1.2-1.8) and attenuation coefficients (0.5-1.0) are set according to the gradient distribution characteristics. Gradient amplification (1.5-2 times) is performed on high gradient regions (pore edges, gradient value > 0.3), and gradient suppression (0.5-0.8 times) is performed on low gradient regions (inside the matrix, gradient value < 0.1). The gradient in transition regions remains unchanged. Finally, the enhanced gradient value is mapped back to the original gray-level range, and the gray-level values of the corresponding pixels are adjusted to generate an intermediate image. This algorithm highlights the details of pore edges and improves edge recognition. It improves the grayscale contrast of pore edges by 30%-50%, effectively distinguishing real edges from noise interference. This provides clear edge data for accurate identification of pore boundaries and calculation of pore morphology parameters in subsequent topology analysis, avoiding calculation errors of pore parameters caused by blurred edges.
[0054] The dual-phase pore topology inversion model is the core model in this invention used to construct the spatial structure of pores in rock fracture surfaces and quantify pore connectivity. It integrates pore spatial distribution and connectivity features to form a structured pore topology network. The model's implementation involves multiple steps: first, binarizing the intermediate image based on threshold segmentation results to label pore and matrix pixels; then, extracting independent pore regions using 8-connectivity or 4-connectivity rules, recording the number of pixels, boundary coordinates, and center coordinates of each pore (accurate to one decimal place); next, using the pore center as a node, calculating the Euclidean distance between nodes (accurate to one decimal place); when the distance is less than a preset threshold of 50-100 pixels, a connected path is determined, and node connections are established. Simultaneously, the equivalent radius is calculated using the number of pore pixels and image resolution (1-5 nm / pixel) (accurate to 0.1-0.5 nm); finally, false pores with an area less than 20 pixels are removed, boundary deviations are corrected, and the topology network is optimized. This model constructs the pore spatial topology structure and extracts pore connectivity and morphological parameters. Breaking away from the limitations of traditional analysis that only focuses on the number of pores, this method quantifies pore connectivity efficiency (with a calculation error within ±5%), providing crucial connectivity data for assessing rock permeability and flow capacity. It is applicable to the analysis of rock pore functional characteristics in scenarios such as oil and gas exploration and geological engineering, enhancing the engineering application value of pore parameters.
[0055] The Machine Vision SEM Pore Intelligent Quantification Cloud Platform is the core carrier integrating the entire process functions in this invention. It integrates data reception, processing, computation, storage, and display, achieving automation and integration of pore identification calculation. SEM stands for "Scanning Electron Microscope." The platform relies on the collaborative work of multiple units: the SEM image data receiving and parsing unit receives the original microscope image, parses the format, and transmits it to the image sub-region division unit; the division unit divides the image into sub-regions ranging from 256×256 to 1024×1024 pixels, and transmits the data to the threshold inversion, edge enhancement, and topology inversion computation units; each computation unit calls the corresponding model / algorithm to complete threshold calculation, edge enhancement, topology construction, and parameter extraction; the pore change calculation and integration unit integrates the parameters of each sub-region to generate the overall pore change result; the result storage and display unit stores the results (XML / JSON format) according to timestamp and sample number, and displays them through a visual interface. This platform achieves fully automated processing, integrates disparate technical links, and supports parallel computation of multiple batches of images. It solves the problems of scattered equipment / software, heavy manual operation, and low efficiency in traditional technologies, reducing the processing time of a single image to the minute level, reducing human error, and realizing centralized data management and traceability. It meets the needs of large-scale, efficient, and accurate monitoring of rock porosity changes in engineering scenarios, and provides an integrated technology platform for rock porosity analysis in multiple fields.
[0056] like Figure 2As shown, an automatic identification and calculation method for rock cross-section porosity variations based on machine vision using SEM is implemented through different units, including: an SEM image data receiving and parsing unit, which connects to the scanning electron microscope via a data transmission interface, receives raw image data, parses the format, and transmits the parsed data to an image sub-region division unit; an image sub-region division unit, which receives the parsed data, divides it according to preset sub-region size and coordinate rules, generates multiple image sub-region data, and transmits them to a two-phase porosity threshold inversion unit and a data temporary storage unit, respectively; a two-phase porosity threshold inversion unit, which calls a two-phase porosity threshold inversion model in the algorithm model library to perform threshold analysis and calculation on the image sub-region data, obtains the two-phase porosity segmentation threshold, and transmits it to a pore edge gradient enhancement unit; and a pore edge gradient enhancement unit. The first unit receives the two-phase pore segmentation threshold, combines it with its stored pore edge gradient enhancement algorithm, performs edge enhancement on the threshold-processed image sub-region data, generates intermediate image data, and transmits it to the two-phase pore topology inversion unit. The two-phase pore topology inversion unit calls the two-phase pore topology inversion model to analyze the intermediate image data, constructs and optimizes the pore spatial topology network, extracts pore feature parameters, and transmits them to the pore change calculation and integration unit. The pore change calculation and integration unit receives the pore feature parameters, integrates and calculates them according to preset rules to obtain the rock cross-section pore change identification calculation results, and transmits them to the result storage and display unit. The result storage and display unit receives the calculation results, classifies and stores them according to timestamp and rock sample number, and displays them in chart form through a visualization interface for users to query and access.
[0057] This machine vision-based method for automatic identification and calculation of rock cross-sectional porosity changes under SEM (Search Engine Image) offers high accuracy. It processes image data by region, adapts to different sub-region grayscale features using a specialized threshold inversion model, and enhances pore edge details with an edge gradient enhancement algorithm. This method accurately distinguishes rock matrix from pores, reducing false pore interference and missing small pores, ensuring the accuracy of pore parameter calculations. It is highly adaptable, allowing adjustment of analysis parameters based on rock samples with different lithologies and porosity development levels, eliminating the need to redesign processes for single sample types. Furthermore, it boasts high processing efficiency, leveraging a cloud platform for centralized processing of multiple batches of image data and supporting parallel computation across multiple sub-regions. This significantly shortens the data processing cycle, reduces manual operation intensity, minimizes the impact of human factors on results, and meets the demand for efficient acquisition of rock porosity change data in engineering scenarios.
[0058] This method addresses the issue of insufficient accuracy in pore segmentation and edge extraction. It first divides the original image into multiple sub-regions to avoid threshold deviation caused by excessive grayscale differences during overall processing. Then, it uses a specialized model to adaptively determine the segmentation threshold and combines it with an edge enhancement algorithm to highlight pore edge features, fundamentally solving the limitations of traditional single threshold and simple gradient algorithms. Addressing the issue of low automation and integration, its cloud platform integrates the entire process from image reception and parsing, region segmentation, model computation, result integration, storage, and display. Data is automatically transmitted and processed at each stage, eliminating the need for manual switching between different devices or software. This reduces operational complexity and avoids errors caused by manual data transmission. Simultaneously, it supports multi-task parallel processing, significantly improving overall analysis efficiency and meeting the engineering needs for rapid and accurate identification and calculation of rock pore changes.
[0059] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," "link," and "fix" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0060] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for automatic identification and calculation of rock cross-sectional porosity variations based on machine vision under SEM, characterized in that, Includes the following steps: S1. Obtain raw image data of rock cross-section using a scanning electron microscope. The raw image data includes grayscale information and spatial distribution information of different regions of the rock cross-section. Transmit the raw image data to the machine vision SEM porosity intelligent quantification cloud platform. S2. In the machine vision SEM porosity intelligent quantification cloud platform, the original image data is divided into regions to divide multiple non-overlapping image sub-regions. Each image sub-region corresponds to the local area of the rock cross section, and the position coordinate information of each image sub-region is recorded. S3. Call the dual-phase pore threshold inversion model to analyze the grayscale information of each image sub-region, determine the initial threshold range based on the grayscale value distribution characteristics of pixels in the image sub-region, and adjust the threshold parameters through iterative calculation to obtain the dual-phase pore segmentation threshold corresponding to each image sub-region. S4. The aperture edge gradient enhancement algorithm is used to extract the edges of the image sub-region after the dual-phase aperture segmentation thresholding process. The gray-level gradient value between each pixel and its neighboring pixels is calculated. The pixel contrast of the aperture edge region is enhanced according to the change law of the gray-level gradient value, and intermediate image data including aperture edge features is generated. S5. Use the two-phase pore topology inversion model to perform topological structure analysis on the intermediate image data, construct a pore space topology network, extract the spatial distribution coordinates of pores, the connectivity path information between pores and the morphological characteristic parameters of pores, optimize the pore space topology network, and remove false pore structure data. S6. Based on the optimized pore space topology network, calculate the number of pores, the equivalent diameter of pores, the area ratio of pores, and the connectivity parameters of pores in each image sub-region. Integrate the calculation results of all image sub-regions to obtain the pore change recognition calculation result of the entire rock cross section, and store the result in the machine vision SEM pore intelligent quantification cloud platform.
2. The automatic identification and calculation method for rock cross-sectional porosity variations based on machine vision under SEM, as described in claim 1, is characterized in that... The expression for the two-phase pore threshold inversion model is as follows: ,in The threshold for two-phase pore segmentation. This represents the average grayscale value of the pixels in the rock matrix region. The grayscale standard deviation of the pixels in the rock matrix region. This represents the average grayscale value of the pixels in the pore region. The grayscale standard deviation of the pixels in the pore region. This is the threshold adjustment coefficient. This represents the total number of pixels within a sub-region of the image. For the first The coordinates of each pixel For the first The gradient value of each pixel in the grayscale gradient matrix.
3. The automatic identification and calculation method for rock cross-sectional porosity variations based on machine vision under SEM, as described in claim 1, is characterized in that... The expression for the pore edge gradient enhancement algorithm is as follows: ; in, The enhanced pixel grayscale gradient value. This represents the original pixel grayscale gradient value. For gradient enhancement coefficients, The gradient decay coefficient is... This represents the average grayscale gradient of all pixels within a sub-region of the image. This represents the maximum value of the original gray-level gradient within a sub-region of the image. It represents the minimum value of the original gray-level gradient within a sub-region of the image.
4. The automatic identification and calculation method for rock cross-sectional porosity variations based on machine vision under SEM, as described in claim 1, is characterized in that... The expression for the two-phase pore topology inversion model is as follows: ,in For pore connectivity parameters, This represents the total number of connected paths between pores. For the first The length of the connected path, For the first The equivalent diameter of a connected path. The total area of pores within the image sub-region. The total area of the image sub-region. This is the topology correction coefficient.
5. The automatic identification and calculation method for rock cross-sectional porosity variations based on machine vision under SEM, as described in claim 1, is characterized in that... The parameter calculation model expression for image sub-region segmentation in the machine vision SEM porosity intelligent quantization cloud platform is as follows: ,in The number of image sub-regions. The width of the original image data. The height of the original image data. The width of a single image sub-region The height of a single image sub-region. It is a rounding function. This is a sub-region number correction coefficient, used to adjust the deviation in the number of sub-regions caused by the image edge region being insufficient to meet the size of a single sub-region.
6. The automatic identification and calculation method for rock cross-sectional porosity variations based on machine vision under SEM, as described in claim 1, is characterized in that... The calculation model expression for the equivalent diameter of pores in the rock fracture pore variation identification calculation results is as follows: ,in The equivalent diameter of the pores. The area of a single pore. This refers to the number of pixels on the edge of a single aperture. For the first The distance from each edge pixel to the center of the aperture This is the equivalent diameter correction factor, used to compensate for calculation deviations caused by differences in image resolution.
7. The automatic identification and calculation method for rock cross-sectional porosity variations based on machine vision under SEM, as described in claim 1, is characterized in that... Step S3 includes the following sub-steps: S31. Retrieve grayscale data of each image sub-region from the database of the machine vision SEM porosity intelligent quantization cloud platform, establish a grayscale value statistical matrix, count the number of pixels corresponding to each grayscale value, and form a grayscale histogram; S32. Divide the grayscale values in the grayscale histogram into multiple intervals, calculate the cumulative proportion of pixels in each interval, and determine two grayscale value concentration intervals that may correspond to the rock matrix and pores; S33. Based on the grayscale mean and standard deviation of the two grayscale value concentration intervals, initialize the parameters of the two-phase pore threshold inversion model, and set the upper limit of the number of iterations and the threshold convergence accuracy; S34. Perform iterative calculation on the two-phase pore threshold inversion model according to the set upper limit of the number of iterations and the threshold convergence accuracy. After each iteration, calculate the segmentation effect evaluation index corresponding to the current threshold. When the evaluation index meets the convergence accuracy requirements, stop the iteration and output the two-phase pore segmentation threshold.
8. The automatic identification and calculation method for rock cross-sectional porosity variations based on machine vision under SEM, as described in claim 1, is characterized in that... Step S4 includes the following sub-steps: S41, traversing pixels in the image sub-region after the dual-phase aperture segmentation thresholding process, obtaining the grayscale values of the 8 neighboring pixels of each pixel, and calculating the grayscale difference between the pixel and its 8 neighboring pixels; S42, constructing a grayscale gradient matrix based on the grayscale difference, and using the Sobel operator to filter the grayscale gradient matrix to highlight the gradient change characteristics of the aperture edge region; S43, normalizing the gradient values in the filtered grayscale gradient matrix to ensure that the gradient values are within a preset numerical range, avoiding the impact of excessively large or small gradient values on the subsequent edge enhancement effect. S44. Call the pore edge gradient enhancement algorithm, substitute the normalized gray-level gradient value into the algorithm expression, calculate the enhanced gray-level gradient value, adjust the gray-level value of the corresponding pixel according to the enhanced gray-level gradient value, and generate intermediate image data including pore edge features.
9. The automatic identification and calculation method for rock cross-sectional porosity variations based on machine vision under SEM, as described in claim 1, is characterized in that... Step S5 includes the following sub-steps: S51, binarize the intermediate image data, mark the pore region as the target pixel, and mark the rock matrix region as the background pixel to form a binarized image; S52, use a region growing algorithm to extract connected regions from the target pixels in the binarized image, determine the boundary range of each independent pore, and record the boundary pixel coordinates of each pore; S53, input the boundary pixel coordinates of each pore into the two-phase pore topology inversion model, calculate the center coordinates, equivalent radius, and Euclidean distance between pores, and construct the initial structure of the pore space topology network; S54, remove redundant data from the initial pore space topology network, delete false pore structures with an area smaller than a preset threshold, correct the pore boundary deviation caused by image noise, and obtain the optimized pore space topology network.
10. The automatic identification and calculation method for rock cross-sectional porosity variations based on machine vision under SEM, as described in any one of claims 1-9, is characterized in that... This method is implemented through different units, including: The SEM image data receiving and parsing unit is connected to the scanning electron microscope through a data transmission interface. It receives the raw image data, parses the format, and transmits the parsed data to the image sub-region division unit. The image sub-region division unit receives the parsed data, divides it according to the preset sub-region size and coordinate rules, generates multiple image sub-region data, and transmits them to the dual-phase aperture threshold inversion unit and the data temporary storage unit respectively. The dual-phase pore threshold inversion unit calls the dual-phase pore threshold inversion model in the algorithm model library to perform threshold analysis and calculation on the image sub-region data, obtain the dual-phase pore segmentation threshold, and transmit it to the pore edge gradient enhancement unit. The pore edge gradient enhancement unit receives the two-phase pore segmentation threshold, combines it with its own stored pore edge gradient enhancement algorithm, performs edge enhancement on the image sub-region data after threshold processing, generates intermediate image data, and transmits it to the two-phase pore topology inversion unit. The two-phase pore topology inversion unit calls the two-phase pore topology inversion model to analyze intermediate image data, constructs and optimizes the pore space topology network, extracts pore feature parameters and then transmits them to the pore change calculation and integration unit. The porosity variation calculation and integration unit receives porosity characteristic parameters, integrates and calculates them according to preset rules to obtain the rock fracture porosity variation identification calculation results, and transmits them to the result storage and display unit. The results storage and display unit receives the calculation results, stores them according to timestamps and rock sample numbers, and displays them in chart form through a visual interface for users to query and access.
Citation Information
Patent Citations
Shale crack evaluation method based on low-field nuclear magnetic resonance
CN115421213A
Method and device for identifying and calculating pore characteristics of porous material and readable storage medium
CN119919676A
Farmland yield prediction method and system based on soil parameter inversion
CN120598118A
PCBA board defect detection method and system based on image processing
CN120823430A
Three-dimensional pore reconstruction method and system based on rock image
WO2025200876A1
Cited By
Dust pollution detection method and system based on image recognition
CN121811163A
FCM-based shale MAPs organic aperture rapid identification method
CN122090176A
