A method for analyzing and processing rock CT images

By employing image preprocessing and segmentation techniques, the challenges of noise and resolution in rock CT images have been addressed, enabling efficient analysis of rock pore structure and mineral distribution, thereby improving the quality and readability of rock CT images.

CN118587271BActive Publication Date: 2026-03-06CHINA UNIV OF GEOSCIENCES (BEIJING)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing CT technology faces challenges in rock analysis and processing due to the difficulty in balancing noise, image resolution, and field of view, resulting in decreased image quality and affecting the accurate analysis of pore structure and mineral distribution.

Method used

Image preprocessing methods are employed, including image denoising and enhancement. Image segmentation and automatic analysis are performed using OpenCV and PIL libraries. Image quality is improved through nonlocal mean denoising algorithm and pixel value filtering technology, and color thresholding is used to improve segmentation accuracy.

Benefits of technology

It improves the quality and clarity of rock CT images, enhances the ability to identify pores, fractures, and minerals, and enables automatic analysis of mineral content and grain size, thereby improving the accuracy and efficiency of the analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587271B_ABST
    Figure CN118587271B_ABST
Patent Text Reader

Abstract

This invention discloses a method for analyzing and processing rock CT images, including image preprocessing, image segmentation, and automatic analysis. It uses OpenCV and PIL to process and analyze the images. Image preprocessing includes image denoising and image enhancement. Image segmentation is performed by setting a threshold, and the parameter information after segmentation is statistically analyzed. A zero matrix `color_mask` with the same dimension as the input image is created. `out_mask` and `color_mask` are updated according to the color threshold range. The `cv2.findContours` function is used to find contours in `color_mask`. For each contour, a zero matrix `each_mask` with the same dimension as `out_mask` is created, and the current contour is drawn. The `color_mask` is applied to `each_mask` to generate `each_color_mask`. For all contours of each color, the total area, area ratio, and equivalent diameter are calculated. This rock CT image analysis and processing method not only provides a systematic approach to rock CT image processing, improving image quality, but also effectively extracts pores and fractures, identifies different mineral phases, and performs automatic analysis of mineral content and grain size.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of rock image processing technology, and more specifically to a method for analyzing and processing rock CT images. Background Technology

[0002] With the continuous growth of global energy demand, the exploration and mining of metal deposits have become increasingly important. In this process, accurate analysis of rock pore structure and quantitative characterization of minerals are crucial for resource assessment and exploration. X-ray computed tomography (CT) technology, with its ability to provide high-resolution three-dimensional images, can reveal the complex pore networks and mineral distribution within rocks, and has become a key tool in geological research. CT technology can non-destructively acquire three-dimensional images of the internal structure of rocks, which is of great significance for understanding the pore network, the geometry of pores and fractures, and the distribution of minerals. High-resolution CT images can accurately display the location and morphology of tiny pores and mineral grains, thereby helping to understand the mechanisms of fluid flow in low-permeability rocks and mineralization processes.

[0003] However, despite the significant advantages of CT technology, several challenges remain in practical applications, limiting its comprehensive use in rock analysis and processing. First, the acquired CT images are often affected by noise, which may originate from electronic noise from the scanning equipment, sample inhomogeneity, and interference from the external environment. This noise degrades image quality, leading to deviations in the analysis and processing of pore structure and mineral distribution. Furthermore, CT images present a trade-off between resolution and field of view. High-resolution images have a smaller field of view, making it difficult to fully cover large-volume rock samples; conversely, large-field-of-view images have low resolution, failing to accurately characterize minute pores and mineral structures. During scanning, uneven lighting also results in uneven brightness in the acquired CT images. This unevenness negatively impacts subsequent image processing and analysis; for example, when performing threshold segmentation of different components, it often leads to an increased segmentation range, causing deviations in quantitative analysis results.

[0004] Therefore, there is an urgent need for those skilled in the art to provide a rock CT image analysis and processing method that can improve image quality and accurately perform quantitative characterization and analysis of pores, fractures, and minerals, thereby enhancing its application in geological exploration and mineral resource development. Summary of the Invention

[0005] The purpose of this invention is to provide a method for analyzing and processing rock CT images to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for analyzing and processing rock CT images, comprising the following steps:

[0007] S1: Image preprocessing. OpenCV is used to preprocess the input image, including image denoising and image enhancement. Noise is random interference introduced during image acquisition, transmission, or processing, affecting image quality and usability. Image denoising eliminates noise, making the image clearer and easier to analyze and process. Additionally, the original image has abnormally bright edges, which need to be weakened. Image enhancement makes the image more natural, further highlighting information about pores, fissures, and minerals, improving readability in terms of visual effect, contrast, and brightness.

[0008] S2: Image segmentation and automatic analysis, using PIL for image analysis:

[0009] S2.1, Perform image segmentation based on a set threshold;

[0010] S2.2, initialize a dictionary to store the parameter statistics of each color segmentation result, including the threshold range, area, area ratio and particle size of different colors;

[0011] S2.3 Iterate through the dictionary initialized in S2.2, and for each color, create a zero matrix color_mask with the same dimension as the input image to mark the segmentation region of the current color;

[0012] S2.4 Update out_mask and color_mask according to the threshold range of the colors. The out_mask records the segmentation results of all colors, and the color_mask only records the currently processed color.

[0013] S2.5, use the cv2.findContours function to find the contours in color_mask to represent the segmentation regions of the current color. For each contour, create a zero matrix each_mask with the same dimension as out_mask, and draw the current contour in each_mask.

[0014] S2.6, Image Output and Target Parameter Output: Apply color_mask to each_mask to generate each_color_mask, which is used to represent the instantiated region of the current contour. For all contours of each color, calculate the total area, area percentage (area divided by the total number of pixels in the image), and equivalent diameter calculated based on the area.

[0015] Furthermore, in step S1, image denoising employs filtering techniques. Specifically, Python code is imported into the OpenCV library to read the image and call the `fastNlMeansDenoisingColored` method. This method utilizes information from similar regions in the image, based on the Non-Local Means Denoising algorithm, to reduce noise. This invention leverages information from all similar regions in the image to reduce noise, rather than just information from local regions.

[0016] Furthermore, in S1, image enhancement uses pixel value filtering to enhance the image. Specifically, the `eliminate_bright_single` function is used to process the edge positions of a single image, setting the filtering interval range, for example: `thres1`, `thres2`. The image is traversed pixel by pixel from left to right and from top to bottom to obtain the height and width of the new image. For each pixel, if the mask is true, that is, at the edge position, 50 consecutive pixel values ​​are taken starting from the current pixel position, and the number of pixels within the threshold range (`thres1`, `thres2`) is counted.

[0017] Furthermore, if the number of pixels is greater than 1, linear interpolation is performed on these pixels until the linearly interpolated pixel values ​​gradually decrease to a set range; a threshold is set: if the number is 1, the pixel values ​​within the threshold range are set. The pixel threshold is set according to the target number of statistics (for example, if one type of mineral needs to be counted, the pixel values ​​within the threshold range are set to thres1; if three types of minerals need to be counted, the pixel values ​​within the threshold range are set to thres1, thres2, and thres3). Finally, the pixel values ​​of the new image are updated, and the processed image is returned.

[0018] Furthermore, the set range is defined as the number of pixel values ​​reduced to a value equal to 1.

[0019] Furthermore, the specific steps of image segmentation in S2.1 are as follows: For a given color map, use Python code to traverse each color range, assign pixels in the image to different categories according to the color range, and then statistically analyze and save the pixel information, which includes the area occupied by each color category, the area ratio, and the particle size information.

[0020] Compared with the prior art, the beneficial effects of the present invention are: the rock CT image analysis and processing method of the present invention not only provides a systematic rock CT image processing method and improves image quality; but also can effectively extract pores and fractures and identify different mineral phases, and perform automatic analysis of mineral content and grain size.

[0021] (1) The present invention uses image preprocessing to improve the quality and clarity of rock images by using image denoising, making subsequent analysis more accurate and reliable; and uses image enhancement to highlight the details and features in the rock images, further improving the readability and analysis effect of the images.

[0022] (2) The present invention uses a color threshold segmentation method to segment different regions or objects in rock CT images, thereby further improving the accuracy and efficiency of segmentation;

[0023] (3) This invention improves the accuracy of image analysis by automatically extracting and analyzing the segmented image regions. It can effectively extract pores and cracks and identify different mineral phases, and automatically analyze the content and particle size, which is helpful for subsequent research. Attached Figure Description

[0024] Figure 1 This is a flowchart of a rock CT image analysis and processing method according to this embodiment;

[0025] Figure 2 This is the original CT image of the rock in this embodiment;

[0026] Figure 3 This is a rock CT image after image denoising and image enhancement in this embodiment;

[0027] Figure 4 This is a segmented distribution image of pyrite in a rock CT image of this embodiment;

[0028] Figure 5 This is a statistical table of information related to pyrite particles generated after image segmentation in this embodiment. Detailed Implementation

[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The number of embodiments in the accompanying drawings is only for illustrative purposes and is not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0030] Example

[0031] Please see the appendix Figure 1-5 This embodiment takes marble ore from the Guocheng gold deposit in Jiaodong as an example, and uses a rock CT image analysis and processing method of the present invention to perform statistical analysis on pyrite particles in the marble ore. Specifically, it includes the following steps:

[0032] S1: Image preprocessing. OpenCV is used to preprocess the input image, including image denoising and image enhancement. Image denoising employs filtering techniques. In this embodiment, Python code is imported into the OpenCV library to read the input image and call the `fastNlMeansDenoisingColored` method, which uses the Non-Local Means Denoising algorithm to denoise the image based on information from similar regions. Image enhancement uses pixel value filtering. Specifically, the `eliminate_bright_single` function is used to process the edge positions of a single image, setting the filtering interval to `thres1` and `thres2`. The image is traversed pixel by pixel from left to right and top to bottom to obtain the height and width of the new image. For each pixel, if the mask is true (i.e., at an edge position), 50 consecutive pixel values ​​are taken from the current pixel position and counted within the threshold range (`thres1`, `thres2`). The number of pixels within thres2); if the number of pixels is greater than 1, then linear interpolation is performed on these pixels until the linearly interpolated pixel values ​​gradually decrease to a set range, where the set range is the pixel value decreasing until the number of pixels equals 1; set a threshold: if the number is 1, the pixel threshold is set according to the target number of statistics (for example: if one mineral needs to be counted, then the pixel values ​​within the threshold range are set as thres1; if three minerals need to be counted, then the pixel values ​​within the threshold range are set as thres1, thres2, and thres3). In this embodiment, only one mineral needs to be counted, so the pixel values ​​within the threshold range are set as thres1. Finally, the pixel values ​​of the new image are updated, and the processed image is returned.

[0033] S2: Image segmentation and automatic analysis, using PIL for image analysis:

[0034] S2.1, Image segmentation based on a set threshold: For a given color map, use Python code to traverse each color range, assign pixels in the image to different categories according to the color range, and then statistically analyze and save the pixel information (the area occupied by each color category, the area ratio, and the particle size information).

[0035] S2.2, initialize a dictionary to store the parameter statistics of each color segmentation result, including the threshold range, area, area ratio and particle size of different colors;

[0036] S2.3 Iterate through the dictionary initialized in S2.2, and for each color, create a zero matrix color_mask with the same dimension as the input image to mark the segmentation region of the current color;

[0037] S2.4 Update out_mask and color_mask according to the threshold range of the colors. The out_mask records the segmentation results of all colors, and the color_mask only records the currently processed color.

[0038] S2.5, use the cv2.findContours function to find the contours in color_mask to represent the segmentation regions of the current color. For each contour, create a zero matrix each_mask with the same dimension as out_mask, and draw the current contour in each_mask.

[0039] S2.6, Image Output and Target Parameter Output: Apply color_mask to each_mask to generate each_color_mask, which is used to represent the instantiated region of the current contour. For all contours of each color, calculate the total area, area percentage (area divided by the total number of pixels in the image), and equivalent diameter calculated based on the area.

[0040] Appendix Figure 2 This is a 2D slice of the original CT data for marble ore, where the bright white areas are pyrite and the small black dots inside are pores; (Attached) Figure 3 This image is obtained after image denoising in step S1 of image preprocessing. It is clearly visible that the image quality is enhanced, noise is reduced, and the boundaries between pyrite (white bright spots) and pores (black dots) are more distinct. (Attached) Figure 4 This is a pyrite distribution image obtained after image segmentation, where the selected threshold range is (150, 255). The red bright blocks in the image are the extracted pyrite.

[0041] The above steps yielded relevant information about pyrite particles after segmentation of the marble ore CT image, including area, area percentage, and grain size. (See appendix.) Figure 5 , attached Figure 5 The first column of the table lists the extracted pyrite particles, with a total of four particles. The second column defines the pyrite particles in red for easier thresholding of other minerals or pores to prevent color duplication and difficulty in differentiation. The third column shows the area occupied by each pyrite particle in pixels. The fourth column shows the percentage of area occupied by each pyrite particle within the field of view. The fifth column shows the equivalent diameter, or particle size, of each pyrite particle. This allows for clearer identification of the specific location of pyrite, further improving image readability and analysis effectiveness. It also enhances the accuracy and efficiency of segmentation, effectively extracting pores and fissures, identifying different mineral phases, and automatically analyzing content and particle size.

[0042] Noise, introduced during image acquisition, transmission, or processing, affects image quality and usability. Image denoising eliminates noise, making images clearer and easier to analyze and process. Additionally, since the edges of the original image may be abnormally bright, these areas need to be weakened. Image enhancement makes the image more natural, further highlighting information about pores, fissures, and minerals, thus improving readability in terms of visual effect, contrast, and brightness. This embodiment utilizes information from all similar regions in the image to reduce noise, not just information from local areas.

[0043] The beneficial effects of this embodiment are as follows: The rock CT image analysis and processing method of this embodiment improves the quality and clarity of rock images by employing image preprocessing and image denoising, making subsequent analysis more accurate and reliable; image enhancement highlights details and features in the rock image, further improving image readability and analysis effectiveness; color thresholding segmentation separates different regions or objects in the rock CT image, providing a foundation for subsequent analysis and further improving segmentation accuracy and efficiency; automated feature extraction and analysis of the segmented image regions further improves image analysis accuracy, effectively enabling pore and fracture extraction and identification of different mineral phases, as well as automatic content and grain size analysis.

[0044] This embodiment of a systematic rock CT image processing method not only improves image quality, but also effectively extracts pores and fractures, identifies different mineral phases, and performs automatic analysis of mineral content and grain size, thereby enhancing its application effect in geological exploration and mineral resource development.

[0045] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A rock CT image analysis processing method, characterized by comprising the following steps: S1: image preprocessing, using OpenCV to preprocess the input image, the image preprocessing including image denoising and image enhancement; the image denoising adopts a non-local mean denoising algorithm; the image enhancement traverses the edge position of each pixel through the eliminate_bright_single function, and when the number of pixels in the continuous 50 pixels in the pixel value range is greater than 1, the pixel value is adjusted by linear interpolation; S2: image segmentation and automatic analysis, using PIL to analyze the image: S2.1, image segmentation, traversing a preset color mapping, and distributing the pixels in the image to different categories according to the color range; S2.2, initializing a dictionary for storing parameter statistics of each color segmentation result, including the threshold range, area, area ratio and particle size of different colors; S2.3, traversing the dictionary initialized in S2.2, for each color, creating a zero matrix color_mask with the same dimension as the input image for marking the segmentation area of the current color; S2.4, updating out_mask and color_mask according to the threshold range of the color, the out_mask records the segmentation result of all colors, and the color_mask only records the color being processed; S2.5, using the cv2.findContours function to find the contour in the color_mask, for each contour, creating a zero matrix each_mask with the same dimension as the out_mask, and drawing the current contour in the each_mask; S2.6, image output and target parameter output: applying the color_mask to the each_mask to generate each_color_mask, calculating the total area, area ratio, and equivalent diameter according to the area for all contours of each color.

2. The rock CT image analysis processing method according to claim 1, characterized in that: the image denoising in S1 uses filtering technology to denoise the image, specifically using Python code to import OpenCV library, read the image, and call fastNlMeansDenoisingColored method based on non-local mean denoising algorithm to denoise using the information of similar areas in the image.

3. The rock CT image analysis processing method according to claim 2, characterized in that: the image enhancement in S1 uses pixel value filtering to enhance the image, specifically using the eliminate_bright_single function to process the edge position of a single image, setting the filtering range, traversing each pixel from left to right and from top to bottom to obtain the height and width of the new image, and for each pixel, if the mask is true, taking the pixel values of the continuous 50 pixels from the current pixel position, and counting the number of pixels in the threshold range. ​ 4. The rock CT image analysis processing method according to claim 3, characterized in that: If the number of the pixel quantity is greater than 1, linear interpolation is performed on the pixels until the pixel value of the linear interpolation gradually decreases to a set range; if the number is 1, a pixel value in the threshold range is set, the pixel threshold is set according to the statistical target number, and finally the pixel value of the new image is updated to return the processed image.

5. The rock CT image analysis processing method according to claim 4, characterized in that: The set range is that the pixel value decreases to the number of the pixel quantity being equal to 1.

6. The rock CT image analysis processing method according to claim 2, characterized in that: The specific steps of the image segmentation in S2.1 are as follows: for a given color mapping, Python code is used to traverse each color range, the pixels in the image are assigned to different categories according to the color range, and the pixel information including the area occupied by each color category, the area ratio and the particle size information is counted and saved.

Citation Information

Patent Citations

  • Rock core mineral component identification method

    CN110873722A

  • Porous structure pore parameter image identification method based on Python batch processing

    CN116523849A