A porosity image data transfer method using principal component analysis
By separating color channels and using principal component analysis methods to construct a porosity regression model, the data transfer problem between different software platforms was solved, and the rapid exchange of porosity data and improved accuracy were achieved.
Patent Information
- Application Number
- CN202510046857.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-01-13
AI Technical Summary
Traditional porosity analysis methods are limited by specific software environments, which makes data sharing and cross-platform applications difficult, especially the inability to directly transfer data between different software.
The porosity regression model was constructed by combining color channel separation with principal component analysis to achieve data interoperability between different software platforms.
It realizes the rapid exchange of porosity data between different software and improves the efficiency and accuracy of data processing.
Smart Images

Figure CN120125500B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of petroleum and natural gas engineering, and in particular relates to a porosity image data transmission method using a principal component analysis method. Background Art
[0002] In the fields of geology and petroleum engineering, porosity is a key parameter for describing rock pore properties and is crucial for assessing reservoir quality and predicting fluid flow behavior. Traditional porosity analysis methods rely on laboratory testing and specialized software. The resulting data and analysis are often limited to specific software environments and lack standardized data formats and interfaces, leading to difficulties in data sharing and cross-platform applications. In particular, when different software utilizes different numerical calculation methods, the resulting data cannot be directly transferred and applied. For example, the seepage software Eclipse uses a regular grid using finite differences, while the geomechanics software Abaqus uses an irregular finite element grid. In these cases, the data cannot be directly transferred and applied.
[0003] To solve this problem, the present invention proposes a method for transferring porosity data using color channel separation combined with principal component analysis, which can achieve data interoperability between different software platforms. Summary of the Invention
[0004] The purpose of the present invention is to solve the problem of porosity data exchange between different software in geology and petroleum engineering, so that users can quickly realize data exchange between different software and improve work efficiency.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] The present invention provides a porosity image data transmission method using a principal component analysis method, comprising the following steps:
[0007] S1. Obtain a first image from a first software, where the first image contains porosity information, and separate the first image into color channels;
[0008] S2, normalizing the color channels separated in step S1 to obtain a normalized two-dimensional array of pixels in the first image;
[0009] S3. Construct a porosity regression model using the principal component analysis method for the normalized color channel, and calculate the porosity using the regression model.
[0010] Furthermore, in step S1, the RGB intensity of each pixel of the first image is obtained by separating the color channels.
[0011] Furthermore, the normalization processing method in step S2 is:
[0012] R′(x,y)=R(x,y) / 255
[0013] G′(x,y)=G(x,y) / 255
[0014] B′(x,y)=B(x,y) / 255
[0015] Where (x, y) is the pixel coordinate position, R, G, and B are the intensity values of red, green, and blue, respectively, and R′, G′, and B′ are the normalized values.
[0016] Furthermore, the step S2 further includes:
[0017] S2.1. Obtain a normalized two-dimensional array of each pixel;
[0018] S2.2. Construct a dataset of all pixel feature values.
[0019] Furthermore, the step S3 further includes:
[0020] S3.1. Calculate the mean of the data set in step S2.2.
[0021] S3.2, centralize the data set;
[0022] S3.3. Calculate the covariance matrix of the centralized dataset.
[0023] Furthermore, the centralized processing method in S3.2 is:
[0024]
[0025] Among them, X centered is the data set after centralized processing, X m×n is a dataset containing the feature values of all pixels, is the mean of the data set.
[0026] Furthermore, the covariance matrix calculation method in step S3.3 is:
[0027]
[0028] Where Σ is the covariance matrix, m is the number of samples, X centered The dataset is centralized.
[0029] Furthermore, a second image is obtained by obtaining the porosity through the regression model. The second image contains porosity information. The second image can be applied to the second software to select one or more areas at corresponding positions in the first image and the second image, and compare the porosity value of the first image with the porosity value of the second image. When the difference between the two is greater than a preset threshold, the regression model is optimized until the difference is less than the preset threshold.
[0030] Corresponding to the method provided by the present invention, the present invention provides a porosity image data transmission system using a principal component analysis method, characterized in that it includes the following modules:
[0031] A first image processing module is used to obtain a first image, wherein the first image includes porosity information and separates color channels of the first image;
[0032] a normalization processing module, performing normalization processing on the color channels separated in the first image processing module to obtain a normalized two-dimensional array of pixels in the first image;
[0033] The porosity calculation module constructs a porosity regression model using the principal component analysis method for the normalized color channels, and calculates the porosity using the regression model.
[0034] The present invention provides a hardware for a porosity image data transmission method using a principal component analysis method, characterized by comprising:
[0035] memory for storing computer programs;
[0036] A processor is configured to execute the computer program to implement the steps of any one of the above-mentioned methods for transmitting porosity image data.
[0037] The present invention provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to implement the steps of the porosity image data transmission method as described in any one of the above.
[0038] The method provided by the present invention can handle the transmission of porosity data between different software. By segmenting and digitizing the porosity image, combined with the separation of color channels and principal component analysis methods, the specific porosity value can be obtained and used in other software, thereby improving the efficiency and accuracy of data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 Schematic diagram of the method flow of the present invention;
[0040] Figure 2 is a first image in a specific embodiment of the present invention;
[0041] Figure 3 is the second image in a specific embodiment of the present invention. DETAILED DESCRIPTION
[0042] The present invention will be described in detail below with reference to the accompanying drawings.
[0043] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present 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 only used to explain the present invention and are not intended to limit the present invention.
[0044] In order to realize the transfer of porosity data between different software, such as Figure 1 As shown, the present invention provides a porosity image data transmission method using a principal component analysis method, comprising the following steps:
[0045] S1. Obtain a first image from a first software, where the first image contains porosity information, and separate the first image into color channels;
[0046] Furthermore, the RGB intensity of each pixel of the first image is obtained by separating the color channels;
[0047] Specifically, such as Figure 1 As shown, the first image is typically a color image, where different colors correspond to different porosity information. Separating the color channels to obtain each pixel's color channel involves extracting the red, green, and blue intensity values for each pixel I(x,y) in an RGB color image. This yields a two-dimensional array of pixel color intensities: I(x,y) = (R(x,y),G(x,y),B(x,y)), where R, G, and B are the red, green, and blue intensities, respectively. The red, green, and blue intensities at each location are extracted using the following formula.
[0048] R(x,y)=I(x,y)R
[0049] G(x,y)=I(x,y)G
[0050] B(x,y)=I(x,y)B
[0051] For an image, the total number of pixels in the image is x*y. Since each pixel I(x,y) has red, green, and blue intensity values, there are x*y red intensity values R(x,y), x*y green intensity values G(x,y), and x*y blue intensity values B(x,y).
[0052] S2. Normalize the color channels separated in step S1 to obtain a normalized two-dimensional array of pixels in the first image.
[0053] In step S2, normalization processing refers to converting the integer data from 0 to 255 in the two-dimensional array of the separated color channels into floating-point numbers between 0 and 1 to represent pixel values. The formula adopted is:
[0054] R′(x,y)=R(x,y) / 255
[0055] G′(x,y)=G(x,y) / 255
[0056] B′(x,y)=B(x,y) / 255
[0057] Further obtain the normalized two-dimensional array of pixels:
[0058] I′(x,y)=(R′(x,y),G′(x,y),B′(x,y))
[0059] Further sort out all the pixel feature values to get a dataset X with m samples and n features m×n as follows:
[0060]
[0061] Where m = x*y, n = 3, the first column contains m elements, which means x*y red intensity values, that is, it contains the red intensity of each position. Similarly, the second and third columns also contain m elements, which means x*y green and blue pixel values respectively.
[0062] S3. Construct a porosity regression model using the principal component analysis method for the normalized color channel, and calculate the porosity using the regression model.
[0063] In step S3, the porosity is solved by principal component analysis, which includes the following steps:
[0064] S3.1. Calculate the mean vector of samples in S2 Through S2, we get a dataset X with m samples and n features. m×n , for X m×n The mean vector of the samples in The method is as follows, where x i It can be a color value triplet [R′(x,y)G′(x,y)B′(x,y)] of a pixel, with a total of m pixels.
[0065]
[0066] S3.2. Center the dataset in S3.1: Subtract the mean from each eigenvalue in matrix X so that the mean of each eigenvalue is zero. The centering method is as follows.
[0067]
[0068] S3.3. Calculate the data set X after the centralization process in S3.2 centered The covariance matrix ∑ of the data set is calculated as follows:
[0069]
[0070] Among them, X centered is the centered data matrix with size m×n; It's X centered The transpose of , with size n × m; m-1 is the number of samples minus 1, used for unbiased estimation.
[0071] S3.4. Perform eigenvalue decomposition on the covariance matrix ∑ to obtain eigenvalues λ1, λ2···, λ n and the corresponding eigenvectors v1, v2···, v n , the steps are as follows:
[0072] S3.4.1. Construct the characteristic equation to solve the eigenvalue λ(λ=λ1,λ2···,λ n ):
[0073] det(Σ-λI)=0
[0074] Where Σ is the covariance matrix, I is the identity matrix, and det represents the determinant of the matrix.
[0075] S3.4.2. Through the eigenvalue λ (λ=λ1, λ2···, λ n ) Solve for the corresponding eigenvector v(v=v1,v2
[0076] ···,v n ), the formula is as follows:
[0077] (Σ-λI)v=0
[0078] S3.4.3. Extract the largest eigenvector v as the first principal component for subsequent calculations:
[0079] v max =max(v i )(i=1,2…n)
[0080] S3.5. Define principal component scores:
[0081] Different colors correspond to different sample values x i , different eigenvalues and eigenvectors have been obtained through S3.4, and the eigenvector corresponding to the largest eigenvalue is selected as the first principal component to participate in the calculation.
[0082] The principal component score Z is defined by the following formula i :
[0083]
[0084] S3.6. Regression solution for porosity:
[0085] The sample value x is found by comparing different colors in the chromaticity bar i , find the principal component score Z i The regression model is established with the porosity corresponding to the color as follows:
[0086]
[0087] in: is the porosity, Z i is the score of the principal component, a and b are the corresponding regression coefficients, which can be obtained by establishing the following equations based on the principal component scores of the two color samples in the chromaticity bar and the corresponding porosity of the two colors.
[0088]
[0089] Furthermore, the second image is obtained by using the porosity obtained by the regression model, such as Figure 3 As shown, the second image contains porosity information. The second image can be applied to the second software to select one or more areas at corresponding positions in the first image and the second image, compare the porosity value of the first image with the porosity value of the second image, and when the difference between the two is greater than a preset threshold, optimize the regression model until the difference is less than the preset threshold.
[0090] In another embodiment of the present invention, to verify the accuracy and precision of the present invention, after acquiring the second image, one or more regions at corresponding positions in the first and second images can be selected. Here, the regions can be corresponding points with the same coordinates or corresponding segmented regional images. Porosity information in the corresponding regions is obtained. By comparing the porosity values of the first image with the porosity values of the second image, for example, the absolute value of the difference between the two can be obtained. When the absolute value of the difference between the two is less than a preset threshold, it indicates that the method of the present invention is reliable and can achieve porosity data transfer between different software. When the absolute value of the difference between the two is greater than the preset threshold, the regression model can be optimized until the absolute value of the difference is less than the preset threshold.
[0091] In another embodiment of the present invention, in order to quickly verify the accuracy and precision, the first image can be obtained to set feature points. The feature points can describe the plane geometric information of the first image, so that the exact position of a certain pixel point on the first image can be obtained through the feature points. Correspondingly, the corresponding feature points can also be obtained on the second image. For example, when the first image is a plane rectangle, by setting the four endpoints of the plane rectangle as the feature points of the first image, the four endpoints of the second image are the feature points of the second image. After obtaining the feature points, the corresponding plane two-dimensional geometric coordinate system can be established according to the feature points, thereby dividing the regional image between the feature points along the first direction and the second direction, so that the accurate coordinate information of any position in the first image and the corresponding position in the second image can be obtained. Set the horizontal direction as the first direction, set the vertical direction as the second direction, and divide the regions along the first direction and the second direction. The above method can be used to divide the image into several regional images. For each regional image, by comparing the porosity value of the first image with the porosity value of the second image (the comparison area is the same position), for example, the absolute value of the difference between the two can be obtained. When the absolute value of the porosity difference of each area is less than a preset threshold, it means that each divided area meets the preset threshold, and the accuracy requirement is met at this time; otherwise, the regression model is further optimized. It should be noted that the more regions are divided, the more porosity information is carried by comparing the corresponding positions of the first image and the second image. When other conditions are determined, it also means that the more areas in the first image and the second image that meet the accuracy requirements, the higher the accuracy at this time.
[0092] It can be seen that the method provided in this application can realize the transmission of porosity information between different software, and technicians can also accurately obtain accurate porosity numerical information in porosity images by applying the method provided in this application, which has the characteristics of fast data interaction and improved work efficiency.
[0093] The above description is only 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 in the scope of protection of the present invention.
Claims
1. A porosity image data transfer method using principal component analysis method, comprising the following steps: S1. Obtain a first image from a first software, where the first image contains porosity information, and separate the first image into color channels; S2, normalizing the color channels separated in step S1 to obtain a normalized two-dimensional array of pixels in the first image; S3. Using the principal component analysis method to construct a porosity regression model for the normalized color channel, and using the regression model to calculate the porosity; A second image is obtained by using the porosity obtained by the regression model. The second image contains porosity information. The second image is applied to a second software.
2. The porosity image data transmission method according to claim 1, wherein in step S1, the RGB intensity of each pixel of the first image is obtained by separating the color channels.
3. The porosity image data transmission method according to claim 1, wherein the normalization processing method in step S2 is: R′(x ,y)=R(x ,y) / 255 G′(x ,y)=G(x ,y) / 255 B′(x ,y)=B(x ,y) / 255 Where (x, y) is the pixel coordinate position, R, G, and B are the intensity values of red, green, and blue, respectively, and R′, G′, and B′ are the normalized values.
4. The porosity image data transmission method according to claim 1, wherein step S2 further comprises: S2.
1. Obtain a normalized two-dimensional array of each pixel; S2.
2. Construct a dataset of all pixel feature values.
5. The porosity image data transmission method according to claim 4, wherein step S3 further comprises: S3.
1. Calculate the mean of the data set in step S2.
2. S3.2, centralize the data set; S3.
3. Calculate the covariance matrix of the centralized dataset.
6. The porosity image data transmission method according to claim 5, wherein the centralization processing method in S3.2 is: , in, is the centralized dataset. is a dataset containing the feature values of all pixels, is the mean of the data set.
7. The porosity image data transmission method according to claim 5, wherein the covariance matrix calculation method in step S3.3 is: , in, Σ is the covariance matrix, m is the number of samples, The dataset is centralized.
8. A porosity image data transmission system using principal component analysis method, characterized in that: Includes the following modules: A first image processing module is used to obtain a first image, wherein the first image includes porosity information and separates color channels of the first image; a normalization processing module, performing normalization processing on the color channels separated in the first image processing module to obtain a normalized two-dimensional array of pixels in the first image; A porosity calculation module constructs a porosity regression model using the principal component analysis method for the normalized color channels, and calculates the porosity using the regression model; A second image is obtained by using the porosity obtained by the regression model. The second image contains porosity information. The second image is applied to a second software.
9. A hardware for a porosity image data transmission method using a principal component analysis method, characterized in that: include: memory for storing computer programs; A processor is configured to execute the computer program to implement the steps of the porosity image data transmission method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is executed by a processor to implement the steps of the porosity image data transmission method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Shale abnormal aperture recognition method based on machine learning
CN115457348A
Comprehensive evaluation method for transmission performance of porous material based on principal component analysis
CN117408019A