A drilling slag sample identification and statistics method and system based on image recognition and a storage medium

By preprocessing and weighted scoring of the two-dimensional unfolded images of core samples, the problem of inaccurate layer boundaries in core layering technology was solved, achieving high-precision layer identification and digital representation, and improving the accuracy and stability of geological analysis.

CN120976226BActive Publication Date: 2025-12-23HUNAN COMM RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511504871.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2025-12-23
Estimated Expiration
2045-10-21

AI Technical Summary

Technical Problem

Existing core stratification techniques rely on manual observation and simple image processing methods, resulting in inaccurate stratification boundaries, susceptibility to noise interference, and difficulty in achieving high-precision geological analysis and digital representation. This is especially true when geological layers are intersecting, making it difficult to distinguish the true stratigraphic boundaries.

Method used

An image recognition-based method was adopted. The two-dimensional unfolded image of the core sample was preprocessed to calculate the main color feature, color uniformity, texture contrast and edge intensity of each row of pixels. The true layer boundary was screened out by feature vector weighted scoring and local maximum detection, and the layer boundary was optimized by combining the minimum thickness threshold.

Benefits of technology

It significantly improves the accuracy and stability of stratigraphic identification, realizes quantitative statistics and digital expression of stratigraphic structure, and provides a high-quality data foundation for stratigraphic internal structure analysis and core archiving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976226B_ABST
    Figure CN120976226B_ABST
Patent Text Reader

Abstract

The present application relates to geological exploration and core analysis technical field, specifically relates to a kind of drilling residue sample identification statistics method, system and storage medium based on image recognition, the present application is by the two-dimensional development image of core sample is preprocessed, the main color feature of each row of pixel points, color uniformity, texture contrast and edge intensity are as characteristic vector, by characteristic vector weighted score and local maximum detection, filter out real stratification boundary, and realize stratification boundary optimization in combination with minimum thickness threshold, significantly reduce the risk of stratification misjudgment and over-fine segmentation, comprehensively improve the accuracy and stability of stratification discrimination;The present application further associates the physical thickness of each stratification interval with the multidimensional feature vector sequence of all rows in the interval, realizes the quantitative statistics and digital expression of stratum structure, provides high-quality data basis for stratum internal structure analysis and core archiving.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of geological exploration and core analysis, and particularly relates to a drilling residue sample identification and statistics method and system based on image recognition and a storage medium. BACKGROUND

[0002] With the development of digital geological technology, stratification and structure analysis of core samples through image recognition means has become an important way to improve the efficiency and data accuracy of geological exploration. Two-dimensional expansion processing of core images enables complex three-dimensional surface information to be fully collected, analyzed and archived in the form of planar images, greatly facilitating the automated processing of core samples and the digital management of geological information.

[0003] In the prior art, core stratification often relies on manual observation, experience judgment or simple image processing methods, such as direct threshold segmentation of gray scale or single color channel, edge detection algorithm, etc. These methods are easily affected by sample color unevenness, light changes, noise interference, etc. in actual application, resulting in inaccurate stratification boundaries, large stratification thickness statistical errors, and difficulty in achieving comprehensive digital expression of stratigraphic structure. Especially in the case of multiple geological layers intersecting, color or texture changes not being obvious, traditional methods are difficult to effectively distinguish between real stratigraphic boundaries and image noise.

[0004] The main technical problems faced by the prior art include: core sample stratification relies on subjective experience, with low recognition accuracy; stratification boundaries are easily affected by noise and local anomalies, resulting in overly fine stratification or misjudgment; stratification intervals lack effective correlation of multi-feature description and physical thickness, making it difficult to meet the needs of high-precision geological analysis and digital core archive construction.

[0005] In view of the above, there is an urgent need for a drilling residue sample identification and statistics method and system based on image recognition to solve the problems existing in the prior art. SUMMARY

[0006] The present application aims to provide a drilling residue sample identification and statistics method based on image recognition, which aims to solve the deficiencies of existing core stratification technology. The specific technical solutions are as follows:

[0007] A drilling residue sample identification and statistics method based on image recognition, comprising:

[0008] obtaining a two-dimensional expanded image of a cylindrical core sample to be identified, and pre-processing the two-dimensional expanded image to obtain a pre-processed image for feature extraction;

[0009] converting the pre-processed image into a Lab color space to obtain main color feature data and color uniformity data of each row of pixel points; and converting the pre-processed image into a gray scale image to obtain texture contrast and edge intensity of each row of pixel points;

[0010] normalizing the primary color feature data, the color uniformity data, the texture contrast and the edge intensity corresponding to each row of pixel points respectively to obtain a feature vector of each row of pixel points;

[0011] generating a layered boundary score of each row based on the feature vector of each row of pixel points in a weighted summation manner, constructing a layered boundary score sequence by arranging the layered boundary scores of all rows in a row order, and searching for a local maximum point in the layered boundary score sequence to obtain a candidate layered boundary corresponding to the local maximum point;

[0012] calculating a row distance between adjacent candidate layered boundaries, and merging the adjacent candidate layered boundaries with a row distance less than a minimum thickness threshold to obtain a final layered boundary; dividing the two-dimensional expanded image into a plurality of layered intervals according to the final layered boundary, counting a number of pixel rows corresponding to each layered interval, and calculating a physical thickness of each layered interval in combination with a conversion ratio of pixels to actual length;

[0013] counting the feature vector of each row of pixel points in each layered interval, and associating the feature vector with the physical thickness of the corresponding layered interval to complete the layered structure statistics of the core sample.

[0014] Preferably, the preprocessing step comprises:

[0015] counting the original pixel value interval of the R, G and B color channels in the two-dimensional expanded image, mapping the original value of each color channel of each pixel point to a standard target interval [0, 255] respectively to obtain a normalized two-dimensional expanded image;

[0016] performing median filtering on each color channel value of each pixel point in the normalized two-dimensional expanded image to obtain a preprocessed image.

[0017] The median filtering is: taking a single pixel point as the center, extracting the values of the same color channel of each pixel point in the domain window of the center pixel point and sorting the values by size, and selecting the middle value as the new value of the color channel corresponding to the center pixel point.

[0018] Preferably, the primary color feature data of each row of pixel points comprises the mean value of the a channel value and the mean value of the b channel value of the row, and the color uniformity data of each row of pixel points comprises the standard deviation of the a channel value and the standard deviation of the b channel value of the row.

[0019] Preferably, the texture contrast of each row of pixel points is obtained by:

[0020] converting the preprocessed image into a gray-scale image and presetting a plurality of gray-scale levels;

[0021] The number of occurrences of gray level combinations of each pair of adjacent pixels in a single row is counted to form a two-dimensional gray-level co-occurrence matrix; wherein, the rows and columns of the gray-level co-occurrence matrix correspond to different gray levels, and the elements in the gray-level co-occurrence matrix are the frequencies of occurrence of a pair of gray level combinations;

[0022] Divide each element in the gray-level co-occurrence matrix by the total number of adjacent pixel pairs in that row to obtain a probabilistic gray-level co-occurrence matrix;

[0023] For each element in the gray-level co-occurrence matrix, calculate the square of the difference between its row and column indices, multiply it by the value of that element in the probabilistic gray-level co-occurrence matrix, and sum all the results to obtain the texture contrast of the pixels in that row; where the difference between the row and column indices is the difference between the row and column values ​​of the element in the gray-level co-occurrence matrix.

[0024] Preferably, the gradient value of a pixel in the column direction is represented as:

[0025]

[0026] Then the first Edge strength of row pixels Represented as:

[0027]

[0028] in: This represents the convolution operation. For the first line, number The gradient value of a column pixel in the column direction. For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, the first row, the first column pixel point, the gray value of the first column pixel point, and the total column number of pixel points of the two-dimensional expansion image.

[0029] Preferably, the method for generating the hierarchical boundary score of each row of pixel points based on the feature vector of each row of pixel points is as follows:

[0030] The main color feature data, the color uniformity data, the texture contrast, and the edge intensity are respectively matched with weights, and the sum of the weights is equal to 1;

[0031] For the feature vector of the first row of pixel points, the absolute difference values of the normalized main color feature data, the normalized color uniformity data, the normalized texture contrast, and the normalized edge intensity between the first row of pixel points and the next row of pixel points are calculated, and the absolute difference values are multiplied by the corresponding weights;

[0032] The sum of the weighted absolute difference values is taken as the hierarchical boundary score of the first

[0033] Preferably, the first row of pixel points and the last row of pixel points do not calculate the hierarchical boundary score.

[0034] Preferably, if the hierarchical boundary score of the current pixel row is greater than the hierarchical boundary scores of the previous pixel row and the next pixel row, the hierarchical boundary score of the current pixel row is determined as a local maximum point.

[0035] Preferably, the method for determining the final hierarchical boundary is as follows:

[0036] All candidate hierarchical boundaries are sorted by row number, and the absolute difference values of the row numbers between adjacent candidate hierarchical boundaries are calculated in sequence, and a minimum thickness threshold in units of pixel rows is set;

[0037] It is judged whether the difference between the row numbers of two adjacent candidate hierarchical boundaries is less than the minimum thickness threshold, and if it is less than the minimum thickness threshold, the two candidate hierarchical boundaries are classified into one dense hierarchical group; wherein, if there are at least three continuously adjacent candidate hierarchical boundaries, and the absolute difference values between the row numbers of each pair of adjacent candidate hierarchical boundaries are all less than the minimum thickness threshold, these candidate hierarchical boundaries are merged into the same dense hierarchical group;

[0038] For each dense hierarchical group, the candidate hierarchical boundary with the highest hierarchical boundary score value in the group is retained, and the remaining candidate hierarchical boundaries are removed, completing the intra-group merging of the dense hierarchical group;

[0039] The remaining all candidate layered boundaries are determined as final layered boundaries, and the pixel point row corresponding to the largest row number and the pixel point row corresponding to the smallest row number in the two-dimensional unfolded image are also marked as final layered boundaries.

[0040] The application further provides a drilling residue sample identification and statistics system based on image recognition.

[0041] An image acquisition module is configured to acquire a two-dimensional unfolded image of a cylindrical core sample to be identified, and to obtain a pretreatment image for feature extraction by pretreating the two-dimensional unfolded image.

[0042] A feature acquisition module is configured to acquire main color feature data, color uniformity data, texture contrast and edge strength of each row of pixel points, and to normalize the main color feature data, color uniformity data, texture contrast and edge strength corresponding to each row of pixel points respectively to obtain a feature vector of each row of pixel points.

[0043] A layered scoring module is configured to generate a layered boundary score of each row by using a weighted summation method based on the feature vector of each row of pixel points, to form a layered boundary score sequence by arranging the layered boundary scores of all rows in a row order, and to find a local maximum point in the layered boundary score sequence and take the row corresponding to the local maximum point as a candidate layered boundary.

[0044] A thickness evaluation module is configured to calculate a row distance between adjacent candidate layered boundaries, to merge the adjacent candidate layered boundaries with a row distance less than a minimum thickness threshold to obtain a final layered boundary, and to divide the two-dimensional unfolded image into a plurality of layered intervals according to the final layered boundary, to count the number of pixel rows corresponding to each layered interval, and to calculate a physical thickness of each layered interval in combination with a conversion ratio of pixels to actual length.

[0045] A comprehensive statistics module is configured to count the feature vector of each row of pixel points in each layered interval, and to associate the feature vector with the physical thickness of the corresponding layered interval to complete the layered structure statistics of the core sample.

[0046] The application further provides a computer readable storage medium, wherein the storage medium stores a computer program, and the computer program is executed to perform the drilling residue sample identification and statistics method.

[0047] The technical solution of the application has the following beneficial effects:

[0048] The present application significantly reduces the risk of misjudgment of layering and over-fine segmentation by pre-processing the two-dimensional expanded image of the core sample, calculating the main color features, color uniformity, texture contrast and edge strength of each row of pixel points, screening out the real layering boundary through feature vector weighted scoring and local maximum value detection, and realizing layering boundary optimization combined with the minimum thickness threshold.

[0049] The present application associates the physical thickness of each layering interval with the multi-dimensional feature vector sequence of all rows in the interval, realizes quantitative statistics and digital expression of the stratum structure, and provides a high-quality data basis for internal structure analysis of the stratum and core archiving.

[0050] In addition to the purposes, features and advantages described above, the present application has other purposes, features and advantages. The present application will be further described below with reference to the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0051] The accompanying drawings, which form a part of this application, are included to provide a further understanding of the application, illustrate the preferred embodiments of the application and assist in the explanation of the application. In the drawings:

[0052] Figure 1 is a flow chart of the drilling residue sample identification and statistical method of the present application based on image recognition;

[0053] Figure 2 is a structural schematic diagram of the core sample in the present application;

[0054] Figure 3 is a pixel point distribution schematic diagram of the two-dimensional expanded image in the present application;

[0055] Figure 4 is a schematic diagram of the two-dimensional expanded image in the Lab color space, wherein (a) is a schematic diagram of the two-dimensional expanded image in the L channel of the Lab color space, (b) is a schematic diagram of the two-dimensional expanded image in the a channel of the Lab color space, and (c) is a schematic diagram of the two-dimensional expanded image in the b channel of the Lab color space;

[0056] Figure 5 is a module structure block diagram of the drilling residue sample identification and statistical system of the present application. DETAILED DESCRIPTION

[0057] In order to facilitate the understanding of the present application, the present application will be described more fully below, and a preferred embodiment of the present application will be given. However, the present application can be realized in many different forms, and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing particular embodiments only and is not intended to be limiting of the application.

[0059] Embodiment:

[0060] Referring to Figure 1 , the embodiment provides a drilling residue sample identification and statistics method based on image recognition, and specifically comprises:

[0061] S1: obtaining a two-dimensional unfolded image of a cylindrical core sample to be identified, and pre-processing the two-dimensional unfolded image to obtain a pre-processed image for feature extraction;

[0062] The drilling residue sample in the embodiment generally refers to a formation sample obtained through drilling, i.e., a complete cylindrical core sample obtained through drilling, as shown in Figure 2 The cylindrical core sample can reflect the natural structure and bedding characteristics of the formation more completely and continuously, and is suitable for automatic layering and structure statistics through image recognition, and when obtaining a two-dimensional unfolded image, a rotating scanning mode can be used to comprehensively collect the core surface, the core sample is rotated at a constant speed around its own axis, a surface image is collected every time the core sample is rotated by the same angle, and after the core sample is rotated by 360 degrees, a plurality of core surface images collected are spliced according to the shooting order and the known rotation direction, and the spliced cylindrical surface image is mapped into a two-dimensional unfolded image through transformation.

[0063] As shown in Figure 2 and Figure 3 , the two-dimensional unfolded image of the core sample is a planar and rectangular digital image formed by image collection and splicing of the entire cylindrical surface of the core sample, the outer surface of the cylindrical core sample is essentially a three-dimensional curved surface, and the two-dimensional unfolded image is a digital image that is convenient for observation, analysis and processing, which is obtained by completely unfolding the information of the curved surface onto a rectangular plane through mathematical and image processing methods, like peeling off the label of a pop can, the two-dimensional unfolded image corresponds to the complete unfolding of the core circumference in the horizontal direction and the axial height of the core sample in the vertical direction.

[0064] The pixel points of each row of the two-dimensional unfolded image correspond to a height position on the core axis in turn, that is, each row of pixels in the two-dimensional unfolded image from top to bottom corresponds to a position of the core sample from the top end to the bottom end in turn, the pixel points of each column correspond to various angles on the core circumference in turn, that is, each column of pixels in the unfolded image from left to right corresponds to the points on the circumference of the core sample in turn, each column of pixels in the horizontal direction of the two-dimensional unfolded image represents the length of the core sample cylindrical surface around a whole circle, that is, if the circumference of the core is unfolded to be 10 centimeters, then each column of pixels of the image corresponds to different positions on the 10 centimeter circumference respectively, in this way, the information of a whole circle of the core surface is tiled on the horizontal direction of the image, each row of pixels in the vertical direction of the two-dimensional unfolded image represents the actual position of the core sample along the length direction (i.e. height direction) of the core sample, that is, the longer the core, the more the vertical pixels of the image, and each row of pixels corresponds to a specific height or depth position on the core. Specifically, the total number of rows of the two-dimensional unfolded image in the embodiment is denoted as , and the total number of columns is denoted as .

[0065] Further, the preprocessing step includes:

[0066] For the two-dimensional unfolded image, the minimum and maximum values of the pixel values of the R, G and B color channels are counted respectively to determine the original pixel value interval of each color channel, and a linear stretching method is used to map the original pixel value interval of each color channel to the standard target interval [0, 255] respectively, so that the RGB values of all pixel points are adjusted to a unified target interval, and a normalized two-dimensional unfolded image is obtained.

[0067] Taking the R color channel as an example, in all pixel points of the two-dimensional unfolded image, the maximum and minimum values of the R color channel are respectively denoted as and , the original value of the R color channel of the pixel point in the th row and the th column of the two-dimensional unfolded image is , and a linear stretching method is used to map the original value of the R color channel to the standard target interval [0, 255] according to the formula:

[0068]

[0069] the original value of the R color channel of the pixel point in the th row and the The column pixel points are mapped to the R color channel value of the standard target interval [0, 255] by using a linear stretching method, and the values of the G and B color channels are mapped to the standard target interval [0, 255] by using the same method. After the original values of the R, G and B color channels of all the pixel points are processed by using the above method, a normalized two-dimensional unfolded image is obtained.

[0070] The minimum value and the maximum value of each channel pixel value in the entire image are counted for the red (R), green (G) and blue (B) color channels respectively, so that the actual distribution range of the original pixel value of each channel can be determined. The original pixel value interval of each channel is mapped to the standard target interval [0, 255] by linear stretching. In this way, the pixel values originally distributed in different ranges are uniformly stretched to the standard target interval, the overall contrast of the image is enhanced, the RGB values of all the pixel points are adjusted to the standardized interval, a normalized two-dimensional unfolded image is obtained, which is beneficial to eliminate the brightness and color differences caused by the samples and the shooting environment, and improve the accuracy and universality of subsequent image analysis.

[0071] For the normalized two-dimensional unfolded image, the same-channel pixel values of the neighbor nodes of each pixel point are extracted, these pixel values are sorted according to the size, and the middle value is selected as the new value of the pixel point (i.e. the center pixel point). All the pixel points of the entire image are traversed, and the R, G and B channels are processed independently to obtain a preprocessed image. The specific method is as follows:

[0072] A neighborhood window of a fixed range is determined with the current pixel point as the center, for example, a common 3*3 or 5*5 region. The neighborhood window is actually a set of pixel points around the current pixel point, including itself and the adjacent pixel points above, below, left and right, for example, a 3*3 neighborhood includes the current pixel and the pixel points above, below, left and right and the four diagonal pixels, a total of nine pixel points.

[0073] When performing median filtering, only a single color channel is processed, for example, the red values of all the pixels in the neighborhood window are extracted in the red channel to form a one-dimensional numerical array, then the numerical array is sorted in ascending order, and the numerical value in the middle of the sorting result is selected as the median value. Subsequently, the original numerical value of the red channel of the current pixel point is replaced by the median value. After the red channel is processed, the green and blue channels are also independently completed by using the same method. The purpose of this is to maximize the retention of important structures such as image edges, while effectively removing isolated noise points in the image.

[0074] For edges and corners of the normalized 2D unfolded image, the neighborhood window may exceed the actual range of the image. In this case, a boundary padding method is used to virtually fill in the pixel values ​​that do not exist outside the image edge by mirroring, copying, or specifying a constant. This ensures that pixels at the edges and corners can also participate in the median filtering operation and will not be missed due to insufficient neighborhood pixels. The entire median filtering process needs to traverse all pixels of the entire image and perform the above operation on the red, green, and blue channels for each pixel. Finally, a preprocessed image with lower noise, clearer details, and suitable for subsequent analysis is obtained.

[0075] Color normalization can stretch the pixel values ​​of images under different acquisition conditions to a uniform standard range, so that the same type of core sample can present consistent color and brightness in images taken by different batches or different devices. Median filtering is a non-linear smoothing method that can effectively remove salt-and-pepper noise and isolated outliers while better preserving key geological structural details such as edges, bedding, and fractures of the image, providing good input data for subsequent automatic stratification, feature extraction, and intelligent recognition.

[0076] S2: Convert the preprocessed image to Lab color space, obtain the main color feature data and color uniformity data of each row of pixels; convert the preprocessed image to grayscale image, obtain the texture contrast and edge intensity of each row of pixels;

[0077] Specifically, when converting a preprocessed image to the Lab color space, the RGB pixel values ​​are first normalized to 0 to 1 for linearization. Then, the RGB values ​​are converted to the XYZ space according to the standard formula. Finally, the XYZ space is converted to the L, a, and b components using the CIE Lab transformation formula, thus obtaining an image in the Lab color space. Figure 4 As shown, this is a conventional technical method in this field and will not be elaborated upon here. CIELab is a color model proposed by the International Commission on Illumination (CIE) in 1976.

[0078] Specifically, the primary color feature data for each row of pixels includes the mean value of the a-channel and the mean value of the b-channel in that row, and the color uniformity data includes the standard deviation of the a-channel and the standard deviation of the b-channel in that row.

[0079] In this embodiment, the specific method for calculating the mean and standard deviation of the a and b channels of each row of pixels is as follows:

[0080] For the preprocessed image converted to Lab color space, each row of pixels is processed sequentially according to the row order. For the current row of pixels, the values ​​of the a channel and b channel of all pixels in that row are read sequentially.

[0081] Add the a-channel values ​​of all pixels in the row to get the total a-channel value. Divide the total a-channel value by the number of pixels in the row to get the average a-channel value of the pixels in the row. Add the b-channel values ​​of all pixels in the row to get the total b-channel value. Divide the total b-channel value by the number of pixels in the row to get the average b-channel value of the pixels in the row.

[0082] For the a-channel value of each pixel in the row, subtract the mean a-channel value of the row to obtain the difference between the a-channel value and the mean a-channel value. Sum the squares of all the differences, divide by the number of pixels in the row, and take the square root of the result to obtain the standard deviation of the a-channel of the pixels in the row.

[0083] For each pixel in the row, subtract the mean value of the b channel from the mean value of the b channel in that row to obtain the difference between the two values. Sum the squares of all the differences, divide by the number of pixels in the row, and take the square root of the result to obtain the standard deviation of the b channel of the pixels in that row.

[0084] For example, in a preprocessed image converted to the Lab color space, the first... Total number of rows of pixels The pixel, the line, number The values ​​of the a and b channels of the column pixels are respectively and , No. The formula for calculating the mean values ​​of the a and b channels of a row of pixels is as follows:

[0085]

[0086]

[0087] in, Indicates the first The mean value of channel a of row pixels. Indicates the first The mean value of the b channel of each row pixel.

[0088] Furthermore, to obtain the first The formula used to determine the standard deviations of the a and b channels of a row of pixels is:

[0089]

[0090]

[0091] in, Indicates the first The standard deviation of the a channel of row pixels. Indicates the first Standard deviation of the b-channel of a row of pixels.

[0092] Specifically, in the Lab color space, the a and b channels represent the color distribution in the green-red and blue-yellow directions, respectively. Analyzing the mean and standard deviation of each row of pixels effectively reflects the dominant color tendency and its degree of variation. The mean describes the overall dominant color of the row of pixels, reflecting the average color shift in the a and b color directions. The standard deviation measures the dispersion of the color distribution of the row of pixels, i.e., the color uniformity. If the standard deviation is small, it means that the colors of the pixels in the row are relatively consistent in the corresponding channels, and the color distribution is relatively uniform. If the standard deviation is large, it means that there are obvious color variations or mixing in the colors of the pixels in the row. Calculating the mean and standard deviation of the a and b channels of each row of pixels can compress the complex two-dimensional color distribution information into the dominant color and color uniformity characteristics of each row through simple statistics, thereby reducing the computational complexity of subsequent analysis and processing.

[0093] Preferably, obtaining the texture contrast of each row of pixels specifically involves:

[0094] Furthermore, the preprocessed image is converted into a grayscale image. For each row of pixels, the grayscale values ​​of all pixels in that row are read. Multiple grayscale levels are preset, and each pixel in that row is normalized to its corresponding grayscale level based on its grayscale value. Converting the preprocessed image into a grayscale image is essentially image grayscale conversion. The formula used for converting the preprocessed image into a grayscale image is:

[0095]

[0096] in, Represents the grayscale image. Line number The grayscale values ​​of the column pixels, Indicates the first image in the preprocessed image Line number The R color value of a column pixel in the RGB color channel. Indicates the first image in the preprocessed image Line number The G color value of a column pixel in the RGB color channel. Indicates the first image in the preprocessed image Line number The B color value of a column pixel in the RGB color channel.

[0097] Specifically, the number of gray levels can be set according to requirements, and each gray value is mapped to a corresponding gray level according to an interval. For example, the range of gray values is [0, 255], and the number of gray levels is set to 8 levels. Then, the gray value of each pixel in the row is mapped to a gray level according to an interval. For example, the gray value of a pixel in the row after graying is 26, and the pixel is normalized to the gray level of the 0th level according to the gray value.

[0098] The number of times that each pair of adjacent pixels in the row of pixels appears is counted in sequence, and a two-dimensional gray co-occurrence matrix is constructed. The rows and columns of the gray co-occurrence matrix correspond to different gray levels, and the elements in the matrix are the frequencies of the occurrence of a pair of gray level combinations.

[0099] Each element in the gray co-occurrence matrix is divided by the total number of pairs of adjacent pixels in the row to obtain a probability-type gray co-occurrence matrix.

[0100] For each element in the gray co-occurrence matrix, the square of the difference between the row and column indices is calculated, and the result is multiplied by the value of the element in the probability-type gray co-occurrence matrix. The sum of all results is obtained to obtain the texture contrast of the row of pixels.

[0101] The texture contrast of each row of pixels in the two-dimensional expanded image is obtained by traversing each row of pixels in the two-dimensional expanded image.

[0102] Specifically, it is assumed that the gray values of a row of pixels have been mapped to gray levels. Now, all the pixel points in the row are sequentially viewed from left to right. For each pair of adjacent pixels (i.e., the first column and the second column pixel), first, to which two gray levels do they respectively belong? It is assumed that a row of pixels after gray level mapping is [2, 3, 3, 1, 2], and the gray levels are [2, 3, 3, 1, 2]. The row has 5 pixel points, and there are 4 pairs of adjacent pixels. The gray levels of the first and second pixel points are 2 and 3, respectively, and the corresponding combination is (2, 3). The gray levels of the second and third pixel points are 3 and 3, respectively, and the corresponding combination is (3, 3). The gray levels of the third and fourth pixel points are 3 and 1, respectively, and the corresponding combination is (3, 1). The gray levels of the fourth and fifth pixel points are 1 and 2, respectively, and the corresponding combination is (1, 2).

[0103] The number of times that each combination appears is counted, such as (2, 3) appearing 1 time, (3, 3) appearing 1 time, (3, 1) appearing 1 time, and (1, 2) appearing 1 time. The combinations such as (0, 0), (0, 1), and (2, 2) do not appear, and the number of times is 0.

[0104] This statistical process is filled into the gray co-occurrence matrix. It is assumed that an element in the gray co-occurrence matrix is which means the number of times that the combination of the previous pixel gray level is 3 and the next pixel gray level is 3 appears in all the adjacent pixel pairs in the row is ; that is, statistics of which two gray levels each pair of adjacent pixels in the row is in, and then count how many times each combination appears.

[0105] Specifically, for a row of pixels, first, statistics of the number of times each pair of adjacent pixels is in which two gray levels, and then divide by the total number of adjacent pixel pairs to obtain the probability of each gray level combination appearing in the row, and these probabilities form the probability gray level co-occurrence matrix. Each element of the probability gray level co-occurrence matrix represents the probability of the combination of the gray level of the th pixel and the gray level of the th pixel appearing in the entire row; for each element in the gray level co-occurrence matrix (i.e., each gray level combination), we calculate the square of the difference between its row index and column index, where the row index and column index are the row and column values in the gray level co-occurrence matrix, which reflects how large the difference between the two adjacent pixel gray levels is, and then multiply this square value by the value of the element in the probability gray level co-occurrence matrix to represent the weighted degree of the occurrence of this gray level difference in the entire row.

[0106] Add up the weighted results of all gray level combinations to obtain the texture contrast of the row. The larger this value is, the more intense the gray level change of the row of pixels is, and the richer the texture is; the smaller the value is, the more gentle the gray level change is, and the more single the texture is; calculate each row of the image according to the above method to obtain the texture contrast distribution of each row of the image. In this way, the texture change characteristics of the image at different positions can be analyzed, and useful feature information can be provided for subsequent image analysis, recognition or segmentation tasks.

[0107] Taking the row of pixels [2, 3, 3, 1, 2] in the previous example as an example, statistics of the gray level combination of adjacent pixels, construction of the gray level co-occurrence matrix, and conversion into a probability matrix, for each gray level combination that appears, such as (3, 1), its probability is 0.25, and the square of the difference between its row index and column index is 4, so its contribution to the texture contrast is 1, and after all the combinations are calculated in this way, the texture contrast of the row is obtained. The core of the whole process is to reflect the gray level change intensity of a row of pixels by statistics of the difference between the gray levels of adjacent pixels and their occurrence probability, and the high and low of the texture contrast, which directly reflects the texture richness of the row of pixels. This method is convenient for describing and analyzing the texture structure of the image.

[0108] In this embodiment, the Sobel operator is used to extract the gradient change of each row of pixels in the column direction and calculate the edge strength of the row of pixels according to the gradient change, which is specifically:

[0109] The preprocessed image is converted into a grayscale image. For each pixel, the grayscale value of each pixel in its 3×3 neighborhood is multiplied by the element in the convolution kernel of the Sobel vertical operator and the sum is obtained to obtain the gradient value of the pixel in the column direction. All pixels in the grayscale image are traversed to obtain the gradient value of each pixel in the preprocessed image. For each row of pixels in the preprocessed image, the absolute values ​​of the gradients of all pixels in the row are accumulated, and the accumulated value is used as the edge intensity of the pixel in that row.

[0110] For the first in the preprocessed image Line number A column of pixels, and its 3×3 neighborhood refers to the area around the pixel. The image is surrounded by a 3x3 grid of 9 pixels, including the pixel itself. The 3x3 neighborhood of the edge pixels extends beyond the image boundaries; these out-of-range pixels are treated as having a grayscale value of 0. The Sobel vertical operator's convolution kernel... for:

[0111]

[0112] The formula used to obtain the gradient value of this pixel in the column direction is:

[0113]

[0114] in: This represents the convolution operation. For the first line, number The gradient value of a column pixel in the column direction. For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale value of each column pixel.

[0115] Furthermore, for each row, the absolute values ​​of the gradients of all pixels in that row are summed to obtain the edge strength of that row, based on the following formula:

[0116]

[0117] Indicates the first The edge strength of a row of pixels is calculated using the Sobel operator to obtain the column direction gradient value of each pixel. For each row, from the first column to the last column, the gradient value of each pixel in that row is taken sequentially, the absolute value is taken first, and then the values ​​are accumulated. The accumulated result is the edge strength of that row, which is a number representing the overall edge strength of that row. After accumulating the absolute values, it can reflect both the number of edges and the edge strength, and is often used as one of the features in image analysis.

[0118] S3: Normalize the main color feature data, color uniformity data, texture contrast and edge intensity corresponding to each row of pixels to obtain the feature vector of each row of pixels.

[0119] For each row of pixels in the 2D unfolded image, the dominant color feature data, color uniformity data, texture contrast, and edge intensity of that row are extracted sequentially. For each type of feature data (dominant color feature data, color uniformity data, texture contrast, and edge intensity), the maximum and minimum values ​​of that type of feature data in all rows are calculated. Then, the min-max normalization method is used to subtract the minimum value of that type of feature data in all rows from the value of each type of feature data, and then divide by the difference between the maximum and minimum values, so that the normalized results all fall within the range of 0 to 1. This completes the normalization of the dominant color feature data, color uniformity data, texture contrast, and edge intensity corresponding to each row of pixels; that is, the feature vector of each row is composed of the normalized dominant color feature data, color uniformity data, texture contrast, and edge intensity.

[0120] For each row of pixels in the image, the main color feature data, color uniformity data, texture contrast, and edge strength are obtained sequentially through statistical analysis and extraction. Each row of pixels will yield six raw feature values: mean of channel a, mean of channel b, standard deviation of channel a, standard deviation of channel b, texture contrast, and edge strength.

[0121] The maximum value and the minimum value in all rows are counted for each type of feature data. For example, the a channel mean value: find the maximum a channel mean value and the minimum a channel mean value in all rows; the b channel mean value, the a channel standard deviation, the b channel standard deviation, the texture contrast, and the edge intensity are the same; for each item of feature data in each row, the minimum-maximum normalization method is used to process, that is, the original feature value of the row is subtracted by the minimum value of the item of feature data in all rows, and then divided by the difference between the maximum value and the minimum value of the item of feature data in all rows, and the normalized result is between 0 and 1. The normalized a channel mean value, the b channel mean value, the a channel standard deviation, the b channel standard deviation, the texture contrast, and the edge intensity are combined into a six-dimensional feature vector, which is used as the feature description of the row of pixels.

[0122] In the embodiment, not only the main color feature data are extracted, but also the color uniformity data, the texture contrast, and the edge intensity and other information are included, which can comprehensively reflect the characteristics of each row of pixels from multiple angles, avoid the limitation of single feature description, make all feature data in the same numerical interval by using the minimum-maximum normalization, eliminate the influence of the dimension and scale difference between different features, and facilitate subsequent feature comparison, weight allocation, and algorithm processing. Through the normalization processing, the feature difference between different categories or regions can be enhanced.

[0123] S4: A layered boundary score of each row is generated by using a weighted summation method based on the feature vector of each row of pixels, the layered boundary scores of all rows are arranged in a sequence according to the row order, a local maximum value point is found in the layered boundary score sequence, and the row corresponding to the local maximum value point is taken as a candidate layered boundary.

[0124] The layered boundary score is generated by using the weighted summation of the feature vector of each row of pixels, and the candidate layered boundary is automatically screened through the local maximum value detection, which can fully integrate the main color feature, the color uniformity, the texture contrast, and the edge intensity and other image features, and flexibly adjust the contribution of each type of feature to the boundary judgment through the weight parameter, so that different types of geological layer boundaries can be covered, and various complex actual situations of core images can be adapted.

[0125] In the embodiment, the weighted summation and the absolute difference are combined, so that the layered score is sensitive to local changes. Any significant color, texture, or structure mutation can be captured in time and reflected as a clear peak in the score sequence. By detecting the local maximum value point, the potential interlayer boundary can be automatically located, the layered boundary score sequence is a quantitative expression of the layered tendency of each row of the image, which is convenient for subsequent further analysis, optimization, and batch processing, and the local maximum value screening can effectively filter out the tiny and meaningless interference.

[0126] In this embodiment, the method for generating the hierarchical boundary score of each row of pixel points based on the feature vector of each row of pixel points is as follows:

[0127] The contribution of the main color feature data, the color uniformity data, the texture contrast, and the edge intensity to the hierarchical boundary is analyzed, and the weights of the main color feature data, the color uniformity data, the texture contrast, and the edge intensity are allocated.

[0128] For the feature vector of each row (i.e., the i-th row) of pixel points, the absolute difference values of the main color feature data, the color uniformity data, the texture contrast, and the edge intensity between the i-th row of pixel points and the next row (i.e., the (i+1)-th row) of pixel points are calculated, and the absolute difference values are multiplied by the corresponding weights. The sum of the weighted results of the absolute difference values is calculated, and is marked as the hierarchical boundary score of the row of pixel points. The first row of pixel points and the last row of pixel points do not calculate the hierarchical boundary score.

[0129] In this embodiment, the hierarchical boundary score of each row of pixel points is used to quantify whether the row is at the position of the boundary of different geological layers. The color, uniformity, texture, and edge of the image at the position of the boundary of different geological layers often change abruptly, so the possible boundary points can be determined by detecting the amplitude of the change of the features between adjacent rows. For each row of pixel points, the feature vector composed of the normalized values of the main color feature data, the color uniformity data, the texture contrast, and the edge intensity has been obtained. Considering that the importance of these features in the hierarchical judgment is different, the weights of the features are allocated in advance. The higher the weight, the greater the contribution of the feature to the hierarchical boundary.

[0130] For the feature vectors of each row and the next row, the absolute difference values of the features are calculated. The absolute difference values reflect the amplitude of the change of the features between adjacent rows. Then, the absolute difference values of each feature are multiplied by the corresponding weights. The results of all the weighted calculations are added to obtain the hierarchical boundary score of the row. The higher the hierarchical boundary score, the more obvious the change of the features between the row and the next row, and the more likely the row is at the position of the boundary of different geological layers. The first row of the image does not have the previous row, and the last row of the image does not have the next row, so the first row and the last row of the image do not participate in the calculation of the hierarchical boundary score. This embodiment comprehensively considers multiple image features to avoid misjudgment caused by a single feature, and adjusts the influence of different features flexibly through the weighting mechanism.

[0131]

[0132] The hierarchical boundary generally corresponds to the position of the mutation of the image features. By calculating the difference values of adjacent rows in the multi-dimensional feature space, these mutation points can be captured sensitively. The weighting processing enables the algorithm to adjust the sensitivity to different features flexibly according to the actual requirements, so as to adapt to different geological conditions or image quality. ​​

[0133] Specifically, the formula for calculating the layer boundary score of a row of pixel points is:

[0134]

[0135] wherein, and , is the total number of rows of pixel points of the two-dimensional expanded image, represents the layer boundary score of the i-th row of pixel points, represents the average value of the a channel of the i-th row of pixel points after normalization processing, represents the average value of the a channel of the i-th row of pixel points after normalization processing, represents the average value of the b channel of the i-th row of pixel points after normalization processing, represents the average value of the b channel of the i-th row of pixel points after normalization processing, represents the standard deviation of the a channel of the i-th row of pixel points after normalization processing, represents the standard deviation of the a channel of the i-th row of pixel points after normalization processing, represents the standard deviation of the b channel of the i-th row of pixel points after normalization processing, represents the standard deviation of the b channel of the i-th row of pixel points after normalization processing, represents the texture contrast of the i-th row of pixel points after normalization processing, represents the texture contrast of the i-th row of pixel points after normalization processing, represents the edge strength of the i-th row of pixel points after normalization processing, represents the edge strength of the i-th row of pixel points after normalization processing, represents the weight coefficient of the primary color feature data, represents the weight coefficient of the color uniformity data, represents the weight coefficient of the texture contrast, represents the weight coefficient of the edge strength, . .

[0136] ​​​​​​​​​​​​In a specific embodiment, since the stratification boundary tends to be manifested as a color mutation, a change in texture structure and an enhancement of the edge, different features contribute differently to the determination of the boundary, and the weight distribution should fully consider the geological reality, image feature expression and identification target. In most geological core images, different strata often show obvious changes in the main color (such as from gray to yellow, from red to green, etc.), and the main color feature data are often the most intuitive indicators of the boundary. Therefore, the main color feature data are usually assigned a high weight, set between 0.3 and 0.5; the interlayer boundary not only has a color mutation, but also has a significant change in the uniformity of color distribution. For example, the color inside the rock layer is relatively uniform, the color at the boundary is mixed or impurities appear, and the color uniformity data are generally assigned a medium weight, set between 0.15 and 0.25.

[0137] The geological layer boundary is often accompanied by changes in rock structure and texture, and the texture contrast can sensitively reflect these structural changes, which is an important auxiliary feature of stratification. The texture contrast weight is recommended to be close to or slightly lower than the main color feature data, set between 0.2 and 0.3; obvious edge enhancement often appears at the boundary, but not all boundaries show strong edges, and some interference may also produce high edge values. The edge strength is suitable for assigning a medium to low weight, set between 0.1 and 0.25; in summary, the sum of all weights should be 1, and the actual weight can be dynamically adjusted according to the sample type, actual effect and experience data.

[0138] The essence of weight distribution is to reflect the relative importance of different features in stratification determination. The main color feature data are the most intuitive and stable in most core stratifications, so they are preferentially assigned a high weight. The texture contrast and color uniformity can supplement the layer boundary that is difficult to distinguish by color and improve the stratification accuracy. Although the edge strength can highlight the boundary in many cases, it is also easily disturbed by noise and non-geological factors, so the weight should not be set too high. By reasonably distributing the weights, the stratification boundary score can be more robust.

[0139] Further, in the stratification boundary score sequence, a local maximum point is found, and the corresponding row is taken as a candidate stratification boundary. The stratification boundary score of the current row is compared with the stratification boundary scores of the previous row and the next row, respectively. If the stratification boundary score of the current row is greater than the stratification boundary scores of the previous row and the next row, the stratification boundary score of the row is determined as a local maximum point, and the row is taken as a candidate stratification boundary. In this way, all candidate stratification boundaries are determined, and the rows corresponding to the first sequence data and the last sequence data in the stratification boundary score sequence do not participate in the screening of the candidate stratification boundaries.

[0140] In the automatic layering process, each row is given a layering boundary score, which quantifies the overall change of the row and the next row in the features of dominant color, color uniformity, texture contrast and edge strength, etc. The layering boundary scores of all rows are arranged in order of row to form a one-dimensional layering boundary score sequence. In the sequence, each non-first and non-last layering boundary score is compared with the layering boundary scores of the previous row and the next row, respectively. If the score of the current row is greater than the score of the previous row and at the same time greater than the score of the next row, the current score is a local maximum point. Specifically, in this embodiment, only the local maximum points are determined as candidate layering boundaries, and the remaining positions are not considered. The first and last scores are not involved in the maximum value determination because they lack comparison objects before and after.

[0141] The essence of geological layering lies in the mutation or sharp change of interlayer properties. The local maximum points of the layering boundary score sequence accurately reflect the mutation between adjacent layers. The difference between the current layer and the upper and lower layers is most prominent and most likely to correspond to the actual geological boundary. There may be many false boundaries in the layering boundary score sequence due to slight noise or small-scale disturbance. By retaining only the local maximum points, the small fluctuations of the layering boundary score can be effectively filtered out, only the most prominent change points in a certain range are concerned, and the false detection probability is reduced. The layering boundary scores of the first and last rows of the image often do not have complete context information, and directly participating in the maximum value determination may easily cause edge effects and misjudgment. Therefore, the first and last rows are not involved in the candidate layering boundary screening.

[0142] S5: Calculate the row distance between adjacent candidate layering boundaries, and merge the adjacent candidate layering boundaries with a row distance less than the minimum thickness threshold to obtain the final layering boundary. Divide the two-dimensional expanded image into a plurality of layering intervals according to the final layering boundary, count the number of pixel rows corresponding to each layering interval, and calculate the physical thickness of each layering interval in combination with the conversion ratio of pixels to actual length.

[0143] In the last stage, a series of candidate layering boundaries have been determined. These candidate layering boundaries are arranged in order of row number. First, the distance between each pair of adjacent candidate layering boundaries, i.e. the absolute difference of row numbers, needs to be calculated. The row distance reflects the pixel thickness of adjacent layering intervals. The purpose of this is to determine whether the layering interval is thick enough for subsequent merging operations. If the row distance is too small, it may be a false boundary caused by image details or noise, or dense layering occurs, which needs to be further optimized.

[0144] A minimum thickness threshold is set, and all adjacent candidate layering boundaries are traversed. If the row distance between two adjacent candidate layering boundaries is less than the threshold, it is considered that the two candidate layering boundaries are too dense, which may lead to layering too fine or no actual geological significance. At this time, these adjacent candidate layering boundaries are grouped into a dense layering group, and the layering boundary with the highest score is retained in the group, and the other redundant layering boundaries are removed. This can effectively remove the redundant boundaries caused by noise or small structural changes, ensure that the thickness of each layering interval is not less than the actual geological requirement, and improve the scientificity and practicality of the layering structure.

[0145] The above-mentioned dense layering group division and merging is repeated for all candidate layering boundaries until the row distance between all adjacent layering boundaries is not less than the minimum thickness threshold. Finally, all remaining candidate layering boundaries are the final layering boundaries. To ensure interval integrity, the first and last rows of the two-dimensional expanded image are also marked as the final layering boundaries. Recursive merging ensures stable results and does not miss dense layering due to single merging. Retaining the first and last layering boundaries ensures the integrity of the statistical interval, which is beneficial to subsequent interval thickness statistics.

[0146] Further, the logic for determining the final layering boundary is as follows:

[0147] All candidate layering boundaries are sorted in descending order of row number, and the absolute difference between adjacent candidate layering boundaries is calculated. A minimum thickness threshold is set in units of pixel rows. First, sort the row numbers of all candidate layering boundaries for subsequent comparison and processing. The purpose is to find out which candidate layering boundaries have a particularly small distance, so that dense layering can be identified.

[0148] Determine whether the difference between the row numbers of two adjacent candidate layering boundaries is less than the minimum thickness threshold. If it is less than the minimum thickness threshold, the two candidate layering boundaries are grouped into a dense layering group. If there are at least three consecutive adjacent candidate layering boundaries, and the absolute difference between the row numbers of each pair of adjacent candidate layering boundaries is less than the minimum thickness threshold, then these candidate layering boundaries are merged into the same dense layering group.

[0149] For each dense layering group, the candidate layering boundary with the highest layering boundary score in the group is retained, and the remaining candidate layering boundaries are removed, completing the merging within the dense layering group. That is, for each dense layering group, the one with the highest layering boundary score is selected as the representative, and it is considered to be the most likely true boundary, and the other boundaries are discarded.

[0150] The dense hierarchical group division and intra-group merging are repeated for all candidate hierarchical boundaries until the row numbers between all adjacent candidate hierarchical boundaries are all not less than the minimum thickness threshold, all remaining candidate hierarchical boundaries are determined as final hierarchical boundaries, and the pixel point row corresponding to the largest row number and the pixel point row corresponding to the smallest row number in the two-dimensional expanded image are also marked as final hierarchical boundaries.

[0151] Adjacent candidate hierarchical boundaries refer to: among all candidate hierarchical boundaries, after sorting according to the row numbers in the two-dimensional expanded image, i.e. from large to small or from small to large, the two adjacent hierarchical boundaries in the sequence, for example, if the row numbers of the candidate hierarchical boundaries are [100, 150, 200, 310], then (100, 150), (150, 200), (200, 310) are three adjacent groups of hierarchical boundaries; the minimum thickness threshold refers to: a minimum hierarchical thickness (in units of pixel rows) artificially set in geology or image analysis. If the row distance between two candidate hierarchical boundaries is less than this threshold, it is considered that they are too dense (i.e. the hierarchical is too fine or may be noise) and need to be merged. This threshold can be set according to actual geological experience, core resolution, required minimum recognized layer thickness, etc. For example, if 1 pixel represents 0.5 mm, the minimum thickness threshold can be set to 10 pixels.

[0152] Further, the pixel points between the two adjacent final hierarchical boundaries are taken as a hierarchical interval, and the number of pixel rows contained in each hierarchical interval is counted;

[0153] The axial length data of the core sample is calculated, the number of pixel rows in the two-dimensional expanded image is counted, and the conversion ratio of the number of pixel rows to the actual length is calculated;

[0154] The number of pixel rows of each hierarchical interval is multiplied by the conversion ratio to obtain the physical thickness value corresponding to the hierarchical interval.

[0155] Two adjacent final delamination boundaries refer to: in all the final delamination boundaries that have been determined, the two final delamination boundaries that are next to each other in sequence after sorting by image row number; for example, if the row numbers of the final delamination boundaries are [50, 120, 200, 300], 50 and 120 are a pair of adjacent final delamination boundaries, 120 and 200 are a pair of adjacent final delamination boundaries, and 200 and 300 are a pair of adjacent final delamination boundaries. After the final delamination boundaries are determined, all the pixel rows between the two adjacent final delamination boundaries form an independent delamination interval, that is, traverse all the final delamination boundaries, take the row numbers of each pair of adjacent final delamination boundaries as boundaries, and all the pixel rows belonging to the row numbers between the two boundaries (including the head and not including the tail, which can be set according to actual needs) are included in the same delamination interval; the number of pixel rows included in each delamination interval is counted, that is, the thickness expression of the interval on the image is obtained, and the two-dimensional expanded image is accurately divided into a plurality of geological layer intervals, and the number of pixel rows of each interval is the "height" or "thickness" of the interval on the image.

[0156] The actual length of the core sample in the axial direction has a precise physical measurement value, and the number of pixel rows in the image is corresponded with the actual length, so that the length represented by each pixel row in the actual physical space can be calculated. The specific method is: the total number of pixel rows of the two-dimensional expanded image is counted, and the actual axial length of the core sample is obtained, and the conversion ratio = actual length / total number of pixel rows. Under different image resolutions and collection modes, the actual length corresponding to each pixel row may be different, and an accurate pixel-physical length conversion relationship must be obtained to ensure the physical meaning and accuracy of the delamination thickness.

[0157] Once the number of pixel rows and the conversion ratio are obtained, for each delamination interval, only the number of pixel rows of the delamination interval multiplied by the conversion ratio is needed to obtain the physical thickness of the delamination interval in the actual core. For example, a delamination interval has m pixel rows, and the conversion ratio is k millimeters / row, then the physical thickness of the interval is m x k millimeters.

[0158] S6: For each delamination interval, the feature vectors of each row of pixel points inside the delamination interval are counted, and the feature vectors are associated with the physical thickness of the corresponding delamination interval, and the delamination structure statistics of the core sample are completed.

[0159] The feature vectors of each row of pixel points in each delamination interval are arranged in sequence to form a feature vector sequence of the delamination interval, the physical thickness value of the delamination interval is associated with the feature vector sequence of the delamination interval, and a feature vector sequence-physical thickness pair of the delamination interval is formed; all the feature vector sequence-physical thickness pairs are obtained by traversing all the delamination intervals, and the delamination structure statistics of the core sample are completed.

[0160] After all the layered intervals are determined, the feature vectors of each row of pixel points in the layered interval are counted. Specifically, for each layered interval, the six-dimensional feature vectors (including the main color feature, color uniformity, texture contrast, and edge strength) of each row are read in turn from the starting row to the ending row of the layered interval, and the feature vector sequence of the layered interval is formed in the order of row number. The physical thickness of each layered interval is calculated, and the physical thickness value of the layered interval is associated with the feature vector sequence of the layered interval to form a feature vector sequence-physical thickness pair. The above counting and association operations are sequentially completed by traversing all the layered intervals, and finally the layered structure information of the entire core sample is obtained. The detailed features of each layer obtained by image recognition are corresponded to the actual geological thickness data one by one, the digitalization and quantitative statistics of the geological layer structure are realized, and the feature vector sequence of each layered interval reflects the microscopic changes such as color and texture in the layer. The physical thickness reflects the spatial scale of the layer in the actual core. The combination of the two can reflect the structure and composition of the stratum, and also reflect the actual situation of the geological spatial distribution.

[0161] The feature vector sequence-physical thickness pair refers to: for each layered interval, the feature vectors (normalized a channel mean value, b channel mean value, a channel standard deviation, b channel standard deviation, texture contrast, and edge strength) of each row of pixel points in the layered interval are arranged in sequence to form an ordered feature vector sequence; at the same time, the physical thickness of the layered interval is bound with the feature vector sequence to form a group of data. In simple terms, the detailed internal structure description of a layered interval is paired with the actual spatial scale data to facilitate visualization or digital expression, and the comprehensive digital representation of the stratum structure is realized, providing a data basis for subsequent geological analysis.

[0162] Specifically, only the thickness reflects the spatial scale, and only the feature vector reflects the color, structure, and other attributes. The embodiment combines the two to completely express the attribute characteristics and spatial scale of each stratum, thereby better describing the core layered structure, and associating the internal changes of each layer with the overall thickness one by one. Not only can the overall layering be described, but also the internal details of each layer can be traced back, greatly improving the data utilization efficiency and analysis depth.

[0163] Referring to Figure 5 The embodiment also provides a drilling residue sample identification and counting system based on image recognition, which is used to execute the drilling residue sample identification and counting method described above, and includes:

[0164] An image acquisition module is configured to acquire a two-dimensional unfolded image of a cylindrical core sample to be identified, and to obtain a preprocessed image for feature extraction by preprocessing the two-dimensional unfolded image;

[0165] a feature acquisition module configured to acquire main color feature data, color uniformity data, texture contrast, and edge intensity of each row of pixels, and normalize the main color feature data, color uniformity data, texture contrast, and edge intensity of each row of pixels to obtain a feature vector of each row of pixels;

[0166] a hierarchical scoring module configured to generate a hierarchical boundary score of each row based on the feature vector of each row of pixels using a weighted summation method, form a hierarchical boundary score sequence by arranging the hierarchical boundary scores of all rows in a row order, find a local maximum point in the hierarchical boundary score sequence, and take the row corresponding to the local maximum point as a candidate hierarchical boundary;

[0167] a thickness evaluation module configured to calculate a row distance between adjacent candidate hierarchical boundaries, merge the adjacent candidate hierarchical boundaries whose row distance is less than a minimum thickness threshold to obtain a final hierarchical boundary, and divide the two-dimensional unwrapped image into a plurality of hierarchical intervals according to the final hierarchical boundary, count the number of pixel rows corresponding to each hierarchical interval, and calculate a physical thickness of each hierarchical interval based on a conversion ratio between pixels and actual length.

[0168] a comprehensive statistics module configured to count the feature vector of each row of pixels in each hierarchical interval, and associate the feature vector with the physical thickness of the corresponding hierarchical interval to complete the hierarchical structure statistics of the core sample.

[0169] The embodiment also provides a computer readable storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to implement the drilling residue sample identification and statistics method.

[0170] The storage medium can be one or a combination of more than two of a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, and a solid state disk.

[0171] The above merely describes the preferred embodiments of the present application and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for identifying and statistically analyzing borehole cuttings based on image recognition, characterized in that, include: A two-dimensional unfolded image of the cylindrical rock core sample to be identified is obtained, and the two-dimensional unfolded image is preprocessed to obtain a preprocessed image for feature extraction. The preprocessed image is converted to the Lab color space to obtain the main color feature data and color uniformity data of each row of pixels; the preprocessed image is converted to grayscale to obtain the texture contrast and edge intensity of each row of pixels. The main color feature data, color uniformity data, texture contrast and edge intensity corresponding to each row of pixels are normalized to obtain the feature vector of each row of pixels. The layer boundary score for each row is generated by weighted summation based on the feature vector of each row of pixels. The layer boundary scores of all rows are arranged in row order to form a layer boundary score sequence. Local maxima are found in the layer boundary score sequence, and the rows corresponding to the local maxima are taken as candidate layer boundaries. Calculate the row spacing between adjacent candidate layer boundaries, and merge adjacent candidate layer boundaries with row spacing less than the minimum thickness threshold to obtain the final layer boundary; The two-dimensional unfolded image is divided into several layered intervals according to the final layered boundary. The number of pixel rows corresponding to each layered interval is counted, and the physical thickness of each layered interval is calculated by combining the conversion ratio of pixels to actual length. For each layered interval, the feature vector of each row of pixels within it is statistically analyzed, and the feature vector is correlated with the physical thickness of the corresponding layered interval to complete the statistical analysis of the layered structure of the core sample.

2. The method for identifying and statistically analyzing borehole cuttings based on image recognition according to claim 1, characterized in that, The preprocessing steps include: The original pixel value ranges of the three color channels R, G and B in the two-dimensional unfolded image are statistically analyzed, and the original values ​​of each color channel of each pixel are mapped to the standard target range [0, 255] to obtain the normalized two-dimensional unfolded image. In the normalized two-dimensional unfolded image, median filtering is performed on each color channel value of each pixel to obtain the preprocessed image; The median filtering process is as follows: taking a single pixel as the center, extracting the values ​​of the same color channel of each pixel within its neighborhood window and sorting them by size, then selecting the median value as the new value of the color channel corresponding to the center pixel.

3. The method for identifying and statistically analyzing borehole cuttings based on image recognition according to claim 1, characterized in that, The primary color feature data for each row of pixels includes the mean value of the a-channel and the mean value of the b-channel in that row. The color uniformity data for each row of pixels includes the standard deviation of the a-channel and the standard deviation of the b-channel in that row.

4. The method for identifying and statistically analyzing borehole cuttings based on image recognition according to claim 1, characterized in that, To obtain the texture contrast of each row of pixels, specifically: Convert the preprocessed image into a grayscale image and preset multiple grayscale levels; The number of occurrences of gray level combinations of each pair of adjacent pixels in a single row is counted to form a two-dimensional gray-level co-occurrence matrix; wherein, the rows and columns of the gray-level co-occurrence matrix correspond to different gray levels, and the elements in the gray-level co-occurrence matrix are the frequencies of occurrence of a pair of gray level combinations; Divide each element in the gray-level co-occurrence matrix by the total number of adjacent pixel pairs in that row to obtain a probabilistic gray-level co-occurrence matrix; For each element in the gray-level co-occurrence matrix, calculate the square of the difference between its row and column indices, multiply it by the value of that element in the probabilistic gray-level co-occurrence matrix, and sum all the results to obtain the texture contrast of the pixels in that row; where the difference between the row and column indices is the difference between the row and column values ​​of the element in the gray-level co-occurrence matrix.

5. The method for identifying and statistically analyzing borehole cuttings based on image recognition according to claim 1, characterized in that, The gradient value of a pixel in the column direction is represented as: Then the first Edge strength of row pixels Represented as: in: This represents the convolution operation. For the first line, number The gradient value of a column pixel in the column direction. For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, For the first line, number The grayscale values ​​of the column pixels, This represents the total number of columns of pixels in the two-dimensional unfolded image.

6. The method for identifying and statistically analyzing borehole cuttings based on image recognition according to claim 1, characterized in that, The method for generating the hierarchical boundary score for each row of pixels based on the feature vector of each row of pixels is as follows: The main color feature data, color uniformity data, texture contrast and edge intensity are each assigned a weight, while the sum of each weight is equal to 1. Regarding the first For each row of pixels, calculate the absolute difference between the pixel and the next row in terms of normalized main color feature data, normalized color uniformity data, normalized texture contrast, and normalized edge intensity. Then multiply the absolute difference by the corresponding weight. The sum of the weighted results of the absolute differences is taken as the first... Layer boundary scoring of row pixels; The first and last rows of pixels are not included in the layer boundary score calculation.

7. The method for identifying and statistically analyzing borehole cuttings based on image recognition according to claim 1, characterized in that, If the layer boundary score of the current pixel row is greater than the layer boundary scores of both the previous and next pixel rows, then the layer boundary score corresponding to the current pixel row is determined to be a local maximum point.

8. The method for identifying and statistically analyzing borehole cuttings based on image recognition according to claim 1, characterized in that, The method for determining the final layer boundaries is as follows: Sort all candidate layer boundaries by row number, calculate the absolute difference of row numbers between adjacent candidate layer boundaries, and set a minimum thickness threshold in units of pixel rows. Determine whether the difference in row numbers between two adjacent candidate layer boundaries is less than the minimum thickness threshold. If it is less, then these two candidate layer boundaries are grouped into a dense layer group. If there are at least three consecutive adjacent candidate layer boundaries, and the absolute difference between the row numbers of each pair of adjacent candidate layer boundaries is less than the minimum thickness threshold, then these candidate layer boundaries are merged into the same dense layer group. For each dense stratified group, retain the candidate stratified boundary with the highest stratified boundary score within the group, and remove the remaining candidate stratified boundaries to complete the merging of dense stratified groups. All remaining candidate layer boundaries are determined as the final layer boundaries, and the pixel row corresponding to the largest row number and the pixel row corresponding to the smallest row number in the two-dimensional unfolded image are also marked as the final layer boundaries.

9. A borehole cuttings sample identification and statistical system based on image recognition, characterized in that, The borehole cuttings identification and statistical system employs the borehole cuttings identification and statistical method as described in any one of claims 1-8, including: The image acquisition module is used to acquire a two-dimensional unfolded image of the cylindrical rock core sample to be identified, and to preprocess the two-dimensional unfolded image to obtain a preprocessed image for feature extraction. The feature acquisition module is used to acquire the main color feature data, color uniformity data, texture contrast and edge intensity of each row of pixels; at the same time, the main color feature data, color uniformity data, texture contrast and edge intensity of each row of pixels are normalized to obtain the feature vector of each row of pixels. The hierarchical scoring module generates a hierarchical boundary score for each row by weighted summation based on the feature vector of each row of pixels. The hierarchical boundary scores of all rows are arranged in row order to form a hierarchical boundary score sequence. Local maxima are found in the hierarchical boundary score sequence, and the rows corresponding to the local maxima are taken as candidate hierarchical boundaries. The thickness evaluation module is used to calculate the row spacing between adjacent candidate layer boundaries. It merges adjacent candidate layer boundaries with row spacing less than the minimum thickness threshold to obtain the final layer boundary. Furthermore, it divides the two-dimensional unfolded image into several layer intervals based on the final layer boundary, counts the number of pixel rows corresponding to each layer interval, and calculates the physical thickness of each layer interval by combining the conversion ratio between pixels and actual length. The comprehensive statistics module calculates the feature vector of each row of pixels within each layered interval and correlates the feature vector with the physical thickness of the corresponding layered interval to complete the statistical analysis of the layered structure of the core sample.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when run, executes the borehole cuttings identification and statistical method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Soil sample characteristic extraction method and system and information data processing terminal

    CN113610062A

  • Method of image recognition of fused slag

    JP2000304232A