Aggregate image segmentation method and device, electronic equipment and non-transient storage medium

By denoising and contrast enhancement of aggregate images, and combining the selection rules of three-dimensional morphological features and edge sharpness features, the problem of insufficient accuracy and robustness in aggregate image segmentation is solved, and high-precision image segmentation and three-dimensional reconstruction are achieved.

CN121921332APending Publication Date: 2026-04-24SOUTH CHINA UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTH CHINA UNIV OF TECH
Filing Date
2025-12-30
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing image segmentation techniques based on grayscale features are limited in their segmentation accuracy and robustness when processing aggregate images due to poor image quality or slight differences in grayscale between the target and the background, which affects the accuracy of subsequent quantitative analysis.

Method used

By preprocessing the original two-dimensional grayscale image data, including noise reduction and contrast enhancement, and using three-dimensional morphological features and edge sharpness features to construct screening rules, the target structural elements are identified and separated, including median filtering, Gaussian filtering, nonlinear grayscale transformation, morphological operations and three-dimensional rendering techniques.

Benefits of technology

It significantly improves image quality, solves the problems of over-segmentation or under-segmentation in traditional methods, achieves high-precision and high-efficiency image segmentation, improves recognition accuracy and robustness, and generates a visualized 3D reconstruction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921332A_ABST
    Figure CN121921332A_ABST
Patent Text Reader

Abstract

The invention discloses an aggregate image segmentation method and device, electronic equipment and a non-transient storage medium, and relates to the technical field of image enhancement, and the method comprises the steps: obtaining original two-dimensional grayscale image data; preprocessing the original two-dimensional grayscale image data to obtain enhanced image data; segmenting the enhanced image data according to the target segmentation threshold to obtain a candidate structure region, the candidate structure region comprising a target structure element and an interference element; extracting a three-dimensional morphological feature and a three-dimensional edge sharpness feature of each connected domain from the candidate structure region; and constructing a screening rule based on the three-dimensional morphological features and the three-dimensional edge sharpness features, and identifying and separating target structural elements from the candidate structural region according to the screening rule. According to the method, the three-dimensional morphological features and the three-dimensional edge sharpness features of each connected domain are extracted, so that more comprehensive description of structural shapes and edge details is realized, and high-precision and high-efficiency image segmentation is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image enhancement technology, and in particular to a method, apparatus, electronic device and non-transitory storage medium for material image segmentation. Background Technology

[0002] Computed tomography (CT) is a non-destructive testing technique that uses image reconstruction to obtain digital images of the object under test. This technique requires no complex sample pretreatment and allows for continuous observation of samples under varying chemical environments or loads. It has gradually become the primary means of observing the microstructure of rock masses and is widely used in various aspects of rock engineering.

[0003] Currently, image segmentation techniques based on grayscale features are highly dependent on the signal-to-noise ratio and contrast of the image when processing aggregate images. Under ideal conditions, when the grayscale difference between the target and the background is significant, relatively accurate segmentation results can be obtained. However, in practical applications, poor image quality or the characteristics of the target itself often result in weak grayscale differences between the foreground and background and blurred feature boundaries. This poses a serious challenge to the accuracy and robustness of traditional segmentation methods, severely restricting the accuracy of subsequent quantitative analysis.

[0004] Therefore, improving the accuracy of aggregate image segmentation is a problem that urgently needs to be solved. Summary of the Invention

[0005] The main objective of this application is to provide a method, apparatus, electronic device, and non-transitory storage medium for material aggregate image segmentation, aiming to solve the technical problem of how to improve the accuracy of material aggregate image segmentation.

[0006] To achieve the above objectives, this application proposes a method for segmenting aggregate images, the method comprising: Obtain the original two-dimensional grayscale image data; The original two-dimensional grayscale image data is preprocessed to obtain enhanced image data. The preprocessing includes noise reduction and contrast enhancement. The enhanced image data is segmented according to the target segmentation threshold to obtain candidate structure regions, which include target structure elements and interference elements; Extract the three-dimensional morphological features and three-dimensional edge sharpness features of each connected domain from the candidate structural regions; Based on the three-dimensional morphological features and three-dimensional edge sharpness features, a filtering rule is constructed, and the target structural elements are identified and separated from the candidate structural regions according to the filtering rule.

[0007] In one embodiment, the preprocessing of the original two-dimensional grayscale image data to obtain enhanced image data includes noise reduction and contrast enhancement steps, comprising: The original two-dimensional grayscale image data is subjected to median filtering to obtain the initial noise-reduced image data; Gaussian filtering is applied to the initial denoised image data to obtain the denoised image data; The image data after noise reduction is subjected to nonlinear grayscale transformation to obtain enhanced image data.

[0008] In one embodiment, the step of segmenting the enhanced image data according to a target segmentation threshold to obtain candidate structural regions, wherein the candidate structural regions include target structural elements and interference elements, includes: Based on preset structural elements and preset brightness targets, microscale structural features are extracted from the enhanced image data through top-hat transformation to obtain preliminary segmentation results; The initial global threshold of the enhanced image data is calculated using the maximum inter-class variance method; The threshold adjustment amount is combined with the initial global threshold to generate the target segmentation threshold; The preliminary segmentation result is segmented according to the target segmentation threshold to obtain candidate structural regions, which include target structural elements and interference elements.

[0009] In one embodiment, the step of extracting microscale structural features from the enhanced image data through top-hat transformation based on preset structuring elements and preset brightness targets to obtain preliminary segmentation results includes: A morphological closing operation is performed on the enhanced image data according to the preset structuring elements to obtain a background estimation image; A black cap operation is performed based on a preset brightness target to obtain dark feature targets. The black cap operation is used to segment microcracks and pores. Based on the dark feature target, the difference between the enhanced image data and the estimated background image is calculated to obtain a preliminary segmentation result.

[0010] In one embodiment, before the step of segmenting the preliminary segmentation result according to the target segmentation threshold to obtain candidate structural regions, the method further includes: The preliminary segmentation result is binarized to obtain the main body region and the external background region, and the pixels of the main body region are determined. Isolated areas within the main body area are identified as holes to be filled. These holes do not belong to the external background area, and the pixel thresholds of the holes to be filled are the same as those of the external background area. Based on the pixels of the main region, the pixels of the holes to be filled are updated to obtain the updated binary image. A morphological erosion operation is performed on the boundary of the main region in the updated binary image to obtain an optimized preliminary segmentation result.

[0011] In one embodiment, the step of extracting the three-dimensional morphological features and three-dimensional edge sharpness features of each connected component from the candidate structural region includes: The sphericity is calculated based on the total volume and total surface area of ​​the connected domains to obtain the three-dimensional morphological features; For each voxel on the boundary of a candidate connected region, the gray-level gradient in different directions is calculated in a three-dimensional Cartesian coordinate system. The gray-level gradient in different directions includes the gray-level gradient in the x, y, and z directions. The gray-level gradient magnitude of each voxel is calculated based on the gray-level gradients in the three directions. Based on the candidate structural regions, the average gray-level gradient magnitude of all boundary voxels in the candidate connected domains is calculated to obtain the three-dimensional edge sharpness features of different connected domains.

[0012] In one embodiment, the step of constructing filtering rules based on the three-dimensional morphological features and three-dimensional edge sharpness features, and identifying and separating target structural elements from the candidate structural regions according to the filtering rules, includes: In the candidate structural region, connected components whose sphericity falls within a first preset range and whose three-dimensional edge sharpness feature value is greater than or equal to a first preset threshold are marked as first type of structural elements; The first type of structural element is binarized to obtain the target structural element; The target structural elements are stacked and rendered in three dimensions to generate a three-dimensional reconstruction model, which includes the target structural elements.

[0013] Furthermore, to achieve the above objectives, this application also proposes a material collection image segmentation device, which includes: The image acquisition module is used to acquire raw two-dimensional grayscale image data; The image enhancement module is used to preprocess the original two-dimensional grayscale image data to obtain enhanced image data. The preprocessing includes noise reduction and contrast enhancement. The preliminary segmentation module is used to segment the enhanced image data according to the target segmentation threshold to obtain candidate structure regions, which include target structure elements and interference elements; The feature extraction module is used to extract the three-dimensional morphological features and three-dimensional edge sharpness features of each connected component from the candidate structural region. The target segmentation module is used to construct filtering rules based on the three-dimensional morphological features and three-dimensional edge sharpness features, and to identify and separate target structural elements from the candidate structural regions according to the filtering rules.

[0014] In addition, to achieve the above objectives, this application also proposes an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the aggregate image segmentation method as described above.

[0015] In addition, to achieve the above objectives, this application also proposes a non-transitory storage medium storing a computer program, which, when executed by a processor, implements the steps of the aggregate image segmentation method described above.

[0016] One or more technical solutions proposed in this application have at least the following technical effects: The process involves acquiring raw 2D grayscale image data, preprocessing it to obtain enhanced image data (including noise reduction and contrast enhancement), and addressing the issues of noise interference and low contrast in the raw 2D grayscale image data. This significantly improves image quality and provides a clearer foundation for subsequent segmentation.

[0017] The enhanced image data is segmented based on a target segmentation threshold to obtain candidate structural regions, which include both target structural elements and interference elements. This target-threshold-based segmentation method initially extracts candidate structural regions from the enhanced image data, overcoming the limitations of over-segmentation or under-segmentation in traditional methods and achieving rapid preliminary screening of candidate regions.

[0018] This method extracts the 3D morphological features and 3D edge sharpness features of each connected component from candidate structural regions. Based on these features, filtering rules are constructed, and target structural elements are identified and separated from the candidate structural regions according to these rules. By extracting the 3D morphological features and 3D edge sharpness features of each connected component, the method solves the problem of inaccurate recognition caused by relying on 2D features or single features, achieving a more comprehensive description of structural shapes and edge details. Constructing filtering rules based on the unique features of connected components and identifying target structural elements overcomes the challenge of removing interfering elements from candidate regions, achieving high-precision and high-efficiency image segmentation, and improving overall recognition accuracy and robustness. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating the first embodiment of the material image segmentation method of this application; Figure 2 This is the original three-dimensional grayscale image of the embodiment of this application; Figure 3 The image shown is the result of erosion calculation according to an embodiment of this application; Figure 4 The image shown is an example of an embodiment of this application after tag analysis; Figure 5 The image is a three-dimensional reconstructed image according to an embodiment of this application; Figure 6 This is a schematic diagram of the module structure of the material collection image segmentation device of this application.

[0022] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0023] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0024] This application provides a material collection image segmentation method applicable to the Avizo platform. Specifically, refer to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the aggregate image segmentation method of this application. In this embodiment, the aggregate image segmentation method includes steps S10 to S50:

[0025] Step S10: Obtain the original two-dimensional grayscale image data.

[0026] It should be noted that raw 2D grayscale image data can be understood as unprocessed 2D image data directly acquired by imaging equipment. For example, RAW data obtained from CT scans can be imported into the Avizo platform, the image can be scaled to a suitable size, and the voxel spacing of the slices can be set to 0.003 mm.

[0027] Step S20: Preprocess the original two-dimensional grayscale image data to obtain enhanced image data. The preprocessing includes noise reduction and contrast enhancement.

[0028] It should be noted that image enhancement refers to image data with improved quality obtained after preprocessing the original two-dimensional grayscale image data. This can be achieved by reducing random noise in the image through filtering or algorithmic methods, thereby improving the signal-to-noise ratio; and by adjusting the distribution of grayscale values ​​to expand the brightness differences in different areas of the image, thereby reducing noise and improving visual clarity.

[0029] Step S30: Segment the enhanced image data according to the target segmentation threshold to obtain candidate structure regions, which include target structure elements and interference elements.

[0030] It should be noted that the target segmentation threshold can be understood as an optimized grayscale value parameter used to divide the enhanced image data into different regions. Candidate structural regions refer to the set of potential target regions obtained after the segmentation operation. Target structural elements refer to the specific structures or objects in the image that need to be ultimately identified and extracted; they are the core targets in the original two-dimensional grayscale image data. Interference elements refer to the parts of the candidate structural regions that are unrelated to the target structural elements, such as noise, artifacts, or other background structures.

[0031] Step S40: Extract the three-dimensional morphological features and three-dimensional edge sharpness features of each connected domain from the candidate structural regions.

[0032] It should be noted that a connected region refers to a continuous area in an image composed of adjacent voxels connected in three-dimensional space, and each connected region represents an independent structural unit. Three-dimensional morphological features can be understood as quantitative indicators describing the three-dimensional shape characteristics of connected regions, such as volume, surface area, and sphericity, used to distinguish different structures. Three-dimensional edge sharpness features can be understood as quantitative indicators describing the clarity or sharpness of connected region boundaries, reflecting gradient changes at the edges.

[0033] Step S50: Construct filtering rules based on three-dimensional morphological features and three-dimensional edge sharpness features, and identify and separate target structural elements from candidate structural regions according to the filtering rules.

[0034] It should be noted that the screening rules can be understood as classification criteria or decision logic built based on three-dimensional morphological features and three-dimensional edge sharpness features, which are used to automatically identify and separate target structural elements from candidate regions.

[0035] In this embodiment, preprocessing the original 2D grayscale image data solves the problems of noise interference and low contrast, significantly improving image quality and providing a clearer foundation for subsequent segmentation. A segmentation method based on a target segmentation threshold initially extracts candidate structural regions from the enhanced image data, overcoming the limitations of over-segmentation or under-segmentation in traditional methods and enabling rapid preliminary screening of candidate regions. Extracting the 3D morphological features and 3D edge sharpness features of each connected component solves the problem of inaccurate recognition caused by relying on 2D features or single features, achieving a more comprehensive description of structural shapes and edge details. Constructing screening rules based on the unique features of connected components and identifying target structural elements overcomes the challenge of removing interfering elements from candidate regions, achieving high-precision and high-efficiency image segmentation and improving overall recognition accuracy and robustness.

[0036] In the second embodiment, step S20 includes: Step S201: Perform median filtering on the original two-dimensional grayscale image data to obtain the initial denoised image data.

[0037] It should be noted that median filtering is a non-linear digital filtering technique that effectively removes impulse noise, such as salt-and-pepper noise, from an image by replacing the value of each pixel with the median value of all pixels in its two-dimensional neighborhood, while preserving edge structure. The initial noise reduction image data refers to the intermediate result obtained after applying median filtering to the original two-dimensional grayscale image data, achieving a preliminary reduction in noise.

[0038] For example, the filter window size can be set to an odd value, such as 3×3, 5×5, etc., which can ensure that the grayscale values ​​of the pixels taken after sorting are integers. The calculation formula is as follows:

[0039] in, This represents the grayscale value after median filtering. This represents the grayscale value of the pixel before processing; k represents the size of the filtering window; and med represents the median function.

[0040] Step S202: Perform Gaussian filtering on the initial denoised image data to obtain the denoised image data.

[0041] It should be noted that Gaussian filtering is a linear smoothing filtering technique that uses a Gaussian function as the weight kernel to perform weighted averaging on an image, effectively reducing Gaussian noise and random noise. The image data after noise reduction refers to the image data that has undergone further processing with Gaussian filtering, resulting in a significantly reduced noise level and a smoother image.

[0042] For example, the pixel weights in a Gaussian filter can be represented as:

[0043] in, In a Gaussian filter, the first... Line number The weights of the column pixels; k represents the radius of the filter; This represents the standard deviation of the Gaussian function. For each pixel in the image, the Gaussian filter performs a weighted average of its gray values ​​with those of its surrounding pixels to obtain a new gray value, which can be expressed as:

[0044]

[0045] in, This represents the grayscale value after median filtering. This represents the grayscale value of the pixel before processing; k represents the filter radius.

[0046] Step S203: Perform nonlinear grayscale transformation on the noise-reduced image data to obtain enhanced image data.

[0047] It should be noted that nonlinear grayscale transformation is an image enhancement technique that remaps image grayscale values ​​using a nonlinear function to expand the dynamic range of a specific grayscale range, thereby enhancing contrast. Enhanced image data refers to the final preprocessed image data obtained after nonlinear grayscale transformation, where contrast is improved and the difference between the target structure and the background becomes more apparent.

[0048] For example, gamma transform can be used to perform non-linear mapping on the grayscale values ​​in the denoised image data, redistributing the image grayscale range to adjust the image brightness and contrast. Specifically:

[0049] Where s represents the output grayscale value, r represents the input grayscale value, c is a constant, and γ is the gamma value. The larger γ is, the greater the difference between the output pixel value and the input pixel value, and the stronger the enhancement effect. In gamma transform, the value of γ determines the degree of change in the image's brightness and contrast. When γ is less than 1, gamma transform can enhance the parts of the image with lower grayscale values, making the image brighter; when γ is greater than 1, gamma transform can enhance the parts of the image with higher grayscale values, making the image darker. Gamma transform can adjust different grayscale regions to different degrees, thereby better preserving the detailed information in the image.

[0050] In this embodiment, median filtering addresses the issues of impulse noise and outlier interference in the original 2D grayscale image data, effectively preserving target edge details while reducing noise. Subsequently, Gaussian filtering further addresses the smoothing of Gaussian and random noise in the image, achieving more comprehensive noise suppression and image smoothing compared to median filtering alone. Finally, nonlinear grayscale transformation solves the problems of low overall image contrast and lack of target structure prominence. Compared to direct linear enhancement, it achieves adaptive contrast enhancement within a specific grayscale range, making target features clearer. The combination of various filtering and enhancement techniques effectively improves image quality, providing a reliable foundation for subsequent segmentation and recognition steps.

[0051] In the third embodiment, step S30 includes: Step S301: Based on preset structuring elements and preset brightness targets, microscale structural features are extracted from the enhanced image data through top-hat transformation to obtain preliminary segmentation results.

[0052] It should be noted that step S301 includes: performing morphological closing operations on the enhanced image data according to preset structuring elements to obtain a background estimation image; performing black hat operations according to preset brightness targets to obtain dark feature targets, the black hat operations being used to segment microcracks and pores; and calculating the difference between the enhanced image data and the background estimation image based on the dark feature targets to obtain preliminary segmentation results.

[0053] In this context, the preset structuring element can be understood as a predefined two-dimensional shape template in morphological operations, used to detect or alter specific structures in the image that match it. The preset brightness target is a pre-set standard used to indicate whether the target structure to be extracted is a region that is brighter or darker than the background. Morphological closing operations can be used to fill small holes inside the target and smooth the contours, while essentially preserving the original area. The background estimation image refers to the image obtained by performing morphological closing operations on the original image. The black hat operation is used to enhance and extract small features that are darker than the background, such as microcracks and pores. Dark feature targets refer to regions in the image whose grayscale values ​​are lower than the surrounding background.

[0054] For example, two-dimensional slice images of the aggregate in three directions can be imported into the Avizo platform for two-dimensional qualitative description. Specifically, the crack can be initially segmented using an interactive top-hat transformation. Furthermore, morphological closing operations can be applied to eliminate background trends, retaining only relatively small-scale structures, as shown below:

[0055] in, This represents the closing operation; This represents the expansion operation. The erosion operation is represented by the following formula:

[0056]

[0057] in, Input a grayscale image; The predefined structuring element, used to describe the geometric shape of the neighborhood in the image, is essentially a set of points with a specific shape and size, used to define the spatial range of the computation window. Since the segmentation object in this embodiment is aggregate cracks and pores, a black-hat operation can be used, specifically represented as:

[0058]

[0059] in, This represents the black-hat operation, used to segment microcracks and pores.

[0060] Step S302: Calculate the initial global threshold for the enhanced image data using the maximum inter-class variance method.

[0061] It should be noted that the Otsu's method (Maximum Inter-Class Variance) finds the optimal threshold by maximizing the inter-class variance between foreground and background pixels. For example, the surface cracks of the aggregate can be considered as the target set M1, and the rest as the background set M2, with a boundary threshold of K. In a grayscale image, the crack grayscale value is lower than the background grayscale value; therefore, pixels within the threshold range [0, K] are the segmentation targets. In the grayscale image, the probability that any point has a grayscale value of i is... The probability that the point falls within the selected domain is expressed as:

[0062]

[0063] The probability that a pixel falls within the background region is expressed as:

[0064] Therefore, the average gray values ​​of pixels in sets M1 and M2 can be obtained. as well as They are represented as follows:

[0065]

[0066] in, This represents the average grayscale value of the pixels in M1. This represents the average grayscale value of the pixels in M2.

[0067] Overall average gray value of the image Represented as:

[0068] The overall pixel variance within an image is expressed as:

[0069] The inter-class variance between domains M1 and M2 is expressed as follows: =

[0070] when When the maximum value is taken, the corresponding grayscale value is... This is the initial global threshold.

[0071] Step S303: Combine the threshold adjustment amount with the initial global threshold to generate the target segmentation threshold.

[0072] It should be noted that the initial global threshold is a single grayscale threshold used to initially distinguish between the foreground and background of the image. The threshold adjustment amount can be understood as a preset value based on prior knowledge or specific needs, used to fine-tune the calculated initial global threshold to optimize the segmentation results.

[0073] For example, the formula for fine-tuning the calculated initial global threshold is as follows:

[0074] in, The threshold adjustment value can be set to [-15, 15]. By fine-tuning the threshold in real time until the aggregate outline is complete, the applicability of the segmentation algorithm under different samples can be improved.

[0075] Step S304: The preliminary segmentation result is segmented according to the target segmentation threshold to obtain candidate structure regions, which include target structure elements and interference elements.

[0076] In this embodiment, a top-hat transformation technique based on preset structuring elements and brightness, particularly through morphological closing operations to estimate the background and perform black top-hat operations, solves the challenge of effectively separating micro-scale dark feature targets from complex backgrounds, achieving preliminary enhancement and extraction of small, low-contrast target features. By automatically calculating the initial global threshold using the maximum inter-class variance method, the subjectivity and inefficiency of manually setting thresholds are resolved. Compared to fixed threshold methods, this achieves adaptation to image grayscale distribution and obtains a more reliable basic segmentation boundary. By introducing a threshold adjustment amount combined with the initial global threshold to generate the final target segmentation threshold, the problem that a single automatic threshold may not perfectly adapt to all scenarios is solved, improving the segmentation robustness for different images. Finally, by applying the optimized threshold to the preliminary segmentation results, candidate structural regions can be obtained more accurately, laying the foundation for subsequent accurate identification and separation of target elements.

[0077] In one embodiment, before step S304, the method further includes: binarizing the preliminary segmentation result to obtain a main body region and an external background region, and determining the pixels of the main body region; identifying isolated regions within the main body region as holes to be filled, wherein the holes to be filled do not belong to the external background region, and the pixel thresholds of the holes to be filled are the same as those of the external background region; updating the pixels of the holes to be filled based on the pixels of the main body region to obtain an updated binary image; and performing a morphological erosion operation on the boundary of the main body region in the updated binary image to obtain an optimized preliminary segmentation result.

[0078] It should be noted that, based on the optimized preliminary segmentation results, the target segmentation threshold can be applied to obtain candidate structure regions. In the binarized image, the main body region represents the set of foreground pixels of the main target structure, and the outer background region represents the set of background pixels surrounding the main body region.

[0079] For example, isolated noise points and high-density inclusions that are not connected to the outside world within the aggregate region can be filled in to ensure the topological integrity of the main aggregate region. Specifically, the main aggregate region can be binarized, with the aggregate body having a grayscale value of 1 and the background having a grayscale value of 0, represented as:

[0080]

[0081] in, Let M(p) = 0 represent the main aggregate region, and M(p) = 0 represent the background. Let p be the coordinates of any pixel in the grayscale image. Define its complement as:

[0082]

[0083] exist In the diagram, the main aggregate area is set to 0, while the background, isolated noise points, and high-density inclusions are all set to 1. The set of isolated noise points and high-density inclusions is then defined as... The background area set is set to We can obtain:

[0084] Where, \ represents ,but It is possible to... Calculating the complement again will fill in the isolated noise and high-density interspersed points inside the original image while retaining the external background threshold, as shown below:

[0085] Furthermore, an erosion operation is applied to the aggregate edge region to eliminate aggregate boundary shadows, as shown in the original image. Figure 2 As shown in the image, the segmentation effect is as follows: Figure 3 As shown.

[0086] In this embodiment, the preliminary segmentation results are binarized and connected regions are identified, clearly defining the main body region and the external background. This solves the problem of unclear target and background, laying the foundation for subsequent precise operations. By identifying isolated regions that are not connected to the external background within the main body region as holes to be filled and updating pixels, the problem of false holes appearing inside the target structure due to noise or incomplete segmentation is solved. Compared with unfilled holes, the integrity and continuity of the target region are achieved. Furthermore, morphological erosion is performed on the filled binary image to solve irregularities such as small burrs and pseudo-protrusions that may exist at the boundary of the target region. This achieves smoothing and optimization of the region contour, effectively removing tiny noise points that may interfere with subsequent analysis, thus obtaining a more accurate optimized preliminary segmentation result.

[0087] In the fourth embodiment, step S40 includes: Step S401: Calculate the sphericity based on the total volume and total surface area of ​​the voxels of the connected domain to obtain the three-dimensional morphological features.

[0088] It should be noted that total voxel volume refers to the total number of voxels contained in a 3D connected domain, reflecting the size of the domain in space. Total surface area refers to the sum of the surface areas of all external boundary voxels of a 3D connected domain, reflecting the complexity of the domain's interaction with the outside world. Sphericity is an indicator used to quantify how close a 3D shape is to a sphere.

[0089] It should be noted that surface cracks in aggregates are often distributed in a strip-like pattern, while pores and individual minerals are often circular or elliptical, with significant differences in edge sharpness between the two. For example, label analysis can be introduced to assess the sphericity of the segmented portions. In addition, the edge sharpness of objects in a 3D environment (Shape_VA3d) is used as a further segmentation indicator, and the corresponding formula is:

[0090]

[0091] Among them, for a perfect sphere there are =1; for strip-shaped bodies, . This represents the sum of the volumes of all voxels within the selected set; This represents the sum of the surface areas of the voxels within the selected set.

[0092] Step S402: For each voxel on the boundary of the candidate connected domain, calculate the gray-level gradient in different directions in a three-dimensional Cartesian coordinate system. The gray-level gradient in different directions includes the gray-level gradient in the x, y, and z directions.

[0093] It should be noted that a candidate connected component refers to an independent, continuous set of voxels identified from a candidate structural region, representing a potential target or interference structure. Each voxel on the boundary refers to the voxel located at the outermost layer of the candidate connected component, adjacent to the background region. The gray-level gradient refers to the rate of change of the gray value of a voxel in the image in different directions, reflecting how quickly the brightness of that point in the image changes.

[0094] For example, let the gray volume to be segmented be I(p), where p = (x, y, z); the connected components of the gray volume Its voxel boundary set is The voxel spacing is (Δx, Δy, Δz). First, partial derivatives of the central difference with respect to the voxel spacing are calculated in the x, y, and z directions to approximate the spatial gradient distribution of the voxels within the grayscale field. The corresponding formula is expressed as:

[0095]

[0096] , Similarly, the three-dimensional gradient vector of the voxel is obtained, and the corresponding formula is:

[0097] Step S403: Calculate the gray-level gradient magnitude of each voxel based on the gray-level gradients in the three directions.

[0098] It should be noted that the gray-level gradients in the X, Y, and Z directions can be considered as a three-dimensional vector. The magnitude of this vector is the corresponding gray-level gradient magnitude, which can comprehensively reflect the total edge intensity of a voxel point, regardless of the specific direction. For example, by taking the magnitude of the voxel's three-dimensional gradient vector, the gray-level change rate in the three-dimensional directions of the voxel can be obtained, with the corresponding formula:

[0099]

[0100] in, This represents the grayscale gradient magnitude of a voxel.

[0101] Step S404: Based on the candidate structural region, calculate the average gray-level gradient magnitude of all boundary voxels in the candidate connected domain to obtain the three-dimensional edge sharpness features of different connected domains.

[0102] It should be noted that the three-dimensional edge sharpness feature can be a quantitative indicator characterizing the clarity and sharpness of the overall boundary of a connected component. For example, the three-dimensional edge sharpness features of different connected components can be defined as follows: The corresponding formula is:

[0103]

[0104] By defining the edge sharpness Shape_V0 of a crack a priori and combining it with the sphericity index, cracks can be segmented on a fully connected domain. The specific discrimination formula can be expressed as:

[0105] The segmentation results can be corrected through label analysis, such as... Figure 4 As shown.

[0106] In this embodiment, sphericity is calculated based on the total volume and total surface area of ​​voxels, solving the problem that simple dimensions or two-dimensional projections alone are insufficient to accurately describe the characteristics of complex three-dimensional shapes, thus achieving a more essential and quantitative representation of the three-dimensional morphology of the target structure. By calculating the gray-level gradients in the X, Y, and Z directions for each voxel on the boundary of a connected domain in a three-dimensional Cartesian coordinate system, the problem of incomplete edge assessment caused by neglecting spatial gradient information in traditional two-dimensional image processing is solved, achieving comprehensive capture of boundary strength. Furthermore, by calculating the gray-level gradient magnitude of each voxel, the problem of scattered gradient information in multiple directions and the difficulty in comprehensively assessing the overall edge strength at a certain point is solved. Compared with methods relying on gradients in a single direction, this achieves a more robust quantification of the sharpness of boundary points. Finally, by calculating the average of the gradient magnitudes of all boundary voxels in the entire connected domain as its three-dimensional edge sharpness feature, the potential bias in judging the overall boundary quality based on only local individual points is solved, achieving an objective and uniform measurement of the overall boundary sharpness of each connected domain.

[0107] Based on the fourth embodiment, in one implementation, step S50 includes: in the candidate structural region, connecting regions whose sphericity falls within a first preset range and whose three-dimensional edge sharpness feature value is greater than or equal to a first preset threshold are marked as first type structural elements; the first type structural elements are binarized to obtain target structural elements; the target structural elements are stacked and rendered in three dimensions along the three-dimensional space to generate a three-dimensional reconstruction model, the three-dimensional reconstruction model including the target structural elements.

[0108] It should be noted that the first preset range is a pre-defined interval used to filter qualified sphericity values. This range can be determined based on the ideal sphericity empirical or theoretical value of the target structural element. The first preset threshold is a pre-defined value used to judge whether the three-dimensional edge sharpness feature is qualified. The first type of structural element refers to the connected component in the candidate structural region that simultaneously satisfies the two conditions: "sphericity within the first preset range" and "three-dimensional edge sharpness feature value greater than or equal to the first preset threshold". In 3D reconstruction, a series of consecutive binarized two-dimensional slice images can be arranged in their spatial order to form three-dimensional volume data. Then, by setting parameters such as lighting, material, and transparency, the three-dimensional volume data is rendered in three dimensions to generate a two-dimensional projection image with a sense of depth and realism. The three-dimensional reconstruction model refers to a three-dimensional solid model reconstructed from a two-dimensional image sequence through stacking and 3D rendering techniques. This model can be displayed, rotated, and observed on a computer, and it intuitively contains the spatial morphology of the target structural element.

[0109] For example, the divided crack data can be binarized using the Arithmetic command to facilitate 3D rendering. After binarization, the binarized grayscale images in the x, y, and z coordinate systems are stacked and rendered in 3D using the Volume Rendering command to obtain a 3D reconstruction model of the road aggregate crack, such as... Figure 5 As shown.

[0110] In this embodiment, a screening rule is constructed by combining sphericity and 3D edge sharpness features. By setting a first preset range and a first preset threshold, more accurate identification of target structural elements is achieved, effectively distinguishing true targets with regular shapes and clear boundaries from interference elements with irregular shapes or blurred boundaries. By binarizing the selected first type of structural elements, the problem of target elements being difficult to separate from the background and other structures is solved, achieving accurate extraction of target elements. Finally, by stacking and 3D rendering the extracted target elements along 3D space, the problem that 2D images cannot intuitively display the spatial shape and distribution of targets is solved, generating an intuitive and visual 3D reconstruction model. This achieves a three-dimensional and comprehensive presentation of the 3D morphology of target structural elements, greatly facilitating subsequent observation and analysis.

[0111] Based on the same inventive concept, such as Figure 6 As shown, this application also provides a material collection image segmentation device, which includes: Image acquisition module 10 is used to acquire raw two-dimensional grayscale image data; Image enhancement module 20 is used to preprocess the original two-dimensional grayscale image data to obtain enhanced image data. The preprocessing includes noise reduction and contrast enhancement. The preliminary segmentation module 30 is used to segment the enhanced image data according to the target segmentation threshold to obtain candidate structure regions, wherein the candidate structure regions include target structure elements and interference elements; Feature extraction module 40 is used to extract the three-dimensional morphological features and three-dimensional edge sharpness features of each connected component from the candidate structural region. The target segmentation module 50 is used to construct filtering rules based on the three-dimensional morphological features and three-dimensional edge sharpness features, and to identify and separate target structural elements from the candidate structural regions according to the filtering rules.

[0112] It should be noted that the aggregate image segmentation device and the aggregate image segmentation method provided in this application are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned aggregate image segmentation method, and the repeated parts will not be described again.

[0113] In some embodiments, an electronic device provided in this application includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the above-described aggregate image segmentation method.

[0114] Specifically, the processor may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor may also include onboard memory for caching purposes. The processor may be a single processing unit or multiple processing units for performing different actions of the method flow according to embodiments of this application.

[0115] Memory can be any medium capable of containing, storing, transmitting, propagating, or transmitting instructions. For example, memory can include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, instruments, or propagation media. Specific examples of memory include: magnetic storage devices such as magnetic tape or hard disk drives (HDDs); optical storage devices such as optical discs (CD-ROMs); and also random access memory (RAM) or flash memory; and / or wired / wireless communication links.

[0116] This application also provides a non-transitory storage medium storing a computer program that, when executed by a processor, implements the above-described aggregate image segmentation method. This storage medium may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not be assembled into that device / apparatus / system. The aforementioned non-transitory storage medium carries one or more programs, which, when executed, implement the method as described in the embodiments or implementations of this application.

[0117] According to embodiments of this application, a non-transitory storage medium can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. A computer-readable signal medium can also be any storage medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the storage medium can be transmitted using any suitable medium, including but not limited to: wireless, wired, optical fiber, radio frequency signals, etc., or any suitable combination thereof.

[0118] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application. Therefore, the scope of this application should not be limited to the above embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for segmenting aggregate images, characterized in that, The method includes: Obtain the original two-dimensional grayscale image data; The original two-dimensional grayscale image data is preprocessed to obtain enhanced image data. The preprocessing includes noise reduction and contrast enhancement. The enhanced image data is segmented according to the target segmentation threshold to obtain candidate structure regions, which include target structure elements and interference elements; Extract the three-dimensional morphological features and three-dimensional edge sharpness features of each connected domain from the candidate structural regions; Based on the three-dimensional morphological features and three-dimensional edge sharpness features, a filtering rule is constructed, and the target structural elements are identified and separated from the candidate structural regions according to the filtering rule.

2. The method as described in claim 1, characterized in that, The preprocessing of the original two-dimensional grayscale image data to obtain enhanced image data includes noise reduction and contrast enhancement steps, including: The original two-dimensional grayscale image data is subjected to median filtering to obtain the initial noise-reduced image data; Gaussian filtering is applied to the initial denoised image data to obtain the denoised image data; The image data after noise reduction is subjected to nonlinear grayscale transformation to obtain enhanced image data.

3. The method as described in claim 1, characterized in that, The step of segmenting the enhanced image data according to a target segmentation threshold to obtain candidate structure regions, wherein the candidate structure regions include target structure elements and interference elements, includes: Based on preset structural elements and preset brightness targets, microscale structural features are extracted from the enhanced image data through top-hat transformation to obtain preliminary segmentation results; The initial global threshold of the enhanced image data is calculated using the maximum inter-class variance method; The threshold adjustment amount is combined with the initial global threshold to generate the target segmentation threshold; The preliminary segmentation result is segmented according to the target segmentation threshold to obtain candidate structural regions, which include target structural elements and interference elements.

4. The method as described in claim 3, characterized in that, The step of extracting microscale structural features from the enhanced image data through top-hat transformation based on preset structural elements and preset brightness targets to obtain preliminary segmentation results includes: A morphological closing operation is performed on the enhanced image data according to the preset structuring elements to obtain a background estimation image; A black cap operation is performed based on a preset brightness target to obtain dark feature targets. The black cap operation is used to segment microcracks and pores. Based on the dark feature target, the difference between the enhanced image data and the estimated background image is calculated to obtain a preliminary segmentation result.

5. The method as described in claim 3, characterized in that, Before the step of segmenting the preliminary segmentation result according to the target segmentation threshold to obtain candidate structural regions, the method further includes: The preliminary segmentation result is binarized to obtain the main body region and the external background region, and the pixels of the main body region are determined. Isolated areas within the main body area are identified as holes to be filled. These holes do not belong to the external background area, and the pixel thresholds of the holes to be filled are the same as those of the external background area. Based on the pixels of the main region, the pixels of the holes to be filled are updated to obtain the updated binary image. A morphological erosion operation is performed on the boundary of the main region in the updated binary image to obtain an optimized preliminary segmentation result.

6. The method as described in claim 1, characterized in that, The step of extracting the three-dimensional morphological features and three-dimensional edge sharpness features of each connected component from the candidate structural region includes: The sphericity is calculated based on the total volume and total surface area of ​​the connected domains to obtain the three-dimensional morphological features; For each voxel on the boundary of a candidate connected region, the gray-level gradient in different directions is calculated in a three-dimensional Cartesian coordinate system. The gray-level gradient in different directions includes the gray-level gradient in the x, y, and z directions. The gray-level gradient magnitude of each voxel is calculated based on the gray-level gradients in the three directions. Based on the candidate structural regions, the average gray-level gradient magnitude of all boundary voxels in the candidate connected domains is calculated to obtain the three-dimensional edge sharpness features of different connected domains.

7. The method as described in claim 6, characterized in that, The step of constructing filtering rules based on the three-dimensional morphological features and three-dimensional edge sharpness features, and identifying and separating target structural elements from the candidate structural regions according to the filtering rules, includes: In the candidate structural region, connected components whose sphericity falls within a first preset range and whose three-dimensional edge sharpness feature value is greater than or equal to a first preset threshold are marked as first type of structural elements; The first type of structural element is binarized to obtain the target structural element; The target structural elements are stacked and rendered in three dimensions to generate a three-dimensional reconstruction model, which includes the target structural elements.

8. A material collection image segmentation device, characterized in that, The aggregate image segmentation device includes: The image acquisition module is used to acquire raw two-dimensional grayscale image data; The image enhancement module is used to preprocess the original two-dimensional grayscale image data to obtain enhanced image data. The preprocessing includes noise reduction and contrast enhancement. The preliminary segmentation module is used to segment the enhanced image data according to the target segmentation threshold to obtain candidate structure regions, which include target structure elements and interference elements; The feature extraction module is used to extract the three-dimensional morphological features and three-dimensional edge sharpness features of each connected component from the candidate structural region. The target segmentation module is used to construct filtering rules based on the three-dimensional morphological features and three-dimensional edge sharpness features, and to identify and separate target structural elements from the candidate structural regions according to the filtering rules.

9. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the aggregate image segmentation method as described in any one of claims 1 to 7.

10. A non-transitory storage medium, characterized in that, The non-transitory storage medium stores a computer program, which, when executed by a processor, implements the steps of the aggregate image segmentation method as described in any one of claims 1 to 7.