Method and apparatus for extracting single spike grains based on three-dimensional ct data

By removing the stalk region from 3D CT data and utilizing grayscale thresholding and connectivity analysis, combined with a target detection model, the problem of inaccurate grain extraction in traditional methods is solved, achieving efficient and accurate extraction of individual grains and supporting high-throughput phenotypic analysis in agricultural research.

CN120355725BActive Publication Date: 2025-11-18INST OF GENETICS & DEVELOPMENTAL BIOLOGY CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510867156.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-11-18
Estimated Expiration
2045-06-26

AI Technical Summary

Technical Problem

Traditional methods struggle to efficiently and accurately extract individual grains from 3D CT data, especially when the boundaries between grains and stems are blurred or there is noise interference. This makes it difficult to meet the demands of modern agricultural research for high-throughput and precise phenotypic analysis.

Method used

By acquiring three-dimensional CT data of plants, removing the stem region, and using grayscale thresholding and connectivity analysis, combined with a target detection model and non-maximum suppression algorithm, the mask of a single ear of grain is extracted, and finally a three-dimensional image of a single ear of grain is obtained.

Benefits of technology

It significantly improves the accuracy and stability of single ear grain extraction, supporting efficient phenotypic analysis and quality detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120355725B_ABST
    Figure CN120355725B_ABST
Patent Text Reader

Abstract

The application provides a single ear grain extraction method and device based on three-dimensional CT data. The stem region in the plant three-dimensional CT data is removed to obtain stem-removed three-dimensional data, avoiding the interference of the stem region on the ear grain extraction. The region with a gray value greater than or equal to a gray threshold value in the stem-removed three-dimensional data is retained, and the remaining region is removed, so as to obtain accurate ear grain three-dimensional data, which contains multiple ear grains. Each connected region determined through connected analysis corresponds to an ear grain region, and the connected regions are matched with corresponding labels respectively, so as to distinguish different ear grain regions by using different labels. Then, a single ear grain mask is obtained by extracting a single ear grain according to the label, and the single ear grain mask is used to extract an accurate single ear grain three-dimensional image from the plant three-dimensional CT data, so that the accuracy and stability of the single ear grain three-dimensional image extraction are significantly improved, and phenotype analysis and quality detection can be conveniently performed according to the single ear grain three-dimensional image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method and device for extracting a single ear of grain based on three-dimensional CT data. Background Technology

[0002] Three-dimensional CT scanning technology has been widely used in plant research due to its ability to acquire high-resolution data of plant internal structures non-destructively. Especially for plants with spikelets, precise extraction of the grains from the spikelet allows for better analysis of the plant's growth characteristics.

[0003] Traditional methods for extracting grains from the ear often rely on simple image processing techniques, such as grayscale thresholding or basic morphological operations. When processing 3D CT data, these methods often struggle to achieve efficient and accurate ear-grain separation due to problems such as blurred boundaries between grains and the ear axis and noise interference. Summary of the Invention

[0004] In view of this, the purpose of this application is to propose a method and device for extracting a single ear of grain based on three-dimensional CT data, which should solve or partially solve the above-mentioned technical problems.

[0005] To achieve the above objectives, this application provides a method for extracting a single ear of grain based on three-dimensional CT data, comprising:

[0006] Acquire three-dimensional CT data of plants, remove the stem region from the three-dimensional CT data of plants, and obtain three-dimensional data with stem removal;

[0007] The regions in the 3D data of the stalk with gray values ​​greater than or equal to the gray value threshold are retained, and the remaining regions are removed to obtain the 3D data of the ear of grains.

[0008] Connectivity analysis is performed on the three-dimensional data of the ear grains to obtain at least one connected region. Each connected region is matched with a corresponding label to obtain three-dimensional data with labels. Herein, one connected region corresponds to one ear grain region, and one ear grain region corresponds to one label.

[0009] From the labeled 3D data, extract individual grain portions based on the labels to obtain a single grain mask;

[0010] The individual grain mask is used to extract individual grains from the plant's three-dimensional CT data, resulting in a three-dimensional image of a single grain.

[0011] Based on the same inventive concept, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method described above when executing the computer program.

[0012] As can be seen from the above, the single ear grain extraction method and device based on three-dimensional CT data provided in this application can remove the stem region from the plant three-dimensional CT data to obtain stem-removed three-dimensional data, avoiding interference from the stem region on ear grain extraction. It also retains regions in the stem-removed three-dimensional data with gray values ​​greater than or equal to the gray value threshold, and removes the remaining regions, thereby obtaining accurate ear grain three-dimensional data. However, this ear grain three-dimensional data includes multiple ears of grain, which need to be analyzed using connectivity. Each connected region determined by connectivity analysis corresponds to an ear grain region, thereby matching these connected regions with corresponding labels, and using different labels to distinguish different ear grain regions. Then, the single ear grain part is extracted according to the label, thereby obtaining a single ear grain mask. The single ear grain mask is then used to extract accurate single ear grain three-dimensional images from the plant three-dimensional CT data, significantly improving the accuracy and stability of single ear grain three-dimensional image extraction, and facilitating phenotypic analysis and quality detection based on single ear grain three-dimensional images. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This is a flowchart illustrating a method for extracting a single grain from a spike based on three-dimensional CT data, as described in this application.

[0015] Figure 2 This is a schematic diagram of grayscale threshold separation according to an embodiment of this application;

[0016] Figure 3 This is a schematic diagram of connectivity analysis tagging in an embodiment of this application;

[0017] Figure 4 This is a schematic diagram illustrating noise filtering according to an embodiment of this application;

[0018] Figure 5 This is a schematic diagram of the expansion process in an embodiment of this application;

[0019] Figure 6 This is a flowchart illustrating the process of obtaining a three-dimensional image of a single ear of grain according to an embodiment of this application.

[0020] Figure 7 This is a structural block diagram of a single ear of grain extraction device based on three-dimensional CT data according to an embodiment of this application;

[0021] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.

[0023] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0024] Definitions:

[0025] CT: Computed Tomography.

[0026] YOLO: You Only Look Once, an object detection algorithm developed by Joseph Redmon et al., predicts bounding boxes and class probabilities directly from images using a single neural network, making it much faster than traditional two-stage object detection algorithms such as Faster R-CNN.

[0027] NMS: Non-Maximum Suppression.

[0028] CCA: Connected Component Analysis.

[0029] Voxel: short for volume pixel. Conceptually similar to the smallest unit in two-dimensional space—the pixel. Pixels are used in two-dimensional image data, while volume pixels are the smallest unit in three-dimensional space segmentation and are used in fields such as three-dimensional imaging and medical imaging.

[0030] With the rapid development of intelligent agriculture, 3D CT scanning technology has been widely used in agricultural research due to its advantages of non-destructive and high-resolution acquisition of plant internal structure data. Especially in rice breeding and phenotypic analysis, accurately extracting the morphology, structure, and grayscale information of individual grains (i.e., panicles) is of great significance for evaluating grain quality and optimizing breeding strategies. However, the complex structure of plants (e.g., rice plants), the adhesion of grains to non-grain parts such as stems and rachis, and the significant differences in grayscale between grains pose considerable challenges to the accurate extraction of individual grains.

[0031] Traditional grain extraction methods largely rely on simple image processing techniques, such as grayscale thresholding or basic morphological operations. When processing 3D CT data, these methods often struggle to achieve efficient and accurate grain separation due to issues such as blurred grain-column boundaries and noise interference. Furthermore, traditional methods are poorly adaptable to complex scenarios and have low processing efficiency, failing to meet the demands of modern agricultural research for high-throughput and precise phenotypic analysis. In recent years, advancements in image processing technologies, such as connected component analysis and mask matching strategies, have offered new possibilities for grain extraction. However, these technologies still do not fully utilize the spatial information and grayscale characteristics of 3D CT data, making it difficult to achieve efficient and accurate extraction of individual grains in complex scenarios.

[0032] The embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0033] The single grain extraction method based on three-dimensional CT data proposed in the embodiments of this application is mainly implemented for three-dimensional CT data of various plants with grains, especially three-dimensional CT data of cereal plants (e.g., rice, wheat, or buckwheat).

[0034] like Figure 1 As shown, this method is applied to data analysis devices (such as terminal devices or servers) and includes:

[0035] Step 101: Obtain plant 3D CT data, remove the stem region from the plant 3D CT data, and obtain stem-removed 3D data.

[0036] In practice, CT equipment is used to perform tomographic scanning on the corresponding plants to obtain three-dimensional CT data of the plants, and data analysis equipment can obtain the three-dimensional CT data of the plants from the CT equipment.

[0037] To avoid interference from the stem region, the stem region was removed from the plant's 3D CT data, leaving only the grain region, ensuring that the resulting 3D data with stem removal was suitable for subsequent grain extraction.

[0038] Step 102: In the 3D data of the stalk, retain the regions with gray values ​​greater than or equal to the gray value threshold, and remove the remaining regions to obtain the 3D data of the ear of grains (e.g., ...). Figure 2 (As shown).

[0039] In practice, since the gray value of the grains is high, a gray value threshold is set in advance to extract the area with a gray value greater than or equal to the gray value threshold, so as to avoid interference from non-grain parts and remove the non-grain parts, thereby obtaining more accurate three-dimensional data of the grains containing the grains.

[0040] Step 103: Perform connectivity analysis on the three-dimensional data of the ear of grains to obtain at least one connected region. Match the corresponding label to each connected region to obtain labeled three-dimensional data (e.g., ...). Figure 3 (as shown in the figure). In this figure, a connected region corresponds to a grain region, and a grain region corresponds to a label.

[0041] In practice, in order to accurately identify the grains in the ear, connectivity analysis is performed on the three-dimensional data of the ear grains, then connected regions are determined, and each connected region is marked with its corresponding unique label, finally obtaining three-dimensional data with labels.

[0042] The labeled 3D data may also contain noise, which needs to be filtered to obtain the noise-filtered labeled 3D data (e.g., Figure 4 (As shown).

[0043] Step 104: Extract individual grain portions from the labeled 3D data according to the labels to obtain a single grain mask.

[0044] In practice, since each ear of grains corresponds to a unique label, each ear of grains with the same label can be extracted to obtain a single ear of grain mask. The number of single ear of grain masks corresponds to the number of ear of grains. Furthermore, each ear of grain mask is marked with its corresponding position in the plant's 3D CT data, facilitating subsequent position mapping.

[0045] Step 105: Use the single ear mask to extract individual ears of grain from the plant's three-dimensional CT data to obtain a three-dimensional image of a single ear of grain.

[0046] In practice, since each individual grain mask is marked with its corresponding position in the plant's 3D CT data, the intersection of the individual grain mask and the corresponding 3D CT data of the plant can be performed, and the superimposed portion can be extracted as the 3D image of the individual grain corresponding to that individual grain mask. After all individual grain masks have been extracted, the 3D image of each individual grain can be obtained.

[0047] The above scheme can remove the stem region from the plant's 3D CT data to obtain stem-removed 3D data, avoiding interference from the stem region in grain extraction. It also retains regions with gray values ​​greater than or equal to a gray value threshold in the stem-removed 3D data, while removing the remaining regions, thus obtaining accurate grain 3D data. However, this grain 3D data includes multiple grains, requiring connectivity analysis. Each connected region determined by connectivity analysis corresponds to a grain region, and these connected regions are matched with corresponding labels to distinguish different grain regions. Then, individual grain portions are extracted based on the labels, resulting in individual grain masks. These individual grain masks are then used to extract accurate individual grain 3D images from the plant's 3D CT data, significantly improving the accuracy and stability of individual grain 3D image extraction, facilitating phenotypic analysis and quality detection based on individual grain 3D images.

[0048] In some embodiments, step 101 includes:

[0049] Step 1011: Obtain plant 3D CT data, and perform slicing processing on the plant 3D CT data to obtain multiple slice images.

[0050] In practice, to facilitate image analysis, the plant's 3D CT data needs to be sliced, thereby reducing the 3D data to multiple 2D slice images. Slicing can be longitudinal or transverse, with transverse slicing being preferred to preserve the spatial characteristics of the grains.

[0051] In a preferred embodiment, step 1011 includes:

[0052] Step 10111: Acquire plant 3D CT data, and perform artifact removal processing on the plant 3D CT data to obtain artifact-removed 3D data (e.g., ...). Figure 2 (As shown).

[0053] In practice, the original 3D CT data of plants may contain artifacts that affect subsequent stem identification. Therefore, it is necessary to remove these artifacts from the 3D CT data first. Specific removal methods can include median filtering or threshold-based binarization. This results in clearer 3D data after artifact removal.

[0054] Step 10112: The artifact-free 3D data is sliced ​​to obtain multiple 2D slice images.

[0055] In practice, since the target detection model processes two-dimensional images, it is necessary to slice the three-dimensional data after removing artifacts to obtain multiple two-dimensional slice images, and save these slice images in the form of grayscale images.

[0056] The above method can remove the influence of artifacts in plant 3D CT data and ensure the clarity of the final multiple 2D slice images.

[0057] In some embodiments, step 10111 includes:

[0058] Step 101111: Determine at least two thresholds corresponding to the three-dimensional CT data of the plant using a multi-threshold determination method.

[0059] In practice, the multi-threshold determination method can utilize the multithresh function to calculate at least two thresholds. For example, selecting two thresholds (T1, T2), the formula is: T = multithresh(I, 2) = (T1, T2), where T is the set of two thresholds, and I is the threshold value. It belongs to the three-dimensional CT data of plants. x, y, and z are the three-dimensional coordinates of the three-dimensional coordinate system constructed based on the three-dimensional CT data of plants.

[0060] The `multithresh` function is an image segmentation function in MATLAB, used to determine multiple thresholds for segmentation based on an image.

[0061] Step 101112: Select the highest threshold from at least two thresholds as the segmentation threshold, and use the segmentation threshold to perform binarization processing on the plant three-dimensional CT data to obtain a binary mask.

[0062] In practice, the highest threshold will be selected from at least two thresholds. As a segmentation threshold, the 3D CT data of the plant is binarized to obtain a binary mask. This includes the white plant parts with a pixel value of 1, and the black background parts with a pixel value of 0.

[0063] For example, the specific formula is as follows:

[0064] .

[0065] Step 101113: Intersect the binary mask with the plant 3D CT data to obtain artifact-free 3D data (e.g., ...). Figure 2 (As shown).

[0066] In practice, the intersection of a binary mask and the 3D CT data of the plant is performed (i.e., element-wise multiplication) to obtain the artifact-free 3D data. The formula is as follows:

[0067] .

[0068] The above method can obtain an accurate binary mask, which can then be used to remove artifacts in the 3D CT data of plants, ensuring that the 3D data after artifact removal is clearer and more accurate.

[0069] In some embodiments, step 10112 includes:

[0070] Step 101121: The artifact-removed 3D data is sliced ​​according to a predetermined slice scale or a predetermined number of slices to obtain multiple initial slice images.

[0071] In practice, slicing can be done according to a predetermined slice scale or a predetermined number of slices, resulting in P initial slice images. For each initial slice image... Where k is the sequence number. .

[0072]

[0073] .

[0074] in, Let k be the pixel matrix of the initial slice image corresponding to the index k. The size of the pixel matrix of the initial slice image is M×N (where M and N are both integers, M is the number of horizontally arranged pixels and N is the number of vertically arranged pixels). It is a matrix composed of the initial slice images.

[0075] Step 101122: Perform grayscale processing on the multiple initial slice images to obtain multiple two-dimensional slice images.

[0076] The above method ensures that the obtained initial slice image can accurately represent the morphological characteristics of the plant, making the slice image after grayscale processing clearer and more accurate.

[0077] Step 10112: Use the pre-trained target detection model to identify and analyze each slice image, determine the stem region, remove the stem region from each slice image, and obtain a stem-removed image corresponding to each slice image.

[0078] In practice, the target detection model is the YOLO model (e.g., YOLOv11), which can identify the stem region in the image after pre-training. This target detection model can only perform recognition processing on two-dimensional images, which is why the slicing process in step 10111 above is required.

[0079] Step 10113: Combine all the images of the plant stems removed to obtain the three-dimensional data of the stem removal.

[0080] In practice, all stem removal images are combined in the order of their corresponding positions to form three-dimensional stem removal data.

[0081] The above method can effectively remove the stalk area, thus avoiding the impact of the stalk area on grain extraction.

[0082] The training process of the target detection model includes:

[0083] Step A1: Obtain sample slice images with the stem regions marked.

[0084] In practice, multiple sample plant 3D CT data are acquired, and each sample plant 3D CT data is sliced ​​to obtain multiple sample slice images corresponding to each sample plant 3D CT data to form a sample set, thus obtaining multiple sample sets.

[0085] For each sample set, the stem region in each slice image of the sample set can be manually labeled.

[0086] Step A2: Perform data augmentation processing on the sample slice image to obtain an augmented sample slice image; wherein the data augmentation processing includes at least one of random scaling, random cropping, or random rotation.

[0087] In practice, since the number of manually labeled sample slice images is small, they need to be amplified. Each sample slice data can be amplified into multiple samples by following the corresponding data amplification processing method, thereby increasing the number of sample slice images.

[0088] Step A3: The initial detection model is trained using the amplified sample slice image, and the parameter update value is determined by backpropagation based on the labeled stem region. The parameter update value is then used to adjust the parameters of the initial detection model to obtain the parameter-adjusted detection model.

[0089] In practice, an initial detection model is pre-built, and each amplified sample slice image is trained to obtain an output result, which refers to the stem region in the amplified sample slice image. Here, the amplified sample slice image refers to both the aforementioned sample slice data and the amplified sample slice image.

[0090] By comparing the output results with the labeled stem regions in the amplified sample slice image, the corresponding loss function is determined, the loss value is calculated, and the adjustment gradient is determined based on the loss value. Then, the parameters of the initial model are adjusted according to the adjustment gradient to obtain the parameter-adjusted detection model. For example, the specific formula is: ,in, Indicates the parameters of the initial model. It's the learning rate. This indicates adjusting the gradient.

[0091] Step A4: Determine that the parameter-adjusted detection model meets the training termination condition, and use the final parameter-adjusted detection model as the target detection model.

[0092] In practice, the training termination condition is met if all amplified sample slice images have been trained, or if the accuracy of the parameter-adjusted detection model in identifying stem regions in the image exceeds a predetermined threshold, or if the convergence value of the loss function corresponding to the parameter-adjusted detection model is less than a predetermined convergence threshold. The final parameter-adjusted detection model is then used as the target detection model, which is capable of identifying stem regions in the image.

[0093] The above scheme can increase the number of sample slice images through amplification, thereby obtaining a large number of amplified sample slice images. This allows for sufficient samples to train the initial detection model, ensuring that the target detection model obtained after training has higher accuracy.

[0094] In some embodiments, step 1012, for each of the slice images, specifically includes:

[0095] Step 10121: Using the pre-trained target detection model, identify the stalk target in the slice image and determine at least one anchor frame position of the stalk target.

[0096] In practice, the target detection model has the ability to identify stalk targets in an image, thus enabling the determination of one or more anchor frame positions for each stalk target.

[0097] The anchor frame position is represented as ( x 1 ,y 1 ,x 2 ,y 2), of which ( x 1 ,y 1) is the coordinate of the top left corner of the anchor rectangle. x 2 ,y 2) are the coordinates of the lower right corner of the anchor frame rectangle.

[0098] Step 10122: Use the non-maximum suppression method (NMS) to determine the redundant anchor frame positions for each anchor frame position, remove the redundant anchor frame positions, and use the anchor frames after removing redundancy as stem anchor frames.

[0099] In practice, if a stalk target corresponds to multiple anchor frame positions, and each anchor frame position corresponds to a confidence level, then non-maximum suppression (NMS) needs to be used to process multiple anchor frame positions. The process is as follows:

[0100] (1) Sort the multiple anchor box positions of a stalk target according to the confidence level, select the anchor box position with the highest confidence level as the current selection box, and add it to the final detection result.

[0101] (2) Calculate the overlap between the remaining anchor box positions and the current selection box.

[0102] (3) If the overlap is greater than the set threshold, it is determined that the remaining anchor box position has a high overlap with the current selection box, indicating that it is the same object, and the remaining anchor box position will be removed as a redundant anchor box position.

[0103] (4) Repeat steps (1) to (3) above for the remaining anchor frame positions after removal until all anchor frame positions have been processed. Finally, the accurate stem anchor frame of the stem target is obtained.

[0104] Step 10123: Remove the area corresponding to the stem anchor frame in the slice image to obtain the stem-removed image corresponding to the slice image.

[0105] In practice, the pixel value of the stem anchor frame can be set to 0 (black) to remove the stem anchor frame.

[0106] By using the above method, redundancy can be accurately removed from multiple anchor frame positions for each stalk target, avoiding overlapping anchor frame positions from affecting the determination of the stalk region, thereby obtaining accurate stalk anchor frames and ensuring the accuracy of stalk anchor frame removal from slice images.

[0107] In some embodiments, step 102 includes:

[0108] Step 1021: Determine the gray value of each voxel in the 3D data of the stem removal, set the gray value of voxels with gray values ​​greater than or equal to the gray value threshold to 1, and set the gray value of voxels with gray values ​​less than the gray value threshold to 0, to obtain the binarized mask data.

[0109] In practice, the three-dimensional data for stem removal is as follows: Its value is a grayscale value ranging from 0 to 255. The physical meaning of grayscale value is density distribution, with a dimension of . . Represents the number of rows in the matrix. Represents the number of columns in the matrix. Represents depth.

[0110] Step 1022: The three-dimensional data of the stalk removal is intersected with the binarized mask data to obtain the three-dimensional data of the ear grains.

[0111] In practice, due to the small spacing between grains in the ear, they are prone to sticking together and difficult to separate. However, the outer part of the ear has a low density, which is reflected in the 3D data of stalk removal as a low gray value, while the inner part has a high density and a high gray value. Therefore, a gray value threshold is set to remove voxels with gray values ​​less than the gray value threshold in the 3D data of stalk removal, thereby achieving the effect of ear-grain separation.

[0112] The specific formula is as follows: ,in, Represents the three-dimensional data of the ear and grains. It is an indicator function. Its value is 1 when the condition that the gray value is less than the gray value threshold is met, and 0 otherwise. T is the gray value threshold.

[0113] The above method can accurately remove areas with gray values ​​less than the gray value threshold, thereby ensuring that each grain in the obtained three-dimensional data of the ear grains has a good separation effect and avoids mutual adhesion affecting the extraction of the ear grains.

[0114] In some embodiments, step 103 includes:

[0115] Step 1031: Perform connectivity analysis on the three-dimensional data of the ear grains to obtain multiple initial connected regions. Use a labeling function to label each initial connected region and assign a corresponding initial label to each initial connected region.

[0116] In specific implementation, the three-dimensional data of the ear and grain are used. Given a matrix of size M×N×P, connectivity analysis yields multiple initial connected regions. Then, a labeling function (e.g., the `bwlabel` function in MATLAB) is used to label each initial connected region based on its connectivity, resulting in a label matrix. ,satisfy ,in, c It represents the number of initial connected components, with each initial connected component corresponding to a unique initial label. .

[0117] Step 1032: Determine the volume of each initial connected region, and select initial connected regions whose volume is greater than or equal to the volume threshold as connected regions.

[0118] In practice, the volume of the initial connected region is the total number of voxels corresponding to the initial labels in that initial connected region, calculated using the following formula: .

[0119] Then, filter by volume. Greater than or equal to the volume threshold The initial connected region (i.e., And determine its corresponding set of indices, specifically: .in, It is a positive integer.

[0120] For example, if there are 5 connected components (indexed as 1, 2, 3, 4, 5), and ( ),and( ),So: , ,in, For set K The number of elements in the text.

[0121] Step 1033: Re-match the corresponding label to each of the obtained connected regions to obtain labeled 3D data.

[0122] In practice, only the initial labels of the initial connected regions that belong to the connected components are retained, and these are then renumbered. The specific formula is as follows:

[0123]

[0124] in, This is a renumbering mapping function.

[0125] The above method can remove small initial connected regions, avoiding the influence of some noise or irrelevant regions, and ensuring the accuracy of grains in the obtained labeled three-dimensional data.

[0126] In some embodiments, step 104 includes:

[0127] Step 1041: Dilate the labeled 3D data to obtain dilated 3D data (e.g., ...). Figure 5 (As shown).

[0128] Step 1042: Extract the region corresponding to the same label from the expanded three-dimensional data to obtain a single grain mask (e.g., ...). Figure 6 (As shown).

[0129] In practice, in order to restore the volume and grayscale intensity of each ear of grain, it is necessary to dilate the labeled 3D data, and then extract individual ears of grain according to the labels from the dilated 3D data to obtain an accurate mask for each ear of grain.

[0130] The above method ensures that the mask for each individual ear of grain is more accurate.

[0131] In some embodiments, step 104 includes:

[0132] Step 1041': Extract the region corresponding to the same label from the labeled 3D data to obtain a single initial ear of grain mask.

[0133] In practice, the formula for extracting the mask of a single initial ear of grain is as follows:

[0134] .

[0135] in, For a single initial ear of grain mask, the gray value representing the gray intensity in the single initial ear of grain mask is compared with the corresponding label value. Replacement.

[0136] Step 1042': Dilate the single initial ear mask to obtain a single ear mask.

[0137] In practice, in order to restore the volume and grayscale intensity of each ear of grain, the initial ear of grain mask is expanded to obtain a more accurate individual ear of grain mask.

[0138] The above method ensures that the mask for each individual ear of grain is more accurate.

[0139] In some embodiments, tagged 3D data or a single initial grain mask is used as the object to be processed;

[0140] The expansion process includes:

[0141] Step B1: Construct a structural element and use the structural element to traverse the object to be processed; wherein the structural element is a three-dimensional structure.

[0142] In practical implementation, structural elements It is a three-dimensional structure (e.g., a 3×3×3 three-dimensional structure), the shape and size of which can be defined according to actual needs.

[0143] Step B2: During the traversal, determine the voxels that fall into the structuring element of the object to be processed.

[0144] In practice, each voxel in the object to be processed is used as the center point of the structuring element, and the process is traversed to determine the voxels that fall into the structuring element.

[0145] Step B3: In response to the presence of a grain voxel in the falling voxel, the central voxel where the structural element is located is set to a foreground value; or, in response to the absence of a grain voxel in the falling voxel, the central voxel where the structural element is located is set to a background value.

[0146] In practice, as long as there is a grain voxel in the falling voxel within the structural element, the corresponding center point will be set to the foreground value (e.g., set to 1 for white), thereby expanding (inflating) the grain portion.

[0147] The specific formula is as follows: .

[0148] in, This represents the image after dilation. Therefore The structural element after the center is translated. Represents structural element The non-zero part has at least one point that is related to the object to be processed. The grain regions of the ear overlap.

[0149] Step B4: Determine that all objects to be processed have been traversed by the structuring elements to obtain the final dilation processing result; wherein, the dilation processing result corresponding to the labeled 3D data is the dilated 3D data, or the dilation processing result corresponding to a single initial ear of grain mask is a single ear of grain mask.

[0150] The above method yields a final expansion treatment result that better matches the actual size of the grains in the ear, ensuring that the individual grain mask obtained from the expansion treatment result is more accurate.

[0151] In some embodiments, step 105 includes:

[0152] The position of the label corresponding to the single ear grain mask is determined, and the intersection of the single ear grain mask with the region of the corresponding label in the plant 3D CT data is performed. The overlapping part is retained and the remaining part is removed to obtain a 3D image of a single ear grain (e.g., Figure 6 (As shown).

[0153] In practice, a single ear of grain is used as the foreground region and a logical AND operation is performed with the plant's 3D CT data to preserve the portion of the single ear of grain that overlaps with the plant's 3D CT data. This limits the excessive boundary expansion that may be introduced by the expansion process in the single ear of grain, ensuring that the geometric shape and voxel information of the ear of grain are the same as the original plant 3D CT data. This can be represented as:

[0154] ,in Represents 3D CT data of plants. This represents a tagged mask for a single ear of grain after grayscale thresholding. This represents a three-dimensional image of a single ear of grains, preserving the grayscale values, i.e., the true density distribution characteristics, from the original three-dimensional CT data of the plant.

[0155] The above method can accurately obtain a three-dimensional image of a single ear of grains, and then perform analysis and processing of the ear of grains based on the three-dimensional image of the single ear of grains.

[0156] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.

[0157] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0158] Based on the same inventive concept, corresponding to any of the above embodiments, this application also provides a single ear grain extraction device based on three-dimensional CT data.

[0159] refer to Figure 7 The device includes:

[0160] The stem removal module 201 is configured to acquire plant 3D CT data, remove the stem region from the plant 3D CT data, and obtain stem removal 3D data.

[0161] The grayscale separation module 202 is configured to retain the regions in the stalk removal three-dimensional data with grayscale values ​​greater than or equal to the grayscale threshold, and remove the remaining regions to obtain the ear grain three-dimensional data.

[0162] The connectivity analysis module 203 is configured to perform connectivity analysis on the three-dimensional data of the ear grains to obtain at least one connected region, and to match a corresponding label for each connected region to obtain three-dimensional data with labels; wherein, one connected region corresponds to one ear grain region, and one ear grain region corresponds to one label.

[0163] The ear-grain mask determination module 204 is configured to extract a single ear-grain portion from the labeled three-dimensional data according to the label to obtain a single ear-grain mask;

[0164] The single ear grain extraction module 205 is configured to extract single ears grains from the plant three-dimensional CT data using the single ear grain mask to obtain a single ear grain three-dimensional image.

[0165] In some embodiments, the grayscale separation module 202 is specifically configured as follows:

[0166] Determine the gray value of each voxel in the 3D data of the stem removal, set the gray value of voxels with gray values ​​greater than or equal to the gray value threshold to 1, and set the gray value of voxels with gray values ​​less than the gray value threshold to 0, to obtain the binarized mask data.

[0167] The three-dimensional data of the ear grains is obtained by intersecting the stalk removal three-dimensional data with the binarized mask data.

[0168] In some embodiments, the connectivity analysis module 203 is specifically configured as follows:

[0169] Connectivity analysis was performed on the three-dimensional data of the ear and grain to obtain multiple initial connected regions. Each initial connected region was labeled using a labeling function, and a corresponding initial label was assigned to each initial connected region.

[0170] Determine the volume of each initial connected region, and select initial connected regions whose volume is greater than or equal to the volume threshold as connected regions;

[0171] The corresponding labels are then matched to each of the obtained connected regions to obtain labeled 3D data.

[0172] In some embodiments, the grain mask determination module 204 is specifically configured as follows:

[0173] The labeled 3D data is dilated to obtain dilated 3D data;

[0174] The regions corresponding to the same label are extracted from the expanded three-dimensional data to obtain a single ear of grain mask.

[0175] In some embodiments, the grain mask determination module 204 is specifically configured as follows:

[0176] The region corresponding to the same label in the labeled 3D data is extracted to obtain a single initial ear of grain mask;

[0177] The single initial ear mask is expanded to obtain a single ear mask.

[0178] In some embodiments, tagged 3D data or a single initial grain mask is used as the object to be processed;

[0179] The expansion process includes:

[0180] Construct a structural element and use the structural element to traverse the object to be processed; wherein the structural element is a three-dimensional structure;

[0181] During the traversal, the falling voxels within the structuring element of the object to be processed are determined;

[0182] In response to the presence of a grain voxel in the falling voxel, the central voxel where the structural element is located is set to a foreground value; or, in response to the absence of a grain voxel in the falling voxel, the central voxel where the structural element is located is set to a background value.

[0183] The process determines that all objects to be processed have been traversed by the structuring elements, and obtains the final dilation result; wherein, the dilation result corresponding to the labeled 3D data is the dilated 3D data, or the dilation result corresponding to a single initial ear of grain mask is a single ear of grain mask.

[0184] In some embodiments, the single ear grain extraction module 205 is specifically configured as follows:

[0185] The position of the label corresponding to the single ear of grain is determined, and the area of ​​the single ear of grain mask intersects with the area of ​​the corresponding label position in the plant 3D CT data. The overlapping part is retained and the remaining part is removed to obtain a 3D image of a single ear of grain.

[0186] In some embodiments, the stem removal module 201 is specifically configured as follows:

[0187] Acquire three-dimensional CT data of plants, and perform slicing processing on the three-dimensional CT data of plants to obtain multiple slice images;

[0188] The pre-trained target detection model is used to identify and analyze each slice image to determine the stem region. The stem region in each slice image is then removed to obtain a stem-removed image corresponding to each slice image.

[0189] The images of all the plant stems removed are combined to obtain the three-dimensional data of the stem removal.

[0190] In some embodiments, the stem removal module 201 is further configured to:

[0191] For each of the sliced ​​images:

[0192] The pre-trained target detection model is used to identify the stalk target in the slice image and determine at least one anchor frame position of the stalk target.

[0193] The redundant anchor frame positions are determined using the non-maximum suppression method for each anchor frame position. The redundant anchor frame positions are removed, and the anchor frames after removing redundancy are used as stem anchor frames.

[0194] Remove the area corresponding to the stem anchor frame in the slice image to obtain the stem-removed image corresponding to the slice image.

[0195] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.

[0196] The apparatus of the above embodiments is used to implement the corresponding method in any of the foregoing embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0197] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the methods described in any of the above embodiments.

[0198] Figure 8 This embodiment illustrates a more specific hardware structure of an electronic device. The device may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.

[0199] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0200] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0201] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0202] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0203] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.

[0204] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0205] The electronic devices described above are used to implement the corresponding methods in any of the foregoing embodiments and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0206] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to perform the methods described in any of the above embodiments.

[0207] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital video disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0208] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to perform the methods described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0209] Based on the same concept, corresponding to any of the above embodiments, this application also provides a computer program product, including computer program instructions, which, when run on a computer, cause the computer to perform the method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0210] It is understood that before using the technical solutions of the various embodiments in this application, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.

[0211] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations described in this application.

[0212] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0213] It is understood that the above notification and user authorization process is merely illustrative and does not limit the implementation of this application. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this application.

[0214] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.

[0215] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0216] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0217] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.

Claims

1. A method for extracting a single ear of grain based on three-dimensional CT data, characterized in that, include: Acquire three-dimensional CT data of plants, and perform slicing processing on the three-dimensional CT data of plants to obtain multiple slice images; For each slice image, a pre-trained target detection model is used to identify the stalk target in the slice image and determine at least one anchor frame position of the stalk target. The redundant anchor frame positions are determined using the non-maximum suppression method for each anchor frame position. The redundant anchor frame positions are removed, and the anchor frames after removing redundancy are used as stem anchor frames. Remove the area corresponding to the stem anchor frame in the slice image to obtain the stem-removed image corresponding to the slice image; Combine all the images of the plant with stems removed to obtain the three-dimensional data of stem removal; The regions in the 3D data of the stalk with gray values ​​greater than or equal to the gray value threshold are retained, and the remaining regions are removed to obtain the 3D data of the ear of grains. Connectivity analysis is performed on the three-dimensional data of the ear grains to obtain at least one connected region. Each connected region is matched with a corresponding label to obtain three-dimensional data with labels. Herein, one connected region corresponds to one ear grain region, and one ear grain region corresponds to one label. From the labeled 3D data, extract individual grain portions based on the labels to obtain a single grain mask; The individual grain mask is used to extract individual grains from the plant's three-dimensional CT data, resulting in a three-dimensional image of a single grain.

2. The method according to claim 1, characterized in that, The step of retaining regions with gray values ​​greater than or equal to a gray value threshold in the 3D data of the stalk and removing the remaining regions to obtain the 3D data of the ear of grains includes: Determine the gray value of each voxel in the 3D data of the stem removal, set the gray value of voxels with gray values ​​greater than or equal to the gray value threshold to 1, and set the gray value of voxels with gray values ​​less than the gray value threshold to 0, to obtain the binarized mask data. The three-dimensional data of the ear grains is obtained by intersecting the stalk removal three-dimensional data with the binarized mask data.

3. The method according to claim 1, characterized in that, The connectivity analysis of the three-dimensional data of the ear of grains yields at least one connected region. Each connected region is then matched with a corresponding label to obtain labeled three-dimensional data, including: Connectivity analysis was performed on the three-dimensional data of the ear and grain to obtain multiple initial connected regions. Each initial connected region was labeled using a labeling function, and a corresponding initial label was assigned to each initial connected region. Determine the volume of each initial connected region, and select initial connected regions whose volume is greater than or equal to the volume threshold as connected regions; The corresponding labels are then matched to each of the obtained connected regions to obtain labeled 3D data.

4. The method according to claim 1, characterized in that, The step of extracting a single grain portion from the labeled 3D data based on the label to obtain a single grain mask includes: The labeled 3D data is dilated to obtain dilated 3D data; The regions corresponding to the same label are extracted from the expanded three-dimensional data to obtain a single ear of grain mask.

5. The method according to claim 1, characterized in that, The step of extracting a single grain portion from the labeled 3D data based on the label to obtain a single grain mask includes: The region corresponding to the same label in the labeled 3D data is extracted to obtain a single initial ear of grain mask; The single initial ear mask is expanded to obtain a single ear mask.

6. The method according to claim 4 or 5, characterized in that, Use labeled 3D data or a single initial ear of grain mask as the object to be processed; The expansion process includes: Construct a structural element and use the structural element to traverse the object to be processed; wherein the structural element is a three-dimensional structure; During the traversal, the falling voxels within the structuring element of the object to be processed are determined; In response to the presence of a grain voxel in the falling voxel, the central voxel where the structural element is located is set to a foreground value; or, in response to the absence of a grain voxel in the falling voxel, the central voxel where the structural element is located is set to a background value. The process determines that all objects to be processed have been traversed by the structuring elements, and obtains the final dilation result; wherein, the dilation result corresponding to the labeled 3D data is the dilated 3D data, or the dilation result corresponding to a single initial ear of grain mask is a single ear of grain mask.

7. The method according to claim 1, characterized in that, The step of extracting individual grains from the plant's three-dimensional CT data using the individual grain mask to obtain a three-dimensional image of a single grain includes: The position of the label corresponding to the single ear of grain is determined, and the area of ​​the single ear of grain mask intersects with the area of ​​the corresponding label position in the plant 3D CT data. The overlapping part is retained and the remaining part is removed to obtain a 3D image of a single ear of grain.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Nondestructive monitoring method for growth and development of ears of gramineous crops

    CN114092376A

  • Corn ear phenotype analysis method, device and equipment

    CN119228834A