Object recognition method and device in three-dimensional image, electronic equipment and storage medium
By performing morphological operations, segmentation and downsampling on three-dimensional images, combining clustering and data feature optimization, efficient identification of objects in three-dimensional images is achieved, and the problems of low recognition accuracy and time-consuming in the prior art are solved.
Patent Information
- Application Number
- CN202411479338.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2024-12-31
AI Technical Summary
In the prior art, the three-dimensional image object recognition accuracy is low and time-consuming, making it difficult to provide timely assistance to medical staff.
By obtaining three-dimensional images and segmentation thresholds, morphological operations, image segmentation and voxel downsampling are performed, clustering processing, data feature optimization, and voxel upsampling is performed to identify the object to be identified.
The recognition accuracy and efficiency of objects to be identified in three-dimensional images are improved, the amount of data for clustering and optimization processing is reduced, and the processing time is shortened.
Smart Images

Figure CN119229153A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method, device, electronic device and storage medium for object recognition in a three-dimensional image. Background Art
[0002] With the continuous development of computer technology and other technologies, medical equipment can collect medical images of patients. By analyzing the medical images, it can provide great help for medical staff and patients to understand their condition.
[0003] For example, depending on the patient's condition, medical staff sometimes need to implant metal, such as screws, in the patient's body to fix the patient's joints or fracture ends. In order to evaluate the treatment effect and the stability of the implant and provide rehabilitation guidance to the patient, it is necessary to analyze the medical images of the implant in the patient's body to identify the location and shape of the implant. However, when analyzing medical images, due to the influence of the resolution and noise of the medical images, it is difficult to identify the implant. If complex feature extraction and machine learning methods are used, it will take a long time and it is difficult to provide timely help to medical staff. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention provide a method, device, electronic device and storage medium for object recognition in three-dimensional images, which are used to solve the problems of low accuracy and long time consumption in object recognition of three-dimensional images in the prior art.
[0005] According to one aspect of an embodiment of the present invention, a method for processing a three-dimensional image is provided, the method comprising: obtaining a three-dimensional image and a segmentation threshold of the three-dimensional image, the three-dimensional image comprising a plurality of voxel points, and the three-dimensional image comprising at least one object to be identified; performing a first morphological operation on the three-dimensional image to obtain a first processed image; performing image segmentation and voxel downsampling on the first processed image based on the segmentation threshold to obtain a first downsampled image; performing clustering on the voxel points in the first downsampled image to obtain a plurality of candidate clustering clusters; performing optimization on the plurality of candidate clustering clusters based on their data features to obtain a plurality of valid clustering clusters; performing voxel upsampling on the plurality of valid clustering clusters to obtain a recognition result of at least one of the objects to be identified.
[0006] In some embodiments, the data features of multiple candidate clusters are optimized to obtain multiple valid clusters, including: judging whether each candidate cluster is adhered based on the first voxel feature of each candidate cluster, and segmenting any candidate cluster that is adhered; wherein the first voxel feature of the candidate cluster includes the number of voxels of the candidate cluster, the size of the candidate cluster in the height direction and the non-main direction of the axis-aligned bounding box, and the non-main direction is the direction with the smallest average size in the length direction and the width direction of the axis-aligned bounding box.
[0007] In some embodiments, judging whether each of the candidate clusters is adhered includes: based on statistical information and prior knowledge, determining a first candidate cluster and a second candidate cluster from a plurality of the candidate clusters, wherein the number of voxels of the first candidate cluster is greater than a voxel threshold, and the size in the height direction is greater than a height threshold, and the size in the non-main direction is greater than a size threshold; the second candidate cluster is any candidate cluster among the plurality of candidate clusters except the first candidate cluster; judging whether the first candidate cluster is adhered according to the size of the first candidate cluster in the height direction, the size ratio of the first candidate cluster to the second candidate cluster in the height direction, and the size ratio of the axis-aligned bounding box of the first candidate cluster in the non-main direction to the size of the first candidate cluster in the height direction.
[0008] In some embodiments, any candidate clustering cluster that is adhered is segmented, including: sorting the multiple candidate clustering clusters in descending order of the number of voxels; performing secondary clustering on the first N candidate clustering clusters to obtain multiple secondary clustering clusters, and if the number of secondary clustering clusters is greater than N, replacing the first N candidate clustering clusters with the multiple secondary clustering clusters, wherein N is a positive integer less than the number of clusters of the multiple candidate clustering clusters.
[0009] In some embodiments, the multiple candidate clustering clusters are optimized based on their data features to obtain multiple valid clustering clusters, including: judging whether there is a break between each of the candidate clustering clusters based on their second voxel features, and merging any two candidate clustering clusters when a break occurs between any two candidate clustering clusters; wherein the second voxel features of the multiple candidate clustering clusters include any one or more of the sizes of the directional bounding boxes of each of the candidate clustering clusters in the height direction, the main direction and the non-main direction, the distance between the directional bounding boxes of each of the candidate clustering clusters in the height direction and the non-main direction, and the size of the directional bounding box of the cluster after any two candidate clustering clusters are merged in the non-main direction, wherein the non-main direction is the direction with the smallest average size in the length direction and the width direction of the directional bounding box of the candidate clustering cluster.
[0010] In some embodiments, the multiple candidate clustering clusters are optimized based on their data features to obtain multiple valid clustering clusters, including: judging whether a break occurs between the multiple candidate clustering clusters based on their third voxel features, and merging any two candidate clustering clusters when a break occurs between any two candidate clustering clusters; wherein the third voxel features of the multiple candidate clustering clusters include the centroid of each candidate clustering cluster, the distance between the centroids of each candidate clustering cluster, the axis-aligned bounding box of each candidate clustering cluster, and any one or more of the feature vectors in the main direction of the axis-aligned bounding box of each candidate clustering cluster, and the main direction of the axis-aligned bounding box is the direction with the smallest average size in the length and width directions of the axis-aligned bounding box.
[0011] In some embodiments, the method further includes: performing a second morphological operation on the three-dimensional image to obtain a second processed image; and performing image segmentation and downsampling on the second processed image based on the segmentation threshold to obtain a second downsampled image.
[0012] In some embodiments, the optimizing process based on the data features of the plurality of candidate clustering clusters to obtain the plurality of valid clustering clusters also includes: screening the plurality of candidate clustering clusters based on the data features of the plurality of candidate clustering clusters and the data features of the second downsampled image to obtain the plurality of valid clustering clusters.
[0013] In some embodiments, based on the data features of the multiple candidate clustering clusters and the data features of the second downsampled image, the multiple candidate clustering clusters are screened and processed to obtain the multiple valid clustering clusters, including: for each candidate clustering cluster, determining the number of voxels of the candidate clustering cluster, the first number of voxels of the second downsampled image within the bounding box of the candidate clustering cluster, and the second number of voxels within the bounding box of the candidate clustering cluster, wherein the bounding box is an axis-aligned bounding box or a directional bounding box; if the number of voxels of the candidate clustering cluster is greater than a preset number, and the ratio of the first number of voxels to the second number of voxels is less than a preset number ratio, then deleting the candidate clustering cluster, and the preset number ratio is a real number greater than 0 and less than 1.
[0014] In some embodiments, after obtaining a plurality of valid clusters, the method further comprises: performing voxel supplementation on each of the valid clusters based on the three-dimensional image.
[0015] In some embodiments, the voxel supplementation of each of the valid clusters based on the three-dimensional image includes: determining, among the multiple valid clusters, a first valid cluster whose size in the main direction of the directional bounding box is less than a preset size threshold, and a second valid cluster other than the first valid cluster, wherein the preset size threshold is less than the maximum size in the main direction of the directional bounding box of each of the multiple valid clusters; performing voxel supplementation on the first valid cluster using voxel data in the first voxel data that is within the directional bounding box of the first valid cluster; the first voxel data is obtained by performing a closing operation on the three-dimensional image and filtering the voxel data obtained after the closing operation based on a preset threshold, wherein the preset threshold is less than the segmentation threshold; performing voxel supplementation on the second valid cluster using voxel data in the second voxel data that is within the directional bounding box of the second valid cluster; the second voxel data is obtained by performing an erosion operation on the three-dimensional image.
[0016] In some embodiments, the voxel upsampling processing is performed on the multiple valid clusters to obtain the recognition result of the at least one object to be recognized, including: determining the position and form of the at least one object to be recognized based on the multiple valid clusters, and marking the at least one object to be recognized.
[0017] In some embodiments, the voxel points in the first downsampled image are clustered to obtain multiple candidate clusters, including: setting a neighborhood radius and a minimum number of points; traversing all voxel points in the first downsampled image and taking any voxel point as an initial point; taking the initial point as the center of the circle and the neighborhood radius as the radius, calculating the number of voxels contained in the circular area; if the number of voxels is not less than the minimum number of points, the initial point is determined as a core point, and all voxel points within the neighborhood radius of the core point are determined as an initial cluster cluster; otherwise, if the number of voxels is less than the minimum number of points, the initial point is marked as a noise point; taking any voxel point in the initial cluster cluster as a new initial point, calculating the number of voxels within the neighborhood radius of the new initial point, if the number of voxels is not less than the minimum number of points, the new initial point is used as a core point, and all voxel points within the neighborhood radius of the new core point are determined as an initial cluster cluster, and this step is repeated until all points are visited to obtain the multiple candidate clusters.
[0018] In some embodiments, the method further includes: after obtaining multiple initial clustering clusters, determining the number of core points in each of the initial clustering clusters; if the number of core points in the initial clustering cluster is greater than a core point number threshold, determining the initial clustering cluster as a candidate cluster; if the number of core points in the initial clustering cluster is greater than the core point number threshold, deleting the initial clustering cluster.
[0019] According to another aspect of an embodiment of the present invention, a device for identifying an object in a three-dimensional image is provided, the device comprising: an acquisition module, used to acquire a three-dimensional image and a segmentation threshold of the three-dimensional image, the three-dimensional image comprising a plurality of voxel points, and the three-dimensional image comprising at least one object to be identified; a first processing module, used to perform a first morphological operation on the three-dimensional image to obtain a first processed image; a second processing module, used to perform image segmentation and voxel downsampling on the first processed image based on the segmentation threshold to obtain a first downsampled image; a third processing module, used to perform clustering on the voxel points in the first downsampled image to obtain a plurality of candidate clustering clusters; a fourth processing module, used to perform optimization on the plurality of candidate clustering clusters based on data features of the plurality of candidate clustering clusters to obtain a plurality of valid clustering clusters; and a recognition module, used to perform voxel upsampling on the plurality of valid clustering clusters to obtain a recognition result of the at least one object to be identified.
[0020] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the operations of the object recognition method in a three-dimensional image as described above by executing the executable instructions.
[0021] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of the object recognition method in a three-dimensional image as described above are implemented.
[0022] In summary, according to the object recognition method, device, electronic device and storage medium in a three-dimensional image according to an embodiment of the present invention, a three-dimensional image and a segmentation threshold of the three-dimensional image can be obtained, a first morphological operation processing can be performed on the three-dimensional image to obtain a first processed image, image segmentation and voxel downsampling processing can be performed on the first processed image based on the segmentation threshold to obtain a first downsampled image, voxel points in the first downsampled image can be clustered to obtain multiple candidate clustering clusters, multiple candidate clustering clusters can be optimized based on their data features to obtain multiple valid clustering clusters, and multiple valid clustering clusters can be voxel upsampled to obtain at least one recognition result of an object to be recognized. The application of this solution can improve the recognition accuracy and efficiency of objects to be recognized in three-dimensional images.
[0023] By clustering the voxel points in the first downsampled image to obtain multiple candidate clustering clusters, and optimizing the multiple candidate clustering clusters based on their data features to obtain multiple valid clustering clusters, and then performing voxel upsampling on the multiple valid clustering clusters to obtain at least one recognition result of an object to be recognized, the recognition accuracy of the object to be recognized can be improved. Moreover, since the first downsampled image is obtained by performing image segmentation and voxel downsampling on the first processed image, the amount of data for clustering and optimization processing is reduced, so the recognition efficiency of the object to be recognized can also be improved.
[0024] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:
[0026] Figure 1 A flow chart of a method for object recognition in a three-dimensional image provided by an embodiment of the present invention is shown;
[0027] Figure 2 An example of a two-dimensional slice image of a three-dimensional image provided by an embodiment of the present invention is shown;
[0028] Figure 3 An example of a three-dimensional image provided by an embodiment of the present invention is shown;
[0029] Figure 4 A schematic diagram of a first processed image provided by an embodiment of the present invention is shown;
[0030] Figure 5 A sub-flow chart of a method for identifying an object in a three-dimensional image provided by an embodiment of the present invention is shown;
[0031] Figure 6 A sub-flow chart of another method for object recognition in a three-dimensional image provided by an embodiment of the present invention is shown;
[0032] Figure 7 A sub-flow chart of another method for object recognition in a three-dimensional image provided by an embodiment of the present invention is shown;
[0033] Figure 8 A sub-flow chart of another method for object recognition in a three-dimensional image provided by an embodiment of the present invention is shown;
[0034] Fig. 9 A schematic diagram of a second processed image provided by an embodiment of the present invention is shown;
[0035] Fig.10 A sub-flow chart of another method for object recognition in a three-dimensional image provided by an embodiment of the present invention is shown;
[0036] Fig.11 A sub-flow chart of another method for object recognition in a three-dimensional image provided by an embodiment of the present invention is shown;
[0037] Fig.12 A schematic diagram of a valid clustering cluster before voxel supplementation provided by an embodiment of the present invention is shown;
[0038] Fig.13A A schematic diagram of marking an object to be identified provided by an embodiment of the present invention is shown;
[0039] Fig. 13B Another schematic diagram of marking an object to be identified provided by an embodiment of the present invention is shown;
[0040] Fig.14 A structural diagram of an object recognition device in a three-dimensional image provided by an embodiment of the present invention is shown;
[0041] Fig.15 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0042] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0043] The embodiment of the present invention provides a method for processing a three-dimensional image. The method can be executed by an electronic device, so that it can obtain a three-dimensional image and a segmentation threshold of the three-dimensional image, perform a first morphological operation on the three-dimensional image to obtain a first processed image, perform image segmentation and voxel downsampling on the first processed image based on the segmentation threshold to obtain a first downsampled image, perform clustering on the voxel points in the first downsampled image to obtain multiple candidate clustering clusters, optimize the multiple candidate clustering clusters based on their data features to obtain multiple valid clustering clusters, perform voxel upsampling on the multiple valid clustering clusters to obtain a recognition result of at least one object to be recognized. The application of this solution can improve the recognition accuracy and efficiency of the object to be recognized in the three-dimensional image.
[0044] Figure 1 A flowchart of a three-dimensional image processing method provided by an embodiment of the present invention is shown. Figure 1 As shown, the method may include the following steps 110 to 160:
[0045] Step 110: Obtain a three-dimensional image and a segmentation threshold of the three-dimensional image.
[0046] The three-dimensional image includes a plurality of voxel points, and the three-dimensional image includes at least one object to be identified. A voxel point is a small cubic unit in a three-dimensional space, and each voxel point has specific attributes, such as grayscale value, color value, density value, etc. The object to be identified can be a screw, a bone nail, a steel plate, etc.
[0047] In this embodiment, the three-dimensional image can be a stereoscopic image that can present the internal structure of the human body obtained through medical imaging technology, which can be an image collected using CT (Computed Tomography) or MRI (Magnetic Resonance Imaging) technology. Figure 2 An example of a two-dimensional slice image of a three-dimensional image is shown, as shown in 2 , where the image includes a total of six screws, which are fixed on two bones respectively.
[0048] The segmentation threshold of a three-dimensional image refers to the threshold for segmenting the object to be identified and the background in the three-dimensional image. It can be manually set by an operator based on experience and intuitive judgment, or it can be determined by analyzing the histogram of the three-dimensional image.
[0049] In some embodiments, the segmentation threshold may be obtained by processing the three-dimensional image using the maximum entropy method. Specifically, the basic idea of the maximum entropy method is to find an optimal threshold so that the sum of the entropies of the background and foreground of the segmented image is maximized.
[0050] Specifically, when using the maximum entropy method to process a three-dimensional image, it is necessary to calculate the total entropy of the image under all possible segmentation thresholds, so as to determine the maximum entropy, and determine the threshold corresponding to the maximum entropy as the final segmentation threshold. For example, according to the gray value of the three-dimensional image, the total entropy of 256 images is obtained from the threshold equal to the gray value 1 until the threshold equal to the gray value 256, and then the segmentation threshold corresponding to the maximum total entropy is found.
[0051] Step 120: Perform a first morphological operation on the three-dimensional image to obtain a first processed image.
[0052] In order to identify the object to be identified in the three-dimensional image, the electronic device can perform a first morphological operation on the three-dimensional image to analyze the shape and structure of the three-dimensional image.
[0053] Among them, morphological operations can include any one or more operation processing methods such as opening operation, closing operation, corrosion processing and dilation processing of the image. Opening operation refers to the operation of corroding and then dilating the three-dimensional medical image, which can eliminate small objects in the image, smooth the outline of the object, and avoid adhesion between the objects to be identified; closing operation refers to the operation of dilating and then corroding the image, which can fill small holes inside the object and connect adjacent objects; corrosion processing can shrink the boundary of the target object in the image inward, eliminate small protruding parts, and can be used to remove interfering parts with low voxel density; dilation processing can expand the boundary of the target object in the image outward and fill small holes.
[0054] In this embodiment, the first morphological operation can be any one of an opening operation and an erosion process. Taking the first morphological operation as an opening operation as an example, Figure 3 Specifically, when performing the opening operation on the three-dimensional image, a structural element may be defined first, that is, a three-dimensional structural element of a suitable size and shape, such as a cube, a sphere, etc., and then each voxel point of the three-dimensional image is traversed in a loop, and the value of the corresponding voxel point in the three-dimensional image is set according to the neighborhood relationship between the structural element and the voxel point to obtain a first processed image. The first processed image is shown in FIG. Figure 4 shown.
[0055] By performing the first morphological operation on the three-dimensional image, the shape and structure of the three-dimensional image can be analyzed, and the range of the object to be identified can be preliminarily determined.
[0056] Step 130 : performing image segmentation and voxel downsampling processing on the first processed image based on the segmentation threshold to obtain a first downsampled image.
[0057] In order to reduce the amount of data to be processed, improve the data processing speed, and reduce data interference, the segmentation threshold can be used to perform image segmentation and voxel downsampling on the first processed image to obtain a first downsampled image. Exemplarily, voxel points with grayscale values lower than the segmentation threshold in the first processed image can be removed to obtain a first segmented image, and then the first segmented image can be downsampled to obtain a first downsampled image.
[0058] Exemplarily, when performing downsampling processing, appropriate voxel filter coefficients can be set to filter the first segmented image. For example, the voxel filter coefficients can take the value of {8.0f, 8.0f, 8.0f}, which represents the filtering parameters used in three coordinate dimensions, such as the x, y, and z axes.
[0059] Through the above method, data interference in the first processed image can be reduced, the amount of data can be reduced, and at the same time, important features and information in the first processed image can be retained, thereby improving the processing speed and accuracy of subsequent image data.
[0060] Step 140 , clustering is performed on the voxel points in the first down-sampled image to obtain a plurality of candidate clusters.
[0061] By clustering the voxel points in the first down-sampled image to obtain a plurality of valid clusters, the number, position and range of the objects to be identified can be determined, wherein each valid cluster can be used to identify an object to be identified.
[0062] In some embodiments, Figure 5 As shown, step 140 can be implemented by the following method:
[0063] Step S510, setting the neighborhood radius and the minimum number of points, that is, the neighborhood radius eps and the minimum number of points Minpts can be set.
[0064] Step S520 , traverse all voxel points in the first down-sampled image and take any voxel point as an initial point.
[0065] Step S530 , taking the initial point as the center of the circle and the neighborhood radius as the radius, calculate the number of voxel points contained in the circular area.
[0066] For example, assuming that the initial point is P, with the initial point P as the center of the circle and the neighborhood radius eps as the radius, the number of voxel points contained in the circular area is calculated.
[0067] Step S540: If the number of voxels is not less than the minimum number of points, the initial point is determined as a core point, and all voxel points within the neighborhood radius of the core point are determined as an initial cluster. Otherwise, if the number of voxels is less than the minimum number of points, the initial point is marked as a noise point.
[0068] For example, if the number of voxels contained in the neighborhood radius eps of the initial point P is greater than or equal to the minimum number of points Minpts, then the initial point P is a core point, which is the first point in the initial cluster, and the points within the neighborhood radius eps belong to part of the initial cluster. Otherwise, the initial point P can be marked as a noise point.
[0069] Step S550, taking any voxel point in the initial cluster as a new initial point, calculating the number of voxels within the neighborhood radius of the new initial point, if the number of voxels is not less than the minimum number of points, taking the new initial point as a core point, and determining all voxel points within the neighborhood radius of the new core point as an initial cluster, repeating this step until all points are visited, and obtaining multiple candidate clusters.
[0070] For example, after obtaining the initial cluster, any voxel point in the initial cluster can be used as a new initial point Q, and the number of voxel points within the neighborhood radius eps of the point Q can be determined. If the number is greater than or equal to the minimum number of points Minpts, the point Q becomes a new core point, and the voxel points within its neighborhood radius are a new initial cluster. This process is repeated until all points are visited, and the multiple initial clusters obtained are multiple candidate clusters.
[0071] Through the above method, multiple candidate clusters can be generated to preliminarily determine the location and range of each object to be identified.
[0072] In some embodiments, reference Figure 6 As shown, the electronic device may also perform the following method:
[0073] Step S610: after obtaining a plurality of initial clusters, determining the number of core points in each initial cluster.
[0074] Step S620: If the number of core points in the initial cluster is greater than the core point number threshold, the initial cluster is determined as a candidate cluster.
[0075] The number of core points can be adaptively set according to the number of core points of each initial clustering cluster.
[0076] Step S630: If the number of core points in the initial cluster is greater than the core point number threshold, the initial cluster is deleted.
[0077] That is to say, after obtaining multiple initial clusters, only when the number of core points in each initial cluster is greater than the set core point number threshold, the initial cluster will be retained, otherwise it will be identified as interference.
[0078] Through this method, multiple initial clusters can be screened according to the number of core points in the initial clusters, valuable initial clusters can be retained, and multiple candidate clusters can be obtained.
[0079] Step 150: Optimize the data features of multiple candidate clusters to obtain multiple valid clusters.
[0080] After obtaining a plurality of candidate clustering clusters, the plurality of candidate clustering clusters may be further optimized to obtain a plurality of valid clustering clusters, thereby ensuring that each valid clustering cluster can more accurately identify the object to be identified.
[0081] Since the clustering algorithm can only obtain the globally optimal clustering result, local adhesion may occur. Therefore, in order to optimize multiple candidate clustering clusters, in some embodiments, it is possible to determine whether each candidate clustering cluster is adhered based on the first voxel feature of each candidate clustering cluster, and segment any candidate clustering cluster that is adhered.
[0082] The first voxel feature of the candidate cluster may include the number of voxels of the candidate cluster, the size of the candidate cluster in the height direction and the non-main direction of the axis-aligned bounding box, and the non-main direction is the direction with the smallest average size in the length direction and the width direction of the axis-aligned bounding box. Exemplarily, in a three-dimensional coordinate system, the height direction of the candidate cluster may generally be the z-axis direction. In the x-direction and the y-direction, the direction with the smallest average size is the non-main direction, and the other direction is the main direction.
[0083] Specifically, in some embodiments, reference Figure 7 As shown, the following method can be used to determine whether each candidate cluster is adhered:
[0084] Step S710 : determining a first candidate cluster and a second candidate cluster from a plurality of candidate clusters based on statistical information and prior knowledge.
[0085] The number of voxels of the first candidate cluster is greater than the voxel threshold, the size in the height direction is greater than the height threshold, and the size in the non-main direction is greater than the size threshold; the second candidate cluster is any candidate cluster except the first candidate cluster among the multiple candidate clusters. The voxel threshold, the height threshold, and the size threshold can all be set according to the voxel distribution of the multiple candidate clusters. For example, the voxel threshold can be the minimum number of voxels among the multiple candidate clusters, the height threshold can be the lowest height value among the multiple candidate clusters, and the size threshold can be the minimum size value among the multiple candidate clusters.
[0086] For example, for two candidate clusters cluster_i and cluster_j, assuming that the number of voxels of candidate cluster cluster_i reaches the voxel threshold, and its size in the height direction is greater than the height threshold, and its size in the non-main direction is greater than the size threshold, then candidate cluster cluster_i is the first candidate cluster, and cluster_j is the second candidate cluster.
[0087] Step S720, judging whether the first candidate cluster is adhered according to the size of the first candidate cluster in the height direction, the size ratio of the first candidate cluster to the second candidate cluster in the height direction, and the size ratio of the axis-aligned bounding box of the first candidate cluster in the non-main direction to the size of the first candidate cluster in the height direction.
[0088] Exemplarily, for the above-mentioned first candidate cluster cluster_i and the second candidate cluster cluster_j, if the size of the first candidate cluster cluster_i in the height direction is greater than the first size threshold, the size ratio of the first candidate cluster cluster_i to the second candidate cluster cluster_j in the height direction is greater than the first size ratio, and the size ratio of the first candidate cluster cluster_i in the non-main direction of the axis-aligned bounding box to the size of the first candidate cluster cluster_i in the height direction is greater than the second size ratio, it can be determined that the first candidate cluster cluster_i is adhered.
[0089] The first size threshold, the first size ratio and the second size ratio may all be set according to the distribution of each candidate cluster.
[0090] Through the above method, it is possible to detect whether there are any candidate clusters that are stuck among multiple candidate clusters, thereby providing support for subsequent optimization of multiple candidate clusters to avoid sticking.
[0091] In order to segment any candidate clusters that are adhered, in some embodiments, multiple candidate clusters may be sorted in descending order of the number of voxels, and the first N candidate clusters may be subjected to secondary clustering to obtain multiple secondary clusters, and if the number of secondary clusters is greater than N, the first N candidate clusters may be replaced by the multiple secondary clusters, where N is a positive integer less than the number of clusters of the multiple candidate clusters.
[0092] In other words, assuming that there are M candidate clusters (M>N), the M candidate clusters can be sorted in order of the number of voxels from large to small, and the M candidate clusters can be divided into the first N candidate clusters and the remaining candidate clusters, and then the first N candidate clusters are subjected to secondary clustering processing. If the number of clusters of the multiple secondary clusters obtained after the secondary clustering processing is greater than N, the multiple secondary clusters obtained after the secondary clustering processing can be used as new clusters, together with the remaining candidate clusters in the M candidate clusters as new multiple candidate clusters.
[0093] In some embodiments, if the number of clusters of the multiple secondary clustering clusters obtained after the secondary clustering process is less than or equal to N, the N candidate clustering clusters are retained without replacement.
[0094] By using the above-mentioned adhesion segmentation method, when adhesion occurs in candidate clusters, multiple candidate clusters can be updated to obtain optimized candidate clusters.
[0095] Considering that some candidate clusters may be broken due to problems such as uneven voxel distribution during the clustering process, in order to optimize the processing of multiple candidate clusters, in some embodiments, it is also possible to determine whether there is a break between the candidate clusters based on the second voxel features of the multiple candidate clusters, and when a break occurs between any two candidate clusters, any two candidate clusters are merged.
[0096] The second voxel features of the plurality of candidate clusters include any one or more of the sizes of the directional bounding boxes of each candidate cluster in the height direction, the main direction and the non-main direction, the distance between the directional bounding boxes of each candidate cluster in the height direction and the non-main direction, and the size of the directional bounding box of the cluster after any two candidate clusters are merged in the non-main direction. The non-main direction is the direction with the smallest average size in the length direction and the width direction of the directional bounding box of the candidate cluster.
[0097] Since the second voxel feature can reflect the voxel distribution of each candidate cluster, the relationship between the candidate clusters can be determined by analyzing the voxel distribution of each candidate cluster.
[0098] For example, assuming that for any two candidate clusters, the maximum size of the two candidate clusters in the main direction is less than the second size threshold, and the distance between the direction bounding box of each candidate cluster in the height direction and the non-main direction is less than the distance threshold, and the size of the direction bounding box of the cluster after the two candidate clusters are merged in the non-main direction is less than r times the total size of the direction bounding boxes of the two candidate clusters in the non-main direction, it can be determined that a break occurs between the two candidate clusters. Among them, the second size threshold, the distance threshold and r can all be set according to the actual distribution of the candidate clusters, for example, the value of r can be 0.25, etc.
[0099] In some embodiments, the following method may be used to determine whether a break occurs between candidate clusters:
[0100] Based on the third voxel features of the plurality of candidate clusters, it is determined whether a break occurs between the candidate clusters, and when a break occurs between any two candidate clusters, the any two candidate clusters are merged.
[0101] Among them, the third voxel features of multiple candidate clusters may include any one or more of the centroids of each candidate cluster, the distance between the centroids of each candidate cluster, the axis-aligned bounding box of each candidate cluster, and the feature vectors in the main direction of the axis-aligned bounding box of each candidate cluster, where the main direction of the axis-aligned bounding box is the direction with the smallest average size in the length direction and the width direction of the axis-aligned bounding box.
[0102] Exemplarily, when determining the eigenvectors in the main direction of the axis-aligned bounding box of the candidate cluster, the deviation vector relative to the center of mass can be calculated based on each voxel point in the candidate cluster, and then the covariance matrix of these deviation vectors is constructed, and the covariance matrix is subjected to eigenvalue decomposition. The eigenvector corresponding to the maximum eigenvalue obtained is the eigenvector in the main direction of the axis-aligned bounding box of the candidate cluster.
[0103] Exemplarily, assuming that for candidate clusters cluster_a and cluster_b, the feature vector vec_a of candidate cluster cluster_a in the main direction of the axis-aligned bounding box and the feature vector vec_b of candidate cluster cluster_b in the main direction of the axis-aligned bounding box, the centroid centroid_a of candidate cluster cluster_a and the centroid centroid_b of candidate cluster cluster_b can be determined respectively. If the angle between the feature vector vec_a and the feature vector vec_b is less than the first preset angle, that is, vec_a and vec_b are roughly parallel, the spatial distance between the centroid centroid_a and the centroid centroid_b is less than the minimum distance threshold, and the axis-aligned bounding boxes of candidate cluster cluster_a and cluster_b have an intersection in the main direction, it can be determined that a break occurs between candidate cluster clusters cluster_a and cluster_b. Wherein, both the first preset angle and the minimum distance threshold can be customized according to the actual distribution of each candidate cluster.
[0104] It should be noted that the above-mentioned method of determining whether a break occurs between candidate clusters is only for illustrative purposes, and other determination conditions may be used to determine whether a break occurs between candidate clusters according to actual conditions.
[0105] Through the above method, it is possible to determine whether a break occurs between candidate clusters, and when a break occurs between candidate clusters, the candidate clusters with a break are merged.
[0106] In some embodiments, after obtaining multiple candidate clusters, referring to Figure 8 As shown, the electronic device may also perform the following method:
[0107] Step S810: Perform a second morphological operation on the three-dimensional image to obtain a second processed image.
[0108] In this embodiment, the first morphological operation and the second morphological operation are different. Exemplarily, the first morphological operation may be an opening operation and the second morphological operation may be an erosion process, or the first morphological operation may be an erosion process and the second morphological operation may be an opening operation.
[0109] Taking the first morphological operation as opening operation and the second morphological operation as corrosion processing as an example, Figure 3The three-dimensional image shown in the figure is simultaneously subjected to corrosion processing. Specifically, when the three-dimensional image is subjected to corrosion processing, for each voxel point in the three-dimensional image, it can be determined whether all the voxel points in its neighborhood, such as a fixed-size cube neighborhood, meet the preset conditions. If the voxel points in the neighborhood do not all meet the preset conditions, the value of the central voxel point is modified to a specified value, otherwise the value of the central voxel point is kept unchanged to obtain a second processed image. The second processed image is as shown in FIG. Fig. 9 shown.
[0110] Step S820: performing image segmentation and downsampling processing on the second processed image based on the segmentation threshold to obtain a second downsampled image.
[0111] Exemplarily, voxel points with grayscale values lower than the segmentation threshold in the second processed image may be removed to obtain a second segmented image corresponding to the second processed image, and then the second segmented image may be downsampled to obtain a second downsampled image.
[0112] Correspondingly, when performing downsampling processing, appropriate voxel filter coefficients can also be set to filter the second segmented image. For example, the voxel filter coefficients can also be taken as {8.0f, 8.0f, 8.0f}, which represents the filtering parameters used in three coordinate dimensions, such as the x, y, and z axes.
[0113] Through the above method, important features and information in the second processed image can be retained, and the processing speed of subsequent image data can be improved.
[0114] After obtaining the second downsampled image, in some embodiments, step S150 may also be implemented by the following method:
[0115] Based on the data features of the multiple candidate clusters and the data features of the second down-sampled image, the multiple candidate clusters are screened to obtain multiple valid clusters.
[0116] In order to improve the recognition accuracy of the object to be recognized, each candidate cluster in the multiple candidate clusters can be further analyzed according to the data characteristics of each candidate cluster and the data characteristics of the second downsampled image to determine whether each candidate cluster is an object to be recognized, thereby eliminating the interference of non-recognized objects and completing the screening of each candidate cluster in the multiple candidate clusters to complete the optimization processing of each candidate cluster.
[0117] In some embodiments, reference Fig.10 As shown, multiple candidate clusters can be screened by the following methods:
[0118] Step S1010 , for each candidate cluster, determining the number of voxels of the candidate cluster, the number of first voxels of the second downsampled image within the bounding box of the candidate cluster, and the number of second voxels within the bounding box of the candidate cluster.
[0119] The bounding box is an axis-aligned bounding box or a directional bounding box. The number of first voxels of the second downsampled image within the bounding box of the candidate cluster can be determined by statistically analyzing the number of voxels within the bounding box according to the position and range of the bounding box of the candidate cluster.
[0120] Step S1020 : if the number of voxels in the candidate cluster is greater than a preset number, and the ratio of the first number of voxels to the second number of voxels is less than the preset ratio, the candidate cluster is deleted.
[0121] The preset number ratio is a real number greater than 0 and less than 1. The specific preset number and the preset number ratio can be customized according to the distribution of the candidate clusters, and are not specifically limited in this embodiment.
[0122] If the number of voxels in the candidate cluster is greater than the preset number, and the ratio of the first voxel number to the second voxel number is less than the preset ratio, it means that the number of voxels in the candidate cluster is significantly different before and after clustering. At this time, the candidate cluster can be considered to be misidentified, so the candidate cluster can be deleted.
[0123] In some embodiments, the preset number and the preset number ratio can set multiple groups of data. When making a judgment, the candidate clusters can be screened according to each group of data. For example, for a candidate cluster cluster_m whose number of voxels is greater than or equal to the preset number obj_voxel, the ratio of its first number of voxels to the second number of voxels should be greater than or equal to the preset number ratio ratio_1. If it is less than ratio_1, the candidate cluster cluster_m can be deleted, otherwise it is retained. For a candidate cluster cluster cluster_n whose number of voxels is less than the preset number obj_voxel, the ratio of its first number of voxels to the second number of voxels should be greater than or equal to the preset number ratio ratio_2. If it is less than ratio_2, the candidate cluster cluster_n can be deleted, otherwise it is retained. Among them, the values of ratio_1 and ratio_2 are different.
[0124] Through the above method, the obtained multiple candidate clusters can be screened to eliminate the interference of factors that are not the identified objects, thereby improving the recognition effect of the objects to be identified.
[0125] Furthermore, in order to enhance the recognition effect, in some embodiments, after obtaining a plurality of valid clusters, voxel supplementation may be performed on each valid cluster based on the three-dimensional image.
[0126] Voxel supplementation refers to the operation of supplementing existing voxel data or adding new voxels in the processing of voxel data, which can enhance the integrity of the object to be identified.
[0127] Exemplary, reference Fig.11 As shown, each valid cluster can be supplemented with voxels by the following method:
[0128] Step S1110 : determining, among multiple valid clusters, a first valid cluster whose size in the main direction of the directional bounding box is smaller than a preset size threshold, and a second valid cluster other than the first valid cluster.
[0129] The preset size threshold is smaller than the maximum size of the direction bounding box of each valid cluster in the plurality of valid clusters in the main direction. For example, assuming that the maximum size of the direction bounding box of the plurality of valid clusters in the main direction is 100, the preset size threshold can be set to 80.
[0130] Due to the influence of the position and posture of the object to be identified, the size of each valid cluster in the main direction of the direction bounding box must be smaller than or equal to the maximum size of multiple valid clusters in the main direction of the direction bounding box. Therefore, by determining the first valid cluster whose size in the main direction of the direction bounding box is smaller than the preset size threshold, and the second valid cluster whose size in the main direction of the direction bounding box is greater than or equal to the preset size threshold, the severity of the voxel missing of each valid cluster can be judged to facilitate subsequent voxel supplementation.
[0131] In some embodiments, when determining the first valid cluster and the second valid cluster, each valid cluster can be converted from the original coordinate system to the coordinate system corresponding to the directional bounding box, and then the coordinate system corresponding to the directional bounding box is used to determine whether the size in the main direction is less than a preset size threshold.
[0132] Step S1120 , voxel supplementation is performed on the first valid clustering cluster using the voxel data in the first voxel data that is within the direction bounding box of the first valid clustering cluster.
[0133] The first voxel data is obtained by performing a closing operation on the three-dimensional image and filtering the voxel data obtained after the closing operation based on a preset threshold, and the preset threshold is smaller than the segmentation threshold.
[0134] Since the size of the first effective cluster in the main direction of the direction bounding box is less than the preset size threshold, it indicates to a certain extent that the voxel missing of the first effective cluster is relatively serious. At this time, the three-dimensional image can be closed to increase the number of voxels in the three-dimensional image, and then the voxel data after the closing operation is filtered based on the preset threshold to reduce the interference of factors of non-recognized objects to obtain the first voxel data. Then, the voxel data in the first voxel data that is within the direction bounding box of the first effective cluster is used to supplement the voxels of the first effective cluster. For example, the voxel points in the first voxel data that are within the direction bounding box of the first effective cluster can be supplemented to the first effective cluster, so that the number of voxels of the first effective cluster is increased, but there is no overlap.
[0135] In order to improve the supplementation effect, in some embodiments, after obtaining the first voxel data, the voxel data in the first voxel data that is within the direction bounding box of the first valid cluster cluster can be screened using a first threshold value to retain voxel points greater than the first threshold value among the voxel points in the first voxel data that are within the direction bounding box of the first valid cluster cluster. Exemplarily, the first threshold value can be the same as or different from the segmentation threshold value.
[0136] Step S1130 : voxel supplementation is performed on the second valid clustering cluster using the voxel data in the second voxel data that is within the direction bounding box of the second valid clustering cluster.
[0137] The second voxel data is obtained by performing an erosion process on the three-dimensional image. The second voxel data obtained by the erosion process removes small protruding parts in the image, and retains as many voxels in the three-dimensional image as possible while reducing interference.
[0138] Compared with the first valid cluster, the second valid cluster has less missing voxels. At this time, the voxel data in the direction bounding box of the second valid cluster obtained after corrosion of the three-dimensional image can be used to supplement the voxels of the second valid cluster.
[0139] Accordingly, in some embodiments, after obtaining the second voxel data, the voxel data in the second voxel data that is within the direction bounding box of the second valid cluster cluster can be screened using a second threshold, and the second threshold can be the same as or different from the segmentation threshold. For example, according to the second threshold, the voxel points in the second voxel data that are within the direction bounding box of the second valid cluster cluster and that are greater than the segmentation threshold can be retained, and these voxel points can be added to the second valid cluster cluster, so that the number of voxels in the second valid cluster cluster increases, but there is no overlap.
[0140] Fig.12 A schematic diagram showing a valid clustering cluster before voxel augmentation, Fig.13AA schematic diagram of a valid cluster after voxel supplementation is shown. It can be seen that after voxel supplementation, the number of voxels in each valid cluster is significantly increased, and the aggregation and integrity of each valid cluster are fully improved.
[0141] Step 160 , performing voxel upsampling processing on the multiple valid clusters to obtain a recognition result of at least one object to be recognized.
[0142] After obtaining at least one valid cluster, each valid cluster can identify an object to be identified. Therefore, according to the position and range of each valid cluster, the position and range of each object to be identified can be determined.
[0143] In some embodiments, the position and shape of the at least one object to be identified can be determined based on the at least one valid cluster, and the at least one object to be identified can be marked. For example, each object to be identified can be marked with a different color so that medical staff can distinguish each object to be identified.
[0144] In some embodiments, each object to be identified may be marked with words, numbers, symbols, etc. For example, Fig.13A and Fig. 13B As shown, each object to be identified can be marked with a number to distinguish each object to be identified.
[0145] Through the above steps 110 to 160, the first image data and the second image data can be filtered based on the segmentation threshold to obtain first filtered data and second filtered data, and then the first filtered data can be clustered and optimized to obtain multiple valid clusters, thereby achieving preliminary recognition of the object to be identified. In addition, this process reduces the amount of data and improves data processing efficiency through filtering. At the same time, by screening each valid cluster in the multiple valid clusters based on the multiple valid clusters and the second filtered data to obtain a target cluster, and then based on the target cluster, the object to be identified is identified, which can eliminate the interference of non-identified objects and improve the recognition accuracy of the object to be identified.
[0146] This embodiment also provides a device for identifying objects in a three-dimensional image. Fig.14As shown, the object recognition device 1400 in a three-dimensional image may include: an acquisition module 1410, which is used to acquire a three-dimensional image and a segmentation threshold of the three-dimensional image, the three-dimensional image includes a plurality of voxel points, and the three-dimensional image includes at least one object to be recognized; a first processing module 1420, which is used to perform a first morphological operation on the three-dimensional image to obtain a first processed image; a second processing module 1430, which is used to perform image segmentation and voxel downsampling on the first processed image based on the segmentation threshold to obtain a first downsampled image; a third processing module 1440, which is used to perform clustering on the voxel points in the first downsampled image to obtain a plurality of candidate clustering clusters; a fourth processing module 1450, which is used to optimize the plurality of candidate clustering clusters based on data features of the plurality of candidate clustering clusters to obtain a plurality of valid clustering clusters; and a recognition module 1460, which is used to perform voxel upsampling on the plurality of valid clustering clusters to obtain a recognition result of at least one object to be recognized.
[0147] In some embodiments, the fourth processing module 1450 is used to determine whether each candidate cluster cluster is adhered based on the first voxel features of each candidate cluster cluster, and to segment any candidate cluster cluster that is adhered; wherein the first voxel features of the candidate cluster cluster include the number of voxels of the candidate cluster cluster, the size of the candidate cluster cluster in the height direction and the non-main direction of the axis-aligned bounding box, and the non-main direction is the direction with the smallest average size in the length direction and the width direction of the axis-aligned bounding box.
[0148] In some embodiments, the fourth processing module 1450 is used to determine a first candidate cluster and a second candidate cluster from multiple candidate clusters based on statistical information and prior knowledge, wherein the number of voxels of the first candidate cluster is greater than the voxel threshold, and the size in the height direction is greater than the height threshold, and the size in the non-main direction is greater than the size threshold; the second candidate cluster is any candidate cluster among the multiple candidate clusters except the first candidate cluster; based on the size of the first candidate cluster in the height direction, the ratio of the sizes of the first candidate cluster to the second candidate cluster in the height direction, and the ratio of the size of the axis-aligned bounding box of the first candidate cluster in the non-main direction to the size of the first candidate cluster in the height direction, it is determined whether the first candidate cluster is adhered.
[0149] In some embodiments, the fourth processing module 1450 is used to sort multiple candidate clustering clusters in order of the number of voxels from large to small; perform secondary clustering processing on the first N candidate clustering clusters to obtain multiple secondary clustering clusters. If the number of secondary clustering clusters is greater than N, the first N candidate clustering clusters are replaced by multiple secondary clustering clusters, where N is a positive integer less than the number of clusters of the multiple candidate clustering clusters.
[0150] In some embodiments, the fourth processing module 1450 is used to determine whether a break occurs between the candidate clusters based on the second voxel features of the multiple candidate clusters, and to merge any two candidate clusters when a break occurs between any two candidate clusters; wherein the second voxel features of the multiple candidate clusters include any one or more of the sizes of the directional bounding boxes of each candidate cluster in the height direction, the main direction and the non-main direction, the distance between the directional bounding boxes of each candidate cluster in the height direction and the non-main direction, and the size of the directional bounding box of the cluster after any two candidate clusters are merged in the non-main direction, and the non-main direction is the direction with the smallest average size in the length direction and the width direction of the directional bounding box of the candidate cluster.
[0151] In some embodiments, the fourth processing module 1450 is used to determine whether a break occurs between the candidate clusters based on the third voxel features of the multiple candidate cluster clusters, and to merge any two candidate cluster clusters when a break occurs between any two candidate cluster clusters; wherein the third voxel features of the multiple candidate cluster clusters include the center of mass of each candidate cluster cluster, the distance between the centers of mass of each candidate cluster cluster, the axis-aligned bounding box of each candidate cluster cluster, and any one or more of the feature vectors in the main direction of the axis-aligned bounding box of each candidate cluster cluster, and the main direction of the axis-aligned bounding box is the direction with the smallest average size in the length direction and the width direction of the axis-aligned bounding box.
[0152] In some embodiments, the first processing module 1420 is further used to perform a second morphological operation on the three-dimensional image to obtain a second processed image; and perform image segmentation and downsampling on the second processed image based on a segmentation threshold to obtain a second downsampled image.
[0153] In some embodiments, the fourth processing module 1450 is further configured to perform screening processing on the plurality of candidate clusters based on the data features of the plurality of candidate clusters and the data features of the second downsampled image to obtain a plurality of valid clusters.
[0154] In some embodiments, the fourth processing module 1450 is used to determine, for each candidate cluster cluster, the number of voxels of the candidate cluster cluster, the number of first voxels of the second downsampled image within the bounding box of the candidate cluster cluster, and the number of second voxels within the bounding box of the candidate cluster cluster, where the bounding box is an axis-aligned bounding box or a directional bounding box; if the number of voxels of the candidate cluster cluster is greater than a preset number, and the ratio of the first number of voxels to the second number of voxels is less than a preset number ratio, the candidate cluster cluster is deleted, and the preset number ratio is a real number greater than 0 and less than 1.
[0155] In some embodiments, after obtaining multiple valid clusters, the identification module 1460 is further configured to perform voxel supplementation on each valid cluster based on the three-dimensional image.
[0156] In some embodiments, the identification module 1460 is also used to determine, among multiple valid clusters, a first valid cluster whose size in the main direction of the direction bounding box is less than a preset size threshold, and a second valid cluster other than the first valid cluster, wherein the preset size threshold is less than the maximum size in the main direction of the direction bounding box of each valid cluster in the multiple valid clusters; voxel supplementation is performed on the first valid cluster using voxel data in the first voxel data that is within the direction bounding box of the first valid cluster; the first voxel data is obtained by performing a closing operation on the three-dimensional image and filtering the voxel data obtained after the closing operation based on a preset threshold, and the preset threshold is less than the segmentation threshold; voxel supplementation is performed on the second valid cluster using voxel data in the second voxel data that is within the direction bounding box of the second valid cluster; the second voxel data is obtained by performing an erosion operation on the three-dimensional image.
[0157] In some embodiments, the recognition module 1460 is used to determine the position and shape of at least one object to be recognized based on multiple valid clusters, and mark the at least one object to be recognized.
[0158] In some embodiments, the third processing module 1440 is used to set the neighborhood radius and the minimum number of points; traverse all voxel points in the first downsampled image and take any voxel point as the initial point; with the initial point as the center and the neighborhood radius as the radius, calculate the number of voxels contained in the circular area; if the number of voxels is not less than the minimum number of points, the initial point is determined as a core point, and all voxel points within the neighborhood radius of the core point are determined as an initial clustering cluster; conversely, if the number of voxels is less than the minimum number of points, the initial point is marked as a noise point; take any voxel point in the initial clustering cluster as a new initial point, calculate the number of voxels within the neighborhood radius of the new initial point, if the number of voxels is not less than the minimum number of points, take the new initial point as a core point, and all voxel points within the neighborhood radius of the new core point are determined as an initial clustering cluster, repeat this step until all points are visited to obtain multiple candidate clustering clusters.
[0159] In some embodiments, the third processing module 1440 is also used to determine the number of core points in each initial clustering cluster after obtaining multiple initial clustering clusters; if the number of core points in the initial clustering cluster is greater than the core point number threshold, the initial clustering cluster is determined as a candidate clustering cluster; if the number of core points in the initial clustering cluster is greater than the core point number threshold, the initial clustering cluster is deleted.
[0160] Fig.15 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
[0161] like Fig.15 As shown, the electronic device may be an image processing server, a terminal device, etc. Specifically, the electronic device may include: a processor 1502 , a communications interface 1504 , a memory 1506 , and a communications bus 1508 .
[0162] The processor 1502, the communication interface 1504, and the memory 1506 communicate with each other via a communication bus 1508. The communication interface 1504 is used to communicate with other devices such as a client or other server network elements. The processor 1502 is used to execute a program 1510, which can specifically execute the relevant steps in the above-mentioned method for object recognition in a three-dimensional image.
[0163] Specifically, program 1510 may include program code including computer executable instructions.
[0164] The processor 1502 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.
[0165] The memory 1506 is used to store the program 1510. The memory 1506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0166] The program 1510 can be specifically called by the processor 1502 to enable the electronic device to execute the steps in the above-mentioned method for identifying an object in a three-dimensional image.
[0167] An embodiment of the present invention also provides a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction is executed on an electronic device / an object recognition device in a three-dimensional image, the electronic device / a three-dimensional medical image processing device executes the object recognition method in a three-dimensional image in any of the above method embodiments.
[0168] The executable instructions may be specifically used to enable the electronic device / the device for identifying objects in a three-dimensional image to execute the steps in the above-mentioned method for processing three-dimensional medical images.
[0169] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system or other device. In addition, the embodiments of the present invention are not directed to any particular programming language.
[0170] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. Similarly, in order to simplify the present invention and help understand one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. Wherein, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself is a separate embodiment of the present invention.
[0171] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.
[0172] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A method for object recognition in a three-dimensional image, characterized in that: The method comprises: Acquire a three-dimensional image and a segmentation threshold of the three-dimensional image, wherein the three-dimensional image includes a plurality of voxel points and the three-dimensional image includes at least one object to be identified; Performing a first morphological operation on the three-dimensional image to obtain a first processed image; Based on the segmentation threshold, performing image segmentation and voxel downsampling processing on the first processed image to obtain a first downsampled image; Performing clustering processing on the voxel points in the first downsampled image to obtain a plurality of candidate clusters; Based on the data features of multiple candidate clusters, they are optimized to obtain multiple valid clusters; Perform voxel upsampling processing on the multiple valid clusters to obtain a recognition result of at least one of the objects to be recognized.
2. The method according to claim 1, characterized in that The method optimizes the data features of the plurality of candidate clusters to obtain a plurality of valid clusters, including: Based on the first voxel features of each of the candidate clusters, determining whether each of the candidate clusters is adhered, and performing segmentation processing on any candidate cluster that is adhered; Among them, the first voxel feature of the candidate cluster includes the number of voxels of the candidate cluster, the size of the candidate cluster in the height direction and the non-main direction of the axis-aligned bounding box, and the non-main direction is the direction with the smallest average size in the length direction and the width direction of the axis-aligned bounding box.
3. The method according to claim 2, characterized in that Determining whether each of the candidate clusters is adhered to each other includes: Based on statistical information and prior knowledge, a first candidate clustering cluster and a second candidate clustering cluster are determined from the plurality of candidate clustering clusters, wherein the number of voxels of the first candidate clustering cluster is greater than the voxel threshold, and the size in the height direction is greater than the height threshold, and the size in the non-main direction is greater than the size threshold; the second candidate clustering cluster is any candidate clustering cluster other than the first candidate clustering cluster among the plurality of candidate clustering clusters; Whether the first candidate cluster is adhered is determined based on the size of the first candidate cluster in the height direction, the ratio of the sizes of the first candidate cluster to the second candidate cluster in the height direction, and the ratio of the size of the axis-aligned bounding box of the first candidate cluster in the non-main direction to the size of the first candidate cluster in the height direction.
4. The method according to claim 2, characterized in that: Segment any candidate clusters that are stuck together, including: Sorting the plurality of candidate clusters in descending order of the number of voxels; Perform secondary clustering on the first N candidate clusters to obtain multiple secondary clusters. If the number of secondary clusters is greater than N, replace the first N candidate clusters with multiple secondary clusters, where N is a positive integer less than the number of clusters of the multiple candidate clusters.
5. The method according to claim 1, characterized in that The optimizing process based on the data features of the plurality of candidate clusters to obtain a plurality of valid clusters includes: Based on the second voxel features of the plurality of candidate clusters, determining whether a break occurs between the candidate clusters, and merging the two candidate clusters when a break occurs between any two candidate clusters; Among them, the second voxel features of the multiple candidate clusters include any one or more of the sizes of the directional bounding boxes of each candidate cluster in the height direction, the main direction and the non-main direction, the distance between the directional bounding boxes of each candidate cluster in the height direction and the non-main direction, and the size of the directional bounding box of the cluster after any two candidate clusters are merged in the non-main direction. The non-main direction is the direction with the smallest average size in the length direction and the width direction of the directional bounding box of the candidate cluster.
6. The method according to claim 1, characterized in that The optimizing process based on the data features of the plurality of candidate clusters to obtain a plurality of valid clusters includes: Based on the third voxel features of the plurality of candidate clusters, determining whether a break occurs between the candidate clusters, and merging the two candidate clusters when a break occurs between any two candidate clusters; Among them, the third voxel features of the multiple candidate clusters include any one or more of the centroids of each of the candidate clusters, the distances between the centroids of each of the candidate clusters, the axis-aligned bounding boxes of each of the candidate clusters, and the feature vectors in the main direction of the axis-aligned bounding box of each of the candidate clusters, where the main direction of the axis-aligned bounding box is the direction with the smallest average size in the length and width directions of the axis-aligned bounding box.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Performing a second morphological operation on the three-dimensional image to obtain a second processed image; Based on the segmentation threshold, image segmentation and downsampling processing are performed on the second processed image to obtain a second downsampled image.
8. The method according to claim 7, characterized in that The step of optimizing the data features of the plurality of candidate clusters to obtain a plurality of valid clusters further includes: Based on the data features of the plurality of candidate clusters and the data features of the second down-sampled image, the plurality of candidate clusters are screened to obtain the plurality of valid clusters.
9. The method according to claim 8, characterized in that The screening process of the plurality of candidate clusters based on the data features of the plurality of candidate clusters and the data features of the second downsampled image to obtain the plurality of valid clusters includes: For each candidate cluster, determine the number of voxels of the candidate cluster, the first number of voxels of the second downsampled image within a bounding box of the candidate cluster, and the second number of voxels within a bounding box of the candidate cluster, wherein the bounding box is an axis-aligned bounding box or an oriented bounding box; If the number of voxels of the candidate cluster is greater than a preset number, and the ratio of the first number of voxels to the second number of voxels is less than a preset number ratio, the candidate cluster is deleted, and the preset number ratio is a real number greater than 0 and less than 1.
10. The method according to any one of claims 1 to 6, characterized in that: After obtaining a plurality of valid clusters, the method further comprises: Based on the three-dimensional image, voxel supplementation is performed on each of the valid clusters.
11. The method according to claim 10, characterized in that The step of supplementing each of the valid clusters with voxels based on the three-dimensional image comprises: Determine, among the multiple valid clusters, a first valid cluster whose size in the main direction of the directional bounding box is smaller than a preset size threshold, and a second valid cluster other than the first valid cluster, wherein the preset size threshold is smaller than the maximum size in the main direction of the directional bounding box of each of the multiple valid clusters; voxel supplementation is performed on the first valid cluster using voxel data in the first voxel data that is within the direction bounding box of the first valid cluster; the first voxel data is obtained by performing a closing operation on the three-dimensional image and filtering the voxel data obtained after the closing operation based on a preset threshold, wherein the preset threshold is less than the segmentation threshold; The second valid cluster is voxel-filled using the voxel data in the second voxel data that is within the direction bounding box of the second valid cluster; the second voxel data is obtained by performing an erosion process on the three-dimensional image.
12. The method according to any one of claims 1 to 6, characterized in that The performing voxel upsampling processing on the multiple valid clusters to obtain the recognition result of the at least one object to be recognized includes: Based on the multiple valid clusters, the position and shape of the at least one object to be identified are determined, and the at least one object to be identified is marked.
13. The method according to any one of claims 1 to 6, characterized in that The step of clustering the voxel points in the first downsampled image to obtain a plurality of candidate clusters includes: Set the neighborhood radius and minimum number of points; Traversing all voxel points in the first downsampled image, and taking any voxel point as an initial point; Taking the initial point as the center of the circle and the neighborhood radius as the radius, the number of voxels contained in the circular area is calculated; If the number of voxels is not less than the minimum number of points, the initial point is determined as a core point, and all voxel points within the neighborhood radius of the core point are determined as an initial cluster; otherwise, if the number of voxels is less than the minimum number of points, the initial point is marked as a noise point; Taking any voxel point in the initial cluster as a new initial point, calculating the number of voxels within the neighborhood radius of the new initial point, if the number of voxels is not less than the minimum number of points, taking the new initial point as a core point, and determining all voxel points within the neighborhood radius of the new core point as an initial cluster, repeat this step until all points are visited to obtain the multiple candidate clusters.
14. The method according to claim 13, characterized in that The method further comprises: After obtaining a plurality of initial clusters, determining the number of core points in each of the initial clusters; If the number of core points in the initial cluster is greater than the core point number threshold, the initial cluster is determined as a candidate cluster; If the number of core points in the initial cluster is greater than the core point number threshold, the initial cluster is deleted.
15. A device for identifying an object in a three-dimensional image, characterized in that: The device comprises: An acquisition module, used for acquiring a three-dimensional image and a segmentation threshold of the three-dimensional image, wherein the three-dimensional image includes a plurality of voxel points and the three-dimensional image includes at least one object to be identified; A first processing module, used for performing a first morphological operation on the three-dimensional image to obtain a first processed image; A second processing module, configured to perform image segmentation and voxel downsampling processing on the first processed image based on the segmentation threshold to obtain a first downsampled image; A third processing module, configured to perform clustering processing on the voxel points in the first downsampled image to obtain a plurality of candidate clusters; A fourth processing module, configured to optimize the plurality of candidate clusters based on data features of the plurality of candidate clusters to obtain a plurality of valid clusters; The recognition module is used to perform voxel upsampling processing on the multiple valid clusters to obtain a recognition result of the at least one object to be recognized.
16. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the operations of the method for object recognition in a three-dimensional image according to any one of claims 1 to 14 by executing the executable instructions.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for object recognition in a three-dimensional image according to any one of claims 1 to 14 are implemented.
Citation Information
Cited By
Automobile part positioning method and system for numerical control machine tool machining
CN120318313A