Agglomeration hierarchical clustering collision detection method based on Sphere bounding box

By adopting a condensation hierarchical cluster collision detection method based on Sphere bounding box in the virtual surgical simulation system, the problem of insufficient speed and accuracy of soft tissue collision detection in the existing technology is solved, and more efficient and accurate collision detection is achieved, improving the real-time and performance of the simulation system.

CN119888139APending Publication Date: 2025-04-25NANCHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411706896.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the existing virtual surgical simulation system, the speed and accuracy of soft tissue collision detection are insufficient, which affects the real-time and interactive nature of the simulation system.

Method used

The condensing hierarchical cluster collision detection method based on the Sphere bounding box is used to generate the Sphere bounding box instead of the triangular grid for collision detection, and a hierarchical clustering tree is generated by bottom-up condensing hierarchical clustering to achieve fast and accurate collision detection.

Benefits of technology

Improves the efficiency and accuracy of collision detection, and enhances the real-time and overall performance of the virtual surgical simulation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888139A_ABST
    Figure CN119888139A_ABST
Patent Text Reader

Abstract

An agglomeration hierarchical clustering collision detection method based on a Sphere bounding box comprises the following steps: traversing a triangular mesh on the surface of soft tissue, and judging the type of the triangular mesh belonging to a triangle; according to the shape of the triangular mesh, generating a corresponding Sphere bounding box; the number k of clusters is set, the Sphere bounding boxes serve as input of a k clustering algorithm, clustering is carried out, and k new Sphere bounding boxes are generated; k is reset, the Sphere bounding box generated in the last step serves as input, clustering continues to be carried out until one Sphere bounding box is left, clustering is stopped, and a hierarchical clustering tree is established; spatial information of the surgical instrument is obtained, the hierarchical clustering tree is traversed, collision detection is carried out, and a final collision point is selected. According to the method provided by the invention, more accurate collision detection is realized, and the collision detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of virtual surgery, and in particular relates to a Sphere bounding box-based agglomerative hierarchical clustering collision detection method. Background Art

[0002] Virtual reality technology has a wide range of applications in the medical field, and virtual surgery is one of them. It can simulate surgery through computer simulation technology, provide doctors with a visual operating interface and real physical feedback, and help doctors perform preoperative simulations before actual surgery, thereby reducing surgical risks and improving the success rate of surgery.

[0003] Collision detection is a prerequisite for soft tissue deformation or fracture. Only when the surgical instrument collides with the soft tissue does the system need to calculate soft tissue deformation, cutting feedback force, suturing and puncture feedback force and other operations. The results of soft tissue collision detection will affect the authenticity and interactivity of the simulation system. Therefore, improving the speed and accuracy of collision detection is the premise and guarantee for meeting the real-time performance of the virtual surgery simulation system, and plays a vital role in improving the overall performance of the virtual surgery simulation system.

[0004] From the perspective of spatial domain, collision detection algorithms are divided into algorithms based on geometric space and algorithms based on image space. However, collision detection algorithms based on geometric space are commonly used in virtual surgery simulation systems. Collision detection algorithms based on geometric space are further divided into space partitioning algorithms, hierarchical bounding box trees, spatial hashing algorithms, distance field-based algorithms, and sweep and clipping algorithms. Among them, space partitioning algorithms, hierarchical bounding box trees, and spatial hashing algorithms are most widely used in soft tissue collision detection. The core idea of ​​the space partitioning algorithm is to divide the three-dimensional space where the soft tissue is located into a cubic area, and divide the cubic area into different sub-areas according to specific rules. The division continues according to the rules until a certain area can no longer be divided. The core idea of ​​the hierarchical bounding box tree is to use a slightly larger bounding box with simple geometric features to approximately replace complex geometric objects for collision detection, thereby simplifying the collision detection process. The bounding box can be nested in another large bounding box, and has a tree-like hierarchical structure. Therefore, when performing collision detection, the upper bounding box can be first tested for intersection, and the area without collision can be quickly eliminated. Common bounding boxes include: axis-aligned bounding box AABB, spherical bounding box Sphere, directional bounding box OBB and discrete polyhedron K-DOP. The core idea of ​​the spatial hashing algorithm is to divide the three-dimensional space where the soft tissue is located into a cubic area, divide the cubic area into many small cubes, and map the spatial information in the small cubes into a hash table. When performing collision detection, it is only necessary to detect whether there are multiple objects in the small cube. If there are multiple objects in the same small cube, more detailed detection is required to determine whether there is a collision between them. Summary of the invention

[0005] The present invention provides a sphere bounding box-based agglomerative hierarchical clustering collision detection method, in which a sphere bounding box is generated for each triangular mesh on the surface of soft tissue to replace the triangular mesh for collision detection, and agglomerative hierarchical clustering is performed from bottom to top to generate a hierarchical clustering tree, thereby realizing fast and accurate collision detection.

[0006] The present invention is achieved through the following technical solutions.

[0007] The present invention provides a Sphere bounding box-based agglomerative hierarchical clustering collision detection method, comprising the following steps:

[0008] Step 1: traverse the triangular mesh of the soft tissue surface and determine the geometric shape of the triangular mesh according to the spatial information of the triangular mesh;

[0009] Step 2: Generate a corresponding Sphere bounding box based on the geometric shape of the triangle mesh, use the Sphere bounding box to replace the mesh for the next collision detection, and store the information of the Sphere bounding box into the array box;

[0010] Step 3. Perform k-means clustering based on the Sphere bounding box to generate k new Sphere bounding boxes: set the k value, traverse the spatial information of the Sphere bounding box generated in step 2, use the center coordinates and radius of the Sphere bounding box as the features of k-means clustering, perform clustering, and generate k new Sphere bounding boxes after clustering.

[0011] Step 4. For the k Sphere bounding boxes generated in step 3, create a two-dimensional array newbox of size k to store the basic spatial information of the newly generated Sphere bounding boxes, and create a two-dimensional array boxhash of size k to store the indexes of the sub-Sphere bounding boxes contained in the Sphere bounding box. When performing clustering calculations, each sub-Sphere bounding box has a class label. After clustering, create a two-dimensional array of size k, identify the index of the new Sphere bounding box to which the sub-Sphere bounding box belongs according to the class label of the sub-Sphere, and put the index of the sub-Sphere bounding box into the corresponding position.

[0012] Step 5: Determine whether the k value in step 3 is 1. If k≠1, reset the k value, use the k Sphere bounding boxes generated in step 3 as the input for the next clustering, and continue to execute steps 3 and 4. If k=1, stop clustering;

[0013] Step 6. Generate a clustering hierarchy tree by reverse traversal based on the two-dimensional array boxhash created after each clustering. Use the Sphere bounding box generated by the last clustering as the root node of the clustering hierarchy tree. Reverse traverse the boxhash array created after each clustering as the next layer of nodes of the clustering hierarchy tree until the box array is traversed, thus completing the generation of the clustering hierarchy tree.

[0014] Step 7. Simplify the tip of the surgical instrument into a proxy ball, and use the proxy ball to replace the surgical instrument for collision detection. First, determine whether the proxy ball collides with the root node of the clustering hierarchy tree. If no collision occurs, the detection is completed. If a collision occurs, continue to determine whether the proxy ball collides with the child node of the root node. Similarly, detect the leaf node that collides with the proxy ball, and record the Sphere bounding box index corresponding to the collision.

[0015] Step 8. According to the Sphere bounding box index obtained in step 7, the relevant triangular mesh information is retrieved to determine whether the proxy ball collides with the triangular mesh. If no collision occurs, it means that the surgical instrument has not collided with the soft tissue. If a collision occurs, the collision point is recorded. If there are multiple collision points, the collision point closest to the triangular mesh is selected as the final collision point.

[0016] Furthermore, the step 1 is performed according to the following steps:

[0017] Assuming the number of triangular meshes on the soft tissue surface is n, the triangular meshes on the soft tissue surface are traversed, and the geometric shapes of the triangular meshes are determined according to the spatial information of the triangular meshes.

[0018] Assume that the three vertices of the triangle mesh are A, B, and C, and their coordinates are (x A ,y A ,z A )、(x B ,y B ,z B ) and (x C ,y C ,z C ), calculated according to the triangular cosine formula:

[0019]

[0020] The inverse trigonometric function is used to calculate the sizes of the three angles of the triangular mesh and determine whether the geometric shape of the triangular mesh belongs to an acute triangle, a right triangle or an obtuse triangle.

[0021] Further, the step 2 is as follows: Generate a corresponding Sphere bounding box according to the geometric shape of the triangular mesh, as shown in the attached figure. Figure 2 , where (a), (b), (c) generate sphere bounding boxes for acute triangles, right triangles, and obtuse triangles through the triangle circumcenter, and (d), (e), (f) generate sphere bounding boxes for acute triangles, right triangles, and obtuse triangles through the triangle centroid. For the triangle mesh of acute and right triangles, the circumcenter is used to generate the sphere bounding box, and for the triangle mesh of obtuse triangles, the centroid is used to generate the sphere bounding box for collision detection, and an array box is established to store the basic spatial information of the sphere bounding box.

[0022] The beneficial technical effect of the present invention is: using Sphere bounding boxes instead of triangular meshes for collision detection, adopting a bottom-up agglomerative hierarchical clustering method, the bottom-level Sphere bounding boxes are gradually merged into larger Sphere bounding boxes through the k-means clustering algorithm of each layer, thereby achieving more accurate collision detection and improving the efficiency of collision detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a flow chart of the agglomerative hierarchical clustering collision detection algorithm described in the present invention.

[0024] Figure 2It is the triangular mesh sphere bounding box generation diagram of the present invention. Among them, (a), (b), (c) are sphere bounding boxes for acute triangles, right triangles, and obtuse triangles generated by the triangle circumcenter, and (d), (e), (f) are sphere bounding boxes for acute triangles, right triangles, and obtuse triangles generated by the triangle centroid.

[0025] Figure 3 The following are the effects of the Sphere bounding box-based agglomerative hierarchical clustering collision detection algorithm on a hand wound model. (a) is the hand wound soft tissue model used in the present invention, and (b) to (f) respectively show the effects of the fifth level bounding box, the fourth level bounding box, the third level bounding box, the second level bounding box and the root node bounding box of the clustering hierarchical tree. DETAILED DESCRIPTION

[0026] In order to facilitate those skilled in the art to implement the invention by referring to the description, the present invention is further described in detail below in conjunction with the accompanying drawings.

[0027] Assuming the number of triangular meshes on the soft tissue surface is n, the triangular meshes on the soft tissue surface are traversed, and the geometric shapes of the triangular meshes are determined according to the spatial information of the triangular meshes.

[0028] Assume that the three vertices of the triangle mesh are A, B, and C, and their coordinates are (x A ,y A ,z A )、(x B ,y B ,z B ) and (x C ,y C ,z C ), calculated according to the triangular cosine formula:

[0029]

[0030] The inverse trigonometric function is used to calculate the sizes of the three angles of the triangular mesh and determine whether the geometric shape of the triangular mesh belongs to an acute triangle, a right triangle or an obtuse triangle.

[0031] Generate the corresponding Sphere bounding box according to the geometric shape of the triangle mesh, as shown in the attached figure. Figure 2, where (a), (b), and (c) generate sphere bounding boxes for acute triangles, right triangles, and obtuse triangles through the triangle circumcenter, and (d), (e), and (f) generate sphere bounding boxes for acute triangles, right triangles, and obtuse triangles through the triangle centroid. For the triangle meshes of acute and right triangles, the circumcenter is used to generate the sphere bounding box, and for the triangle meshes of obtuse triangles, the centroid is used to generate the sphere bounding box for collision detection. An array box[n][4] is established to store the basic spatial information of the sphere bounding box. box[i][0], box[i][1], box[i][2], and box[i][3] represent the sphere center coordinates x, y, z, and sphere radius r of the i-th sphere bounding box.

[0032] Set the k value in the k-means clustering algorithm. When performing the first k-means clustering, use the box array as input, and use the coordinates and radius of the Sphere bounding box as the features of the clustering algorithm for clustering. Generate k new Sphere bounding boxes, and create a two-dimensional array newbox[k][4] to save the spatial information of the newly generated Sphere bounding box. Create a two-dimensional array boxhash to save the index of the sub-Sphere bounding box contained in the newly generated Sphere bounding box. boxhash[i] represents the index of the sub-Sphere bounding box contained in the newly generated i-th Sphere bounding box. boxhash[i].size() represents the number of sub-Sphere bounding boxes contained in the newly generated i-th Sphere bounding box.

[0033] Reset the k value in the k-means clustering algorithm, perform the second k-means clustering, use the newbox array as input, and the rest of the steps are the same as the first clustering. After the second clustering, regenerate k larger Sphere bounding boxes and repeat the clustering several times until the last Sphere bounding box is left, then stop clustering.

[0034] The Sphere bounding box generated by the last clustering is used as the root node of the clustering hierarchy tree. The boxhash array established after each clustering is traversed in reverse order as the next layer of nodes of the clustering hierarchy tree until the box array is traversed, thus completing the generation of the clustering hierarchy tree.

[0035] The tip of the surgical instrument is simplified into a proxy ball, and the proxy ball is used to replace the surgical instrument for collision detection. First, determine whether the proxy ball collides with the root node of the clustering hierarchy tree, and calculate the distance between the proxy ball and the center of the root node Sphere bounding box:

[0036]

[0037] Among them, x root ,y root 、z root 、x sphere ,y sphere 、z sphere They are the center coordinate information of the proxy ball and the root node Sphere bounding box respectively.

[0038] If d>r root +r sphere (r root 、r sphere are the radius of the bounding box of the proxy ball and the root node Sphere respectively), indicating that no collision has occurred, and the detection is completed. If d≤r root +r sphere , indicating that the proxy ball collides with the root node of the clustering hierarchy tree, then continue to determine whether the proxy ball collides with the child node of the root node, and so on. The leaf node that collides with the proxy ball is detected, and the Sphere bounding box index corresponding to the collision is recorded.

[0039] Use the Sphere bounding box index to retrieve the corresponding triangular mesh information and determine whether the proxy ball collides with the triangular mesh. Suppose the three vertices of the triangular mesh are A, B, and C, and their coordinates are (x A ,y A ,z A )、(x B ,y B ,z B ) and (x C ,y C ,z C ), calculate the normal vector of the triangle mesh:

[0040]

[0041] The plane equation of the plane where the triangular mesh is located is calculated according to the point method:

[0042] x m x+y m y+z m zx m x A -y m y A -z m z A =0

[0043] Among them, x m ,y m 、z m is the normal vector The coordinates of .

[0044] The distance between the proxy ball and the triangular mesh is calculated using the distance formula from a point in space to a plane:

[0045]

[0046] If d>r sphere , indicating that the surgical instrument did not collide with the soft tissue. If d≤r sphere , indicating that the surgical instrument collides with the soft tissue, and the collision point is recorded. If there are multiple collision points, the collision point closest to the triangular mesh is selected as the final collision point.

[0047] The above embodiments are only used to illustrate the present invention, but not to limit the present invention.

Claims

1. A Sphere-based agglomerative hierarchical clustering collision detection method, characterized in that The steps include: Step 1: traverse the triangular mesh of the soft tissue surface and determine the geometric shape of the triangular mesh according to the spatial information of the triangular mesh; Step 2: Generate a corresponding Sphere bounding box based on the geometric shape of the triangular mesh, use the Sphere bounding box to replace the mesh for subsequent collision detection, and store the information of the Sphere bounding box in the array box; Step 3: Perform k-means clustering based on the Sphere bounding box to generate k new Sphere bounding boxes: set the k value, traverse the spatial information of the Sphere bounding box generated in step 2, use the center coordinates and radius of the Sphere bounding box as the features of k-means clustering, perform clustering, and generate k new Sphere bounding boxes after clustering; Step 4: For the k Sphere bounding boxes generated in step 3, a two-dimensional array newbox of size k is established to store the basic spatial information of the newly generated Sphere bounding boxes, and a two-dimensional array boxhash of size k is established to store the indexes of the sub-Sphere bounding boxes contained in the Sphere bounding box. When performing clustering calculations, each sub-Sphere bounding box has a class label. After clustering, a two-dimensional array of size k is established to identify the index of the new Sphere bounding box to which the sub-Sphere bounding box belongs according to the class label of the sub-Sphere, and put the index of the sub-Sphere bounding box into the corresponding position; Step 5: Determine whether the k value in step 3 is 1. If k≠1, reset the k value, use the k Sphere bounding boxes generated in step 3 as the input for the next clustering, and continue to execute steps 3 and 4; if k=1, stop clustering; Step 6: Generate a clustering hierarchy tree by reverse traversing the two-dimensional array boxhash created after each clustering. The Sphere bounding box generated by the last clustering is used as the root node of the clustering hierarchy tree. The boxhash array created after each clustering is reversely traversed as the next layer of nodes of the clustering hierarchy tree until the box array is traversed, thus completing the generation of the clustering hierarchy tree. Step 7: Simplify the tip of the surgical instrument into a proxy ball, and use the proxy ball to replace the surgical instrument for collision detection. First, determine whether the proxy ball collides with the root node of the clustering hierarchy tree. If no collision occurs, the detection is completed. If a collision occurs, continue to determine whether the proxy ball collides with the child node of the root node. Similarly, detect the leaf node that collides with the proxy ball, and record the Sphere bounding box index corresponding to the collision. Step 8. According to the Sphere bounding box index obtained in step 7, the relevant triangular mesh information is retrieved to determine whether the proxy ball collides with the triangular mesh. If no collision occurs, it means that the surgical instrument has not collided with the soft tissue. If a collision occurs, the collision point is recorded. If there are multiple collision points, the collision point closest to the triangular mesh is selected as the final collision point.

2. The method for collision detection based on Sphere bounding box based agglomerative hierarchical clustering according to claim 1, characterized in that The step 1 described above is as follows: Assume that the number of triangular meshes on the soft tissue surface is n, traverse the triangular meshes on the soft tissue surface, and determine the geometric shape of the triangular meshes according to the spatial information of the triangular meshes; Assume that the three vertices of the triangle mesh are A, B, and C, and their coordinates are (x A ,y A ,z A )、(x B ,y B ,z B ) and (x C ,y C ,z C ), calculated according to the triangular cosine formula: The inverse trigonometric function is used to calculate the sizes of the three angles of the triangular mesh and determine whether the geometric shape of the triangular mesh belongs to an acute triangle, a right triangle or an obtuse triangle.

3. The method for collision detection based on Sphere bounding box based agglomerative hierarchical clustering according to claim 1, characterized in that The step 2 described above is as follows: Generate the corresponding Sphere bounding box according to the geometric shape of the triangular mesh, generate the Sphere bounding box about the acute triangle, right triangle and obtuse triangle through the circumcenter of the triangle, and generate the Sphere bounding box about the acute triangle, right triangle and obtuse triangle through the centroid of the triangle; for the triangular mesh of acute and right triangles, use the circumcenter to generate the Sphere bounding box, and for the triangular mesh of obtuse triangles, use the centroid to generate the Sphere bounding box for collision detection, and establish an array box to store the basic spatial information of the Sphere bounding box.