Rock core image segmentation method, system and equipment and storage medium
By calculating the sub-image height and width of the core image and using rounding and rounding processing, the problem of uneven slicing of the core image in the existing technology is solved, and the approximate uniform segmentation of the sub-image and depth information recording is realized, and the digital recording of the core is improved. accuracy and automation level.
Patent Information
- Application Number
- CN202411343295.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The prior art core image slicing method causes the sub-images to exceed or not fully cover the original image height range, affecting the accuracy of information extraction and core digital cataloging.
By obtaining the height H, width W and number of bands B of the core image, the height and width of the sub-image are calculated based on the set segment n and the image width factor m, and rounding is used to ensure that the size of the sub-image is close to uniform segmentation. , and record the depth start and end information of each sub-image.
Approximate uniform segmentation of sub-images is achieved, the reliability of information extraction is improved, and the accuracy of simulated artificial geological cataloging results and the automation level of core digital cataloging is enhanced.
Smart Images

Figure CN119228814A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing, and in particular relates to a core image segmentation method, system, equipment and storage medium. Background Art
[0002] Core geological logging is an effective means to obtain deep geological information, which is of great significance to engineering construction and mineral exploration. At present, this work mainly relies on experienced geological experts to carry out. There are shortcomings such as time-consuming and labor-intensive manual geological logging and serious influence of the logging results by the subjective factors of the logger. Digital logging of cores is a hot topic in current research, which mainly includes two aspects: digital data acquisition and information extraction of cores. The former can be achieved by measuring the drilled core samples with the help of various sensors, among which the hyperspectral camera that can obtain "image-in-one" image data is a research hotspot. Based on the collected data, the latter realizes geological information extraction through image processing and other means. In general, digital logging of cores is still in the exploratory stage. Related research mainly extracts information such as core lithology and altered minerals based on the acquired images (including hyperspectral images) and spectral curves, but the extraction results are not further summarized and sorted to form results similar to those of manual geological logging, that is, the results contain the start and end information of the drilling section depth and the corresponding lithology or alteration information of the section.
[0003] The preservation and research of complete information in the process of core geological logging depends on uniform image segmentation. Uniform image segmentation can achieve the accuracy of original image data or extraction results, which is of great significance for simulating manual geological logging results and realizing core digitalization and even automatic logging.
[0004] Core images (including two-dimensional and three-dimensional) are composed of pixels. In the prior art, a two-dimensional grayscale image is taken as an example, and its size is height × width × band (H × W × 1). When segmenting an image, H is usually used as the segmentation object, and the size of the obtained sub-image is (H / n) × W × 1. The sub-images obtained by this segmentation method may have a total height that exceeds or does not completely cover the height range of the original image after segmentation. This affects the information extraction from the core image and affects the digital cataloging of the core. Summary of the invention
[0005] In order to solve the problem of image segmentation in the process of digital core cataloging, the present invention provides a core image segmentation method, system, device and storage medium.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] A core image segmentation method comprises the following steps:
[0008] Acquire core image data, and extract dimension data of the core image, wherein the dimension data includes a height H of the core image, a width W of the core image, and a number of bands B;
[0009] The core image data is segmented according to the set segmentation segment n and image width factor m of the core image, as well as the height H, width W and band number B of the acquired core image, and the height, width and band number of the n sub-images after segmentation are determined;
[0010] Wherein, when the height H of the core image is divisible by the segmentation segment n, the height of each sub-image is determined to be H / n;
[0011] When the height H of the core image cannot be divided by the segment n, H / n is rounded to obtain the integer value of H / n as round(H / n); the number of sub-image groups and the number of sub-images in each group are determined according to the difference between round(H / n) and H / n; the height of the last sub-image in each group is determined according to round(H / n); the height of the remaining sub-images is round(H / n); the width of each sub-image is round(m / W) and the number of bands is B.
[0012] Preferably, the height of the last sub-image in each group is determined according to round(H / n), specifically:
[0013] In each group except the last one, when round(H / n) is rounded up, the height of the last sub-image is round(H / n)-1; when round(H / n) is rounded down, the height of the last sub-image is round(H / n)+1.
[0014] The height of the last sub-image in the last group is the difference between the height H of the core image and the sum of the heights of the segmented sub-images.
[0015] Preferably, the number of sub-images in each group is specifically:
[0016] Count=int(1 / [(H / n)-round(H / n)]),
[0017] Where Count is the number of sub-images in front of each group of sub-images, the number of sub-images contained in each group of sub-images is Count+1, int() and round() are integer and rounding functions in Python language respectively, H is the height of the read image, and n is the set segment.
[0018] Preferably, the method further includes determining the number of sub-image groups, and the calculation formula for the number of sub-image groups is:
[0019] Group_num=int(n / (count+1))+1,
[0020] In the formula, Group_num is the number of sub-image groups; int() is the rounding function in Python language; n is the set segment; Count is the number of sub-images in front of each group of sub-images.
[0021] Preferably, the core image specifically includes an original color photo, a hyperspectral image or a grayscale image.
[0022] Preferably, it also includes obtaining the depth information of a single core segment in the core image size data, obtaining the depth information of the entire core segment according to the depth information of the single core segment, calculating the depth start and end information of each sub-image segment through a mean algorithm based on the depth information of the entire core segment and the segmentation segment n, outputting the depth start and end information of each sub-image segment, and storing the record in the form of a file name.
[0023] The present invention also provides a core image segmentation system, which specifically comprises:
[0024] The data acquisition module is used to acquire core image data and extract dimension data of the core image, wherein the dimension data includes the height H, the width W and the number of bands B of the core image.
[0025] The segmentation module is used to segment the core image data according to the set segmentation segment n and image width factor m of the core image, as well as the acquired core image height H, core image width W and band number B, and determine the height, width and band number of the n sub-images after segmentation.
[0026] A judgment module, used for determining the height of each sub-image to be H / n when the height H of the core image is divisible by the segmentation segment n;
[0027] When the height H of the core image cannot be divided by the segment n, H / n is rounded to obtain the integer value of H / n as round(H / n); the number of sub-image groups and the number of sub-images in each group are determined according to the difference between round(H / n) and H / n; the height of the last sub-image in each group is determined according to round(H / n); the height of the remaining sub-images is round(H / n); the width of each sub-image is round(m / W) and the number of bands is B.
[0028] The present invention also provides a computer device, comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps described in the core image segmentation method.
[0029] The present invention also provides a computer-readable storage medium, on which a computer program is stored, characterized in that when the computer program is loaded by a processor, it can execute the steps described in the core image segmentation method.
[0030] The core image segmentation method provided by the present invention has the following beneficial effects:
[0031] The present invention obtains core image data and presets the segmentation parameters of the obtained core image, and divides the height of the core image into three states: integer division, rounding up, and rounding down. Different sub-image size results are output according to different states. The segmented sub-images have no overlapping pixels and are close in size, so that the original image data or the extracted results are approximately evenly divided. It also includes obtaining the depth information of a single section of the core in the core image size data, and performing calculations to obtain the depth start and end information of each sub-image, and recording the information in the corresponding sub-image in the form of a file name. The reliability of subsequent information extraction is improved, which is beneficial to the research on the simulation of artificial geological cataloging results and digital cataloging of cores. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiment of the present invention and its design scheme, the following briefly introduces the drawings required for this embodiment. The drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] Figure 1 The present invention is a flowchart of a core image segmentation method according to an embodiment of the present invention.
[0034] Figure 2 This is a schematic diagram of the core image. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the technical solution of the present invention and implement it, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the scope of protection of the present invention.
[0036] Example
[0037] The present invention provides a core image segmentation method, specifically as follows Figure 1 As shown, the specific steps include:
[0038] Step 1: Read the core image.
[0039] Image data reading can be achieved using programming languages such as Python. The image data can be two-dimensional or three-dimensional data, and may include original images (color photos, hyperspectral images) or extracted result images (grayscale images).
[0040] Step 2: Preset the required core image segmentation (n) and image width factor (m).
[0041] The core image (H×W×B) has a height of H, such as Figure 2 As shown, it corresponds to the core extension direction (depth); the width is W, corresponding to the core width; the number of bands is B, and its value is ≥1. When it is 1, the image is a grayscale image, and when it is 3, the image is a color image. The segmentation segment (n) is the number of segments that the original image is to be evenly divided, that is, the number of segments to be divided along the core extension direction; the image width factor (m) is the ratio of the sub-image width to the original image width, and its value is less than or equal to 1. By setting the width factor, the pixels of a certain width in the center of the original image can be intercepted to eliminate the interference pixels at the edge of the core image. Interference pixels refer to the rock debris or core box information at the edge of the core, and their existence affects the final extraction results.
[0042] Step 3, calculation of H / n and round(m / W); using the image size (H×W×B) read in step 1 and the n and m parameters given in step 2, calculate H / n to determine the initial height of the sub-image, and calculate round(m / W) to determine the width of the sub-image, where round() is a rounding function in Python.
[0043] Step 4: Determine the sub-image size.
[0044] Step 4.1, H / n state determination. With the help of the H / n value calculated in step 3, determine whether it is in a state of integer division, rounding up, or rounding down. Rounding up and rounding down are when the value is rounded up, whether it is rounded down (rounding down) or rounded up (rounding up).
[0045] Step 4.2, the combination form of each group of sub-images and the size of the images within the group are preliminarily determined. Determine the sub-image size based on one of the three states of divisibility, rounding up, and rounding down determined in step 4.1. When in the divisibility state, it indicates that the original image can be evenly divided, and the height, width, and number of bands of the sub-image are H / n, round (m / W), and B respectively. In the width direction, the sub-image is in the middle of the original image, that is, the center line of the sub-image in the width direction coincides with the center line of the original image; when in rounding down or rounding up, determine the number of images in each group of sub-images and the size of the sub-images within the group based on the difference between the initial H / n value and its own rounding before and after. The number of images in each group of sub-images refers to the number of sub-images in each group, and the calculation formula is as follows:
[0046] Count=int(1 / [(H / n)-round(H / n)]) (1)
[0047] In formula (1), Count is the number of sub-images in front of each group of sub-images, and the number of sub-images contained in each group of sub-images is Count+1. int() and round() are integer and rounding functions in Python language respectively. H is the height of the image read in step 1, and n is the parameter given in step 2.
[0048] The height, width, and number of bands of the first Count sub-images in each group are round(H / n), round(m / W), and B, respectively. The height, width, and number of bands of the last sub-image in each group are round(H / n)+1 (rounded down) or round(H / n)-1 (rounded up), round(m / W), and B, respectively.
[0049] Step 4.3, the size of the last sub-image in all segmented sub-images is determined. The last sub-image is at the end of the last group of sub-images, and its size is determined based on the size of the original image and the size of the segmented sub-images. The entire image is divided into many groups of sub-images, and the calculation formula for the number of sub-image groups is as follows:
[0050] Group_num=int(n / (count+1))+1 (2)
[0051] In formula (2), Group_num is the number of sub-image groups, int() is the integer function in Python language, n is the parameter given in step 2, and Count is the number of sub-images in front in each group of sub-images.
[0052] The height of the last sub-image is the difference between the height H of the original image and the sum of the heights of all segmented sub-images, the width is round(m / W), and the number of bands is B.
[0053] Step 5: Depth information labeling: Use the mean algorithm to calculate the depth start and end information of each sub-image, and record the information in the file name of the corresponding sub-image in the form of a file name for subsequent core digital cataloging and research.
[0054] The present invention also provides a core image segmentation system, comprising:
[0055] The data acquisition module is used to acquire core image data and extract the size data of the core image, wherein the size data includes the height H of the core image, the width W of the core image and the number of bands B.
[0056] The segmentation module is used to segment the core image data according to the set segmentation segment n and image width factor m of the core image, as well as the acquired core image height H, core image width W and band number B, and determine the height, width and band number of the n sub-images after segmentation.
[0057] The judgment module is used to determine the height of each sub-image as H / n when the height H of the core image is divisible by the segmentation segment n; when the height H of the core image is not divisible by the segmentation segment n, H / n is rounded to an integer, and the rounded value of H / n is round(H / n); the number of sub-image groups and the number of sub-images in each group are determined according to the difference between round(H / n) and H / n; the height of the last sub-image in each group is determined according to round(H / n); the height of the remaining sub-images is round(H / n); the width of each sub-image is round(m / W) and the number of bands is B.
[0058] Each module in the above-mentioned core image segmentation system can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0059] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps in an embodiment of a core image segmentation method. The specific implementation method can be found in the method embodiment, which will not be described in detail here.
[0060] Furthermore, the present invention also provides a non-temporary computer-readable storage medium containing instructions, and a computer program is stored on the storage medium. For example, a memory containing instructions, the above instructions can be executed by a processor of a computer device to complete the above method. For example, a non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. When the computer program is executed by the processor, the steps in an embodiment of a core image segmentation method can be implemented. The specific implementation method can be found in the method embodiment, which will not be repeated here.
[0061] It will be appreciated by those skilled in the art that embodiments of the present invention may provide methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0062] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0063] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0064] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0065] It should be pointed out that the specific implementation methods described above can enable those skilled in the art to understand the invention more comprehensively, but do not limit the invention in any way. Therefore, although the invention has been described in detail in this specification and embodiments, those skilled in the art should understand that the invention can still be modified or replaced by equivalents; and all technical solutions and improvements that do not deviate from the spirit and scope of the invention are included in the protection scope of the patent for the invention. Any figure mark in the claims should not be regarded as limiting the claims involved. Any simple change or equivalent replacement of the technical solution that can be obviously obtained by any technician familiar with the field within the technical scope disclosed in the present invention belongs to the protection scope of the present invention.
Claims
1. A core image segmentation method, characterized in that: The following steps are involved: Acquire core image data, and extract dimension data of the core image, wherein the dimension data includes a height H of the core image, a width W of the core image, and a number of bands B; The core image data is segmented according to the set segmentation segment n and image width factor m of the core image, as well as the height H, width W and band number B of the acquired core image, and the height, width and band number of the n sub-images after segmentation are determined; Wherein, when the height H of the core image is divisible by the segmentation segment n, the height of each sub-image is determined to be H / n; When the height H of the core image cannot be divided by the segment n, H / n is rounded to obtain the integer value of H / n as round(H / n); the number of sub-image groups and the number of sub-images in each group are determined according to the difference between round(H / n) and H / n; the height of the last sub-image in each group is determined according to round(H / n); the height of the remaining sub-images is round(H / n); the width of each sub-image is round(m / W) and the number of bands is B.
2. A core image segmentation method according to claim 1, characterized in that: The height of the last sub-image in each group is determined according to round(H / n), specifically: In each group except the last one, when round(H / n) is rounded up, the height of the last sub-image is round(H / n)-1; when round(H / n) is rounded down, the height of the last sub-image is round(H / n)+1; The height of the last sub-image in the last group is the difference between the height H of the core image and the sum of the heights of the segmented sub-images.
3. A core image segmentation method according to claim 1, characterized in that: The number of sub-images in each group is specifically: Count=int(1 / [(H / n)-round(H / n)]), Where Count is the number of sub-images in front of each group of sub-images, the number of sub-images contained in each group of sub-images is Count+1, int() and round() are integer and rounding functions in Python language respectively, H is the height of the read image, and n is the set segment.
4. A core image segmentation method according to claim 3, characterized in that: The calculation formula of the number of sub-image groups is: Group_num=int(n / (count+1))+1, In the formula, Group_num is the number of sub-image groups; int() is the rounding function in Python language; n is the set segment; Count is the number of sub-images in front of each group of sub-images.
5. A core image segmentation method according to claim 1, characterized in that: The core image specifically includes an original color photo, a hyperspectral image or a grayscale image.
6. A core image segmentation method according to claim 1, characterized in that: It also includes obtaining the depth information of a single core segment in the core image size data, obtaining the depth information of the entire core segment according to the depth information of the single core segment, calculating the depth start and end information of each sub-image segment through a mean algorithm based on the depth information of the entire core segment and the segmentation segment n, outputting the depth start and end information of each sub-image segment, and storing the record in the form of a file name.
7. A core image segmentation system, characterized in that: include: A data acquisition module, used to acquire core image data and extract dimension data of the core image, wherein the dimension data includes a height H of the core image, a width W of the core image and a number of bands B; The segmentation module is used to segment the core image data according to the set segmentation segment n and image width factor m of the core image, as well as the height H, width W and band number B of the core image obtained, and determine the height, width and band number of the n sub-images after segmentation; A judgment module, used for determining the height of each sub-image to be H / n when the height H of the core image is divisible by the segmentation segment n; When the height H of the core image cannot be divided by the segment n, H / n is rounded to obtain the integer value of H / n as round(H / n); the number of sub-image groups and the number of sub-images in each group are determined according to the difference between round(H / n) and H / n; the height of the last sub-image in each group is determined according to round(H / n); the height of the remaining sub-images is round(H / n); the width of each sub-image is round(m / W) and the number of bands is B.
8. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is loaded into a processor, it can execute the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Core sample two-dimensional pore image-based permeability prediction method
CN108133474A
An image feature segmentation method based on a graph convolutional network
CN109934826A
Top-down natural image just noticeable distortion threshold estimation method
CN114519668A
Rock core RQD digital statistical method, equipment and terminal based on image recognition technology
CN115393605A
Three-dimensional finite element simulation method based on high-precision digital core reconstruction model
CN115630543A
