Three-dimensional safety boundary generation method, apparatus and computer equipment

By projecting a set of three-dimensional contour points onto a two-dimensional plane and extending it along a specified direction, combined with morphological processing, a stable and controllable three-dimensional safety boundary that adapts to the needs of different tools is generated. This solves the problems of multi-region connectivity and directional constraints in existing technologies, reduces computational complexity, and improves processing stability.

CN122415318APending Publication Date: 2026-07-17YUANHUA ORTHOPAEDIC ROBOTICS (SHENZHEN) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YUANHUA ORTHOPAEDIC ROBOTICS (SHENZHEN) LTD
Filing Date
2026-06-18
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve reasonable connections between multiple regions without introducing complex topological calculations when generating safe boundaries for 3D contours. They lack directional constraints, making it difficult to meet specific safety requirements. Furthermore, they are computationally expensive and difficult to adapt to the boundary morphology requirements of different tools.

Method used

By projecting a set of 3D contour points onto a 2D plane, expanding and filling the projection along a specified direction, and combining morphological processing and boundary simplification strategies, a continuous and controllable 3D safe boundary is generated.

Benefits of technology

It enables the rapid generation of stable and controllable 3D safety boundaries without complex topology analysis, adapting to different engineering needs, reducing computational complexity, and improving processing stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122415318A_ABST
    Figure CN122415318A_ABST
Patent Text Reader

Abstract

This application applies to the fields of computer graphics, medical image processing, and surgical path planning, and provides a method, apparatus, and computer device for generating three-dimensional safety boundaries. The method includes: projecting a three-dimensional contour point set onto a two-dimensional plane to obtain a two-dimensional polygon point set, wherein the three-dimensional contour point set contains multiple ordered three-dimensional position points, and the two-dimensional plane is a plane determined in a local coordinate system based on an osteotomy contour; projecting and expanding the contour image corresponding to the two-dimensional polygon point set along a first direction to form a continuous expanded region in the first direction; extracting the boundary curve of the continuous expanded region in a second direction, wherein the second direction is perpendicular to the first direction; and mapping the boundary curve to a three-dimensional space based on the projection matrix of the local coordinate system to obtain a safety boundary in the three-dimensional space. Using the above method, stable and controllable three-dimensional safety boundaries can be generated quickly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the fields of computer graphics, medical image processing and surgical path planning, and in particular relates to a method, apparatus and computer equipment for generating three-dimensional safety boundaries. Background Technology

[0002] Osteotomy is frequently performed during orthopedic surgeries and other procedures. Currently, computer-aided planning of safe boundaries for osteotomy is typically used preoperatively, with the actual osteotomy then taking place within these planned boundaries. Generating safe boundaries within complex 3D contours is a common planning method, often employing geometric offset techniques or methods based on signed distance fields.

[0003] Geometric offset methods primarily form safe boundaries by expanding or contracting polygons or spatial curves to calculate their equidistant offset profiles. While these methods are well-suited for regular geometric structures, they are prone to self-intersections, breaks, or jagged boundaries when dealing with complex topologies containing multi-ring structures, porous structures, or multiple separated regions. Furthermore, these methods typically rely on isotropic distance expansion mechanisms, lacking directional constraints and failing to meet the requirements for unilateral safe boundaries in scenarios such as surgical planning. When multiple target regions exist, rationally connecting or separating these regions usually requires additional topology analysis and rule design, resulting in high complexity.

[0004] Symbolic distance field-based methods construct the shortest distance function from each point in space to the target contour and then extract specific isosurfaces to obtain the offset boundary. These methods have the advantages of adapting to complex shapes and generating smooth boundaries, but their computational process typically relies on high-resolution voxelization or dense sampling, resulting in high computational costs and making them difficult to meet the needs of real-time applications. Furthermore, similar to geometric offset-based methods, symbolic distance field-based methods also lack control over specific directions, still facing difficulties in handling local region connectivity and topology reconstruction problems. In practical applications, additional post-processing steps such as boundary extraction and curve simplification are usually required to generate the final safe boundary, making the overall process quite complex. Summary of the Invention

[0005] In view of this, embodiments of this application provide a method, apparatus, and computer device for generating three-dimensional security boundaries, which can quickly generate stable and controllable three-dimensional security boundaries.

[0006] The first aspect of this application provides a method for generating three-dimensional security boundaries, including: Projecting a three-dimensional contour point set onto a two-dimensional plane yields a two-dimensional polygon point set. The three-dimensional contour point set contains multiple ordered three-dimensional position points. The two-dimensional plane is a plane determined in a local coordinate system based on the osteotomy contour construction. Projection expansion is performed on the contour image corresponding to the two-dimensional polygon point set along the first direction, so that a continuous expansion region is formed in the first direction; Extract the boundary curve of the continuously extended region in a second direction, which is perpendicular to the first direction; Based on the projection matrix of the local coordinate system, the boundary curve is mapped to a three-dimensional space to obtain a safe boundary in the three-dimensional space. The projection matrix is ​​determined when constructing the local coordinate system.

[0007] Optionally, the step of projecting the three-dimensional contour point set onto a two-dimensional plane to obtain a two-dimensional polygon point set includes: A local coordinate system is constructed based on the osteotomy contour corresponding to the three-dimensional contour point set; Projecting multiple three-dimensional position points contained in the three-dimensional contour point set onto the local coordinate system yields a two-dimensional polygon point set containing multiple two-dimensional position points.

[0008] Optionally, constructing a local coordinate system based on the osteotomy contour corresponding to the three-dimensional contour point set includes: Determine the first normal vector of the plane containing the osteotomy contour and the second direction vector of the surgical instrument movement; The second direction vector of the surgical instrument's motion is projected onto the plane and normalized to obtain the second orthogonal basis; Calculate the cross product between the second orthogonal basis and the third orthogonal basis corresponding to the first normal vector to obtain the first orthogonal basis; A local coordinate system is generated based on the center point of the osteotomy contour and the first, second, and third orthogonal bases.

[0009] Optionally, the projection expansion of the contour image corresponding to the two-dimensional polygon point set along the first direction includes: The projected image on the two-dimensional plane is converted into a binary image, and the boundary of the binary image is expanded to distinguish the foreground region and the background region in the projected image; wherein the foreground region constitutes the contour image corresponding to the two-dimensional polygon point set; The foreground region is projected and extended along a first direction to extend a continuous foreground region in the projected image.

[0010] Optionally, the projection expansion of the foreground region along the first direction includes: When the first direction is vertical, determine whether there are pixels belonging to the foreground region above each pixel in the projected image; If there is a pixel belonging to the foreground region above the target pixel, then the target pixel is set as a foreground region pixel, and the target pixel is any pixel in the projected image.

[0011] Optionally, the number of the continuously extended regions includes multiple regions, and before extracting the boundary curve of the continuously extended regions in the second direction, the method further includes: The gaps between the multiple consecutive extended regions are filled.

[0012] Optionally, filling the gaps between the plurality of said consecutive extended regions includes: Along the first direction, the multiple continuous extended regions are divided into multiple intervals, and adjacent intervals are paired. For each pair of intervals, a connection start height is determined at the position belonging to the foreground region in the first direction, and each pair of intervals is connected according to the connection start height; Fill the gaps in each pair of intervals that are below the connection start height.

[0013] Optionally, extracting the boundary curve of the continuously extended region in the second direction includes: Perform directional consistency detection on each boundary point of the continuously expanding region along the second direction; By merging the boundary points belonging to the same linear trend into a single line segment, the boundary curve of the continuously expanding region in the second direction is obtained.

[0014] A second aspect of this application provides a three-dimensional security boundary generation apparatus, comprising: The projection module is used to project a three-dimensional contour point set onto a two-dimensional plane to obtain a two-dimensional polygon point set. The three-dimensional contour point set contains multiple ordered three-dimensional position points. The two-dimensional plane is a plane determined in a local coordinate system based on the osteotomy contour. An extension module is used to project and extend the contour image corresponding to the two-dimensional polygon point set along a first direction, so as to form a continuous extended region in the first direction. An extraction module is used to extract the boundary curve of the continuously extended region in a second direction, wherein the second direction is perpendicular to the first direction; A generation module is used to map the boundary curve to a three-dimensional space based on the projection matrix of the local coordinate system to obtain a safe boundary in the three-dimensional space. The projection matrix is ​​determined when constructing the local coordinate system.

[0015] In some examples, the first direction can be the longitudinal direction, and correspondingly, the second direction is the transverse direction perpendicular to the longitudinal direction.

[0016] A third aspect of this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the computer device performs the method as described in any of the first aspects above.

[0017] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a computer, implements the method described in any of the first aspects above.

[0018] A fifth aspect of this application provides a computer program product, including a computer program that, when the computer program is run, causes the method described in any of the first aspects above to be executed.

[0019] Compared with the prior art, the embodiments of this application have the following beneficial effects: In this embodiment, a two-dimensional polygon point set is obtained by projecting a three-dimensional contour point set onto a two-dimensional plane. Based on this, the contour image corresponding to the two-dimensional polygon point set can be projected and expanded along a first direction, so that the projected image can form a continuously expanded region in the first direction. Then, by extracting the boundary curve of the continuously expanded region in a second direction and mapping this boundary curve to three-dimensional space, a safe boundary in three-dimensional space can be obtained. Applying the three-dimensional safe boundary generation method provided in this embodiment, stable and controllable three-dimensional safe boundaries can be generated quickly. Applying this embodiment can solve the problem of how to reconstruct the safe boundary structure without complex topological calculations, solve the problem of achieving reasonable connection of multi-objective regions without explicit topological analysis, and flexibly control the boundary morphology according to different engineering needs, constructing an adjustable boundary generation method adapted to the application object.

[0020] Specifically, by implementing directional projection in the image domain and projection mapping between the two-dimensional plane and three-dimensional space, the original three-dimensional local structure can be transformed into a column-level continuous constraint structure along a specified direction, thereby explicitly introducing directional control during boundary generation. This avoids unnecessary lateral expansion and enables directional reconstruction of the structure without complex topology analysis, ensuring that the final generated boundary naturally meets the requirements of a specific safety or processing direction.

[0021] Secondly, this application's embodiments achieve automatic connection between multiple discrete regions through row-level scanning and filling mechanisms in the image domain, avoiding the processing flow that relies on geometric Boolean operations or complex topological judgments in traditional methods, thereby reducing computational complexity and improving processing stability. Simultaneously, this application's embodiments combine morphological processing and boundary simplification strategies to effectively suppress noise and jagged edges introduced by discrete sampling. Furthermore, through configurable structural elements, the geometric features of the boundaries can be adjusted, enabling adaptation to the boundary shapes required by different surgical tools.

[0022] Third, the embodiments of this application, by extracting boundaries by column, can transform complex regions into boundary expressions in the form of single-valued functions. Combined with line segment merging and monotonicity constraint optimization methods, local jitter and redundant boundary points are eliminated. The embodiments of this application enable the generated boundaries to possess good continuity and controllability, facilitating direct use in path planning and motion control. Simultaneously, it can improve the overall stability and reliability of the algorithm in engineering applications.

[0023] The three-dimensional safety boundary generation method, apparatus, and computer equipment provided in this application can be applied to the following scenarios: 1. Medical image processing: Applicable to region connection, structural completion and morphological constraint processing in medical images, such as segmentation result restoration, region continuity enhancement, etc.

[0024] 2. 3D Medical Software Platform: It can be integrated into medical image post-processing software, 3D reconstruction platforms or visualization systems to achieve regional structure optimization and completion in the form of algorithm modules.

[0025] 3. Surgical navigation system: It can be used for preoperative image processing or intraoperative auxiliary analysis, providing support for the continuity and boundary constraints of structural regions.

[0026] 4. Robot path planning: It can be used to generate path constraints based on images or spatial data, and help determine safe operating areas or feasible path ranges.

[0027] 5. Industrial Image Processing: Applicable to contour connection, missing region completion, and structural constraint analysis in industrial vision, such as part contour repair and boundary generation.

[0028] 6. Automated processing control: It can be used for the generation and optimization of processing area boundaries, auxiliary path planning and processing range control. Attached Figure Description

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

[0030] Figure 1 This is a schematic diagram of the overall process of a three-dimensional security boundary generation method provided in an embodiment of this application; Figure 2 This is a schematic diagram of a three-dimensional boundary image processing procedure provided in an embodiment of this application; Figure 3 This is a schematic diagram of a directional projection extension provided in an embodiment of this application; Figure 4 This is a schematic diagram of a multi-region connection provided in an embodiment of this application; Figure 5 This is a schematic diagram of a three-dimensional security boundary provided in an embodiment of this application; Figure 6 This is a schematic diagram of a three-dimensional security boundary generation method provided in an embodiment of this application; Figure 7 This is a schematic diagram of a three-dimensional security boundary generation device provided in an embodiment of this application; Figure 8 This is a schematic diagram of a computer device provided in an embodiment of this application. Detailed Implementation

[0031] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0032] As described in the background section, existing technologies for generating safe boundaries for 3D models or contours typically employ methods based on geometric offset or symbolic distance fields. However, both of these methods suffer from high processing complexity and difficulty in meeting the demands of real-time applications.

[0033] Furthermore, in specific engineering applications, such as path planning for surgical instruments, different types of tools have different requirements for boundary morphology, making it difficult to directly use the aforementioned two methods to generate safe boundaries that meet the actual needs of the corresponding tools. For example, saw blades are typically suitable for boundaries that are approximately straight or have angular features, while drills are more suitable for smooth, continuous boundary curves. Existing methods lack the ability to directly adapt to the geometric characteristics of tools when generating safe boundaries, making it difficult to flexibly control the boundary morphology through a unified process.

[0034] As can be seen from the above analysis and the background description, existing technologies generally suffer from the following problems when dealing with boundary generation tasks for complex 3D contours: 1. It is difficult to reasonably connect or simplify multi-region structures without introducing complex topological calculations.

[0035] 2. The lack of directional constraints on the boundary generation process makes it difficult to meet security requirements in specific directions.

[0036] 3. The generated results are usually complete closed contours, making it difficult to directly generate functional boundaries required for tasks such as path planning; 4. It is difficult to flexibly control the boundary shape according to the needs of different tools or applications.

[0037] To address the aforementioned issues, embodiments of this application provide a method, apparatus, and computer device for generating three-dimensional safety boundaries, which can simplify and reconstruct complex topologies while ensuring computational efficiency; by introducing directional constraints, it can support the generation of safety boundaries adapted to specific engineering objects.

[0038] Specifically, by applying the three-dimensional safety boundary generation method, apparatus, and computer equipment provided in this application, for input multi-ring or multi-region three-dimensional contour data, a local coordinate system is first constructed in conjunction with the surgical path direction, thereby projecting the three-dimensional osteotomy contour onto a two-dimensional plane and converting it into a region representation in the image domain. Subsequently, by projecting and expanding the image region along a preset direction, the originally discrete or separated structures can form continuous constraints in that preset direction. Then, through row-level scanning and filling strategies, automatic connection and topological reconstruction of multiple target regions can be achieved. Based on this, this application combines morphological algorithms to process smooth regions, and adjusts the boundary shape through configurable structural elements to adapt to different engineering requirements. By extracting functional boundaries that satisfy specific constraints from the reconstructed regions, and performing simplification and monotonicity optimization, the resulting boundaries are finally mapped back to three-dimensional space, resulting in stable and controllable safety boundary results.

[0039] The technical solution of this application will be described below through specific embodiments.

[0040] Reference Figure 1 This diagram illustrates the overall flow of a three-dimensional security boundary generation method provided in an embodiment of this application. Figure 1 The process shown may specifically include the following steps: Step 1: Data Input and Preprocessing In this embodiment, the input data is three-dimensional data, such as a three-dimensional contour point set. The aforementioned three-dimensional contour point set can be represented as: Any point in the point set (i=1,2,……n) represents a three-dimensional location point. Therefore, the three-dimensional contour point set P It includes multiple three-dimensional location points.

[0041] For the input 3D contour point set P Computer equipment can preprocess it. The preprocessing may include: 1. Sort multiple three-dimensional location points to ensure they are continuously connected; 2. Pair set P The first and last points in the curve are closed to ensure that connecting multiple three-dimensional position points can form a closed curve. 3. Pair set P Filter out abnormal or duplicate points in the data.

[0042] Specifically, the 3D contour point set P, which serves as input data, may contain unordered 3D position points. The computer device can first sort these points, arranging them in a clockwise or counter-clockwise direction to ensure continuous connection. Furthermore, the computer device can perform closure processing on the first and last position points in the 3D contour point set P, ensuring that multiple 3D position points in P can form a closed curve. In addition, outliers and duplicate points in the point set P can be removed to reduce their impact on subsequent processing.

[0043] Through the above processing, it can be ensured that the 3D contour has a consistent topological structure and clear internal and external relationships during subsequent projection and region construction, avoiding region filling errors or boundary breaks due to disordered point order or unclosed points, thereby helping to improve the overall stability of the algorithm.

[0044] Combination Figure 1As shown in the middle frame 101, in addition to the three-dimensional contour point set P described above, the input three-dimensional data may also include a corresponding operating plane, which can be represented as: plane = {n, c}. This operating plane can be a plane determined based on the osteotomy contour, that is, a surgical plane determined based on each three-dimensional position point in the aforementioned three-dimensional contour point set P. Here, n is the normal vector of the plane containing the osteotomy contour, and c is the center point of the osteotomy contour.

[0045] like Figure 1 As shown in box 101, the input 3D data also includes the planned motion direction d, which is the direction of movement of the surgical instruments in the surgical planning. In some examples, this motion direction d can also be referred to as the direction vector of the surgical instrument movement.

[0046] The aforementioned operating plane and the planned motion direction d can be used to construct a local coordinate system in subsequent steps and transform the original three-dimensional local structure into a continuous constraint structure along the specified direction. This explicitly introduces directional control during the boundary generation process, ensuring that the generated safety boundary meets the safety requirements of a specific direction or the direction of movement of the surgical instrument.

[0047] like Figure 2 The image shown is a schematic diagram of a three-dimensional boundary image processing procedure provided in an embodiment of this application. Figure 2 In (a), a schematic diagram of a three-dimensional boundary formed by connecting ordered three-dimensional position points in a three-dimensional contour point set P is shown, along with an example of the direction d of surgical instrument movement planned within this three-dimensional boundary. Figure 2 In (a), the direction of movement of the surgical instrument is longitudinal.

[0048] Step 2: Local coordinate system construction and 2D projection This step is... Figure 1 The contents shown in the middle frame 102 and 103 are: constructing a local coordinate system F and projecting the three-dimensional contour point set P.

[0049] In the embodiments of this application, the aforementioned local coordinate system F can also be called a projected coordinate system, which can be constructed based on the input three-dimensional data.

[0050] Specifically, for the operation plane plane={n, c} used as input data, given the center point c of the osteotomy contour, the normal vector of the plane containing the osteotomy contour is n, and the instrument motion direction vector in the surgical planning is d, the direction vectors can be orthogonalized by letting:

[0051] By projecting the direction of movement of the surgical instruments onto the plane containing the osteotomy contour, the following expression can be obtained:

[0052] After normalization, we get:

[0053] The negative sign in the above expression indicates that the direction of the safety boundary opening is opposite to the direction of movement of the surgical instruments.

[0054] Based on this, a third orthogonal basis can be constructed:

[0055] Thus, a locally orthogonal coordinate system, i.e., the local coordinate system F=, can be obtained. .

[0056] Furthermore, in the process of constructing the aforementioned local coordinate system, a corresponding projection matrix can be obtained. This projection matrix can be used in subsequent processing to map a set of points (such as boundary curves) in a two-dimensional plane to a three-dimensional space.

[0057] like Figure 1 As shown in box 103, based on the constructed local coordinate system F, the two-dimensional polygon boundary Ω can be obtained based on the three-dimensional contour point set P and the local coordinate system F.

[0058] The above process is the process of projecting each three-dimensional point in the three-dimensional contour point set P onto a two-dimensional plane.

[0059] Specifically, for any three-dimensional position point in the three-dimensional contour point set P Its two-dimensional coordinates in the local coordinate system F can be represented as ( , ),in: After completing the projection processing of all three-dimensional position points in the three-dimensional contour point set P, a two-dimensional point set can be obtained:

[0060] Furthermore, a two-dimensional polygon point set can be obtained:

[0061] See Figure 2 ,exist Figure 2 In (b) of the diagram, an example of a two-dimensional projection is shown, which can be a projection of... Figure 2 The three-dimensional boundary shown in (a) is projected onto a two-dimensional plane.

[0062] Step 3: Region Rasterization This step is... Figure 1The content shown in the middle frame 104 is the set of points of a two-dimensional polygon. Rasterization to binary image I The process.

[0063] Specifically, this can be applied to a two-dimensional polygon point set. The points in the image that belong to the above two-dimensional polygon set can be... Each pixel within the set is binarized and associated with the pixel belonging to that set. The external pixels are distinguished.

[0064] For example, the above binarization process can be represented as:

[0065] By using region rasterization, continuous geometric regions can be discretized into pixel-level representations, enabling complex topological relationships to be transformed into regular grid structures, thus providing a unified data format for subsequent scanning and morphological operations.

[0066] In one possible implementation of this application, after the two-dimensional image is rasterized, the binary image can also be extended to avoid boundary truncation.

[0067] See Figure 2 ,exist Figure 2 In (c), an example of a two-dimensional image after region rasterization is shown, that is, a... Figure 2 The binary image obtained after binarizing the two-dimensional projection image shown in (b) is the shadow area of ​​the binary image, which is the foreground area and the other areas are the background areas.

[0068] Step 4: Directional Projection Extension In this step, a projection expansion operation can be performed on the image along a preset direction, which can be the same direction as the movement direction of the surgical instrument. For example, such as... Figure 1 As shown in box 105, during the directional projection expansion process, the foreground pixels of the image can be projected and expanded column by column.

[0069] Specifically, when performing column-wise projection expansion, the following rule can be defined for the x-value of each column:

[0070] The above rule means that when projecting and expanding by column, if there are foreground pixels above a certain pixel, then that pixel is set as the foreground.

[0071] By extending the projection direction, vertical trailing can be achieved, which extends the local structure into column-level region constraints in the image, thereby forming continuous regions in a specified direction. This enables implicit connections between different regions in that direction without explicit topological analysis, and allows the final generated boundary to naturally meet the requirements of the safe direction.

[0072] like Figure 3 The diagram shown is a schematic diagram of a directional projection extension provided in an embodiment of this application. Figure 3 The image shown is the result of expanding the foreground region column by column. Specifically, in Figure 3 The two spherical regions 301 and 302 shown are the foreground regions after rasterization. Below regions 301 and 302 is the image region obtained after column-wise projection expansion, i.e. Figure 3 The regions 3011 and 3021 shown are the images obtained after projecting and expanding the image columnwise, by setting each pixel below the foreground regions 301 and 302 as the foreground as well.

[0073] Step 5: Row-level range join This step is... Figure 1 The content shown in the middle frame 106 represents the projection boundaries of different connected regions based on interval pairing. This step enables constrained connections of the foreground region in the projection direction. For example, for... Figure 3 The image, after being projected and extended, can be connected along the projection direction after this step. Figure 3 Regions 3011 and 3021 in the text.

[0074] In this step, after projecting the foreground region along a predetermined direction, the two-dimensional foreground distribution can be mapped to a one-dimensional feature function, and a continuous foreground interval can be divided accordingly.

[0075] In this embodiment, the foreground region can be divided into multiple intervals along the projection direction based on the projection extension result, and adjacent intervals can be paired. For each paired interval, the boundary for constraining the connection region can be determined based on the spatial distribution characteristics of the pair of intervals. Then, under the constraint conditions, the gaps between the paired intervals are filled, thereby achieving constrained connection of the regions.

[0076] Specifically, the projection function can be defined as follows: The above function can be used to obtain the column interval where the values ​​are consecutively 1. Define the above column intervals. The top function is:

[0077] It is possible for two adjacent intervals and To achieve gap filling.

[0078] After the above processing, it can be achieved through the projection function. By mapping a two-dimensional region to a one-dimensional interval structure, the explicit analysis of the original geometric topological relationships can be avoided in subsequent processing.

[0079] As a specific example of an embodiment of this application, taking the projection direction as vertical as an example, when performing row-level region connection, for each pair of intervals, the connection start height can be determined according to the position of the foreground region at the top of its boundary column, and the interval gaps can be filled below this height to achieve constrained connection of regions.

[0080] The starting height of the connection can be expressed as:

[0081] The corresponding filling area (gap) can be represented as:

[0082] by Figure 4 For example, Figure 4 A schematic diagram of a multi-region connection is shown. Figure 4 It contains two foreground regions, namely foreground regions 401 and 402. These foreground regions are divided into two adjacent regions along the projection direction, which are briefly represented as intervals 4011 and 4021. When connecting row-level regions, this can be achieved by connecting according to the highest point of each interval, for example... Figure 4 Midpoints A and B are the highest points adjacent to each other in intervals 4011 and 4021, respectively. Therefore, connecting points A and B forms the boundary obtained by connecting the highest points. Figure 4 (The connection method is shown by the yellow line in the middle). In another possible implementation, the connection can also be made according to the lowest point, i.e. Figure 4 The connection method between midpoint C and point D ( Figure 4 (The connection method is shown by the red line in the middle). Alternatively, it can be done using... Figure 4 Connect any curve between lines AB and CD. For example, Figure 4 The connection method is indicated by the green lines. Furthermore, the specific form of the green line connection method can be adjusted according to different surgical needs. This application does not limit this aspect.

[0083] Step Six: Morphological Smoothing This step is... Figure 1 The content shown in the middle frame 107 is image morphological processing.

[0084] In this step, morphological processing of the image can refer to performing a morphological dilation operation on the image. This operation can be represented as:

[0085] in, The selected element structure.

[0086] In this embodiment, by selecting structural elements of different shapes (e.g., rectangles or circles), the morphological features of the boundary can be controlled, thereby enabling the final generated boundary result to adapt to different engineering requirements. For example, angular or smooth boundaries can be generated to facilitate osteotomy operations using corresponding different types of surgical instruments.

[0087] Step 7: Boundary Extraction This step is... Figure 1 The content of "Boundary Extraction" shown in the middle frame 108 is to extract the boundary curve in the image after morphological smoothing.

[0088] Specifically, during boundary extraction, for each column x in the 2D image, the topmost foreground point can be extracted. This operation can be represented as:

[0089] In this way, we can obtain the boundary curve in the form of a single-valued function.

[0090] It should be noted that the boundaries extracted in this step are merely functional boundaries that meet the specific task requirements, and not complete closed contours.

[0091] Step 8: Boundary Simplification and Monotonic Constraints This step is... Figure 1 The "optimization" content shown in the middle frame 108 refers to the optimization processing of the boundary curve extracted in step seven above.

[0092] In this embodiment, since the boundaries extracted in the aforementioned steps originate from a pixel grid, their adjacent points typically exhibit alternating horizontal or vertical variations, forming a stepped structure. This stepped structure geometrically corresponds to an approximate straight line but contains a large number of redundant points. Therefore, in this step, by detecting the directional consistency between consecutive points, points belonging to the same linear trend can be merged into a single line segment, thereby preserving key endpoints. Furthermore, in this step, by ensuring... This is to prevent the boundary from retreating or localized depressions from occurring.

[0093] In the specific implementation, assume the input boundary point sequence is as follows: ,in, This represents discrete boundary points arranged in sequence.

[0094] Therefore, for any three consecutive boundary points: Adjacent vectors can be defined as:

[0095]

[0096] The three boundary points can be considered to have the same direction when the following conditions are met:

[0097] That is to say:

[0098] The above conditions indicate that the three points are collinear or in the same direction.

[0099] Step Nine: Mapping from Two Dimensions to Three Dimensions This step is... Figure 1 The "dimensional upgrade" content shown in the middle frame 108 refers to mapping the optimized two-dimensional boundary points to three-dimensional space.

[0100] In this embodiment, mapping the optimized two-dimensional boundary points to three-dimensional space can be achieved based on the projection matrix obtained when constructing the local coordinate system. For example, the two-dimensional boundary points can be mapped back to three-dimensional space by performing an inverse operation on the projection matrix.

[0101] In this process, directly performing the inverse operation of the projection matrix will result in the loss of height information. However, since the purpose of generating a 3D safety boundary is to obtain a safety boundary on a plane in 3D space, the height value is not needed; it is only necessary to ensure that the 3D points remapped to 3D space are on the same plane. On the other hand, when mapping the optimized 2D boundary points to 3D space, the center point of the osteotomy plane should also be considered. Through translation operations in 3D space, the safety boundary line can be translated to a position centered on the center point of the osteotomy plane and moved to a suitable osteotomy plane.

[0102] Specifically, for two-dimensional boundary points Its corresponding location point in three-dimensional space is:

[0103] According to the above expression, without using the orthogonal basis e3, the height cannot be recovered when mapping the two-dimensional boundary points to three-dimensional space. However, one of the purposes of this application's embodiments is to ensure that the generated safe boundary is a safe boundary on the plane plane = (center point c, e1, e2, e3 = normal vector n) and therefore no height value is needed; it is only necessary to ensure that the recovered three-dimensional points are on the plane. Therefore, for two-dimensional boundary points... The corresponding position point in three-dimensional space can be represented in the form of the above expression, and On a plane.

[0104] Adding the center point c of the osteotomy plane means that the safety boundary line can be translated in three-dimensional space, and the safety boundary line is translated to the position centered at c, which is also exactly the plane.

[0105] like Figure 5 The diagram shown is a schematic diagram of a three-dimensional security boundary provided in an embodiment of this application. Figure 5 This illustrates the safety boundaries processed and mapped to three-dimensional space according to the aforementioned steps. Figure 5 The red area 501 is the surgical execution area, and the green boundary 502 is the safety boundary area generated according to the aforementioned method.

[0106] In this embodiment, by implementing directional projection in the image domain and projection mapping between the two-dimensional plane and the three-dimensional space, the original three-dimensional local structure can be transformed into a column-level continuous constraint structure along a specified direction, thereby explicitly introducing directional control during boundary generation. This avoids unnecessary lateral expansion and enables directional reconstruction of the structure without complex topology analysis, ensuring that the final generated boundary naturally meets the requirements of a specific safety or processing direction.

[0107] Secondly, this application's embodiments achieve automatic connection between multiple discrete regions through row-level scanning and filling mechanisms in the image domain, avoiding the processing flow that relies on geometric Boolean operations or complex topological judgments in traditional methods, thereby reducing computational complexity and improving processing stability. Simultaneously, this application's embodiments combine morphological processing and boundary simplification strategies to effectively suppress noise and jagged edges introduced by discrete sampling. Furthermore, through configurable structural elements, the geometric features of the boundaries can be adjusted, enabling adaptation to the boundary shapes required by different surgical tools.

[0108] Third, the embodiments of this application, by extracting boundaries by column, can transform complex regions into boundary expressions in the form of single-valued functions. Combined with line segment merging and monotonicity constraint optimization methods, local jitter and redundant boundary points are eliminated. The embodiments of this application enable the generated boundaries to possess good continuity and controllability, facilitating direct use in path planning and motion control. Simultaneously, it can improve the overall stability and reliability of the algorithm in engineering applications.

[0109] In conjunction with the foregoing embodiments, refer to Figure 6 The diagram illustrates a three-dimensional security boundary generation method provided in an embodiment of this application. This method may specifically include the following steps S601-S604: S601. Project the three-dimensional contour point set onto a two-dimensional plane to obtain a two-dimensional polygon point set.

[0110] It should be noted that the embodiments of this application can be applied to computer devices, that is, the subject of this method is a computer device, which can be a desktop computer, a cloud server, or other devices. The embodiments of this application do not limit the specific type of computer device.

[0111] In this embodiment, the three-dimensional contour point set can be the three-dimensional contour point set P described in the foregoing embodiments, which can be represented as: Any point in point set P (i=1,2,……n) represents one of the three-dimensional position points.

[0112] In one possible implementation of this application embodiment, for the input three-dimensional contour point set P Computer equipment can preprocess it. Specific preprocessing may include, as described in the preceding embodiments, sorting multiple three-dimensional location points to ensure continuous connectivity; and processing the point set... P The starting and ending points in the data are closed to ensure that connecting multiple 3D position points can form a closed curve; and the point set is processed... P The system performs filtering and other processing on abnormal or duplicate points.

[0113] Therefore, the above three-dimensional contour point set It can also be a set of points obtained after preprocessing, where the set P contains multiple ordered three-dimensional location points.

[0114] In this embodiment of the application, for the input three-dimensional contour point set P, the computer device can project it onto a two-dimensional plane to obtain a two-dimensional polygon point set. The two-dimensional plane can be a plane determined in a local coordinate system based on the osteotomy contour construction.

[0115] Therefore, before projecting the three-dimensional contour point set P, a local coordinate system can be constructed based on the osteotomy contour corresponding to the three-dimensional contour point set. Then, the multiple three-dimensional position points contained in the three-dimensional contour point set can be projected onto the local coordinate system to obtain a two-dimensional polygon point set containing multiple two-dimensional position points.

[0116] When constructing a local coordinate system, the computer device can determine the first normal vector of the plane containing the osteotomy contour and the second direction vector of the surgical instrument's movement. The first normal vector can be vector n in the aforementioned embodiments, and the second direction vector can be the vector corresponding to the planned movement direction d in the aforementioned embodiments. Then, by projecting the second direction vector of the surgical instrument's movement onto the plane and normalizing it, a second orthogonal basis can be obtained. This second orthogonal basis can be the orthogonal basis in the aforementioned embodiments. Based on this, the second orthogonal basis is calculated. The cross product of the third orthogonal basis corresponding to the first normal vector n yields the first orthogonal basis. The aforementioned third orthogonal basis can be any of the orthogonal bases described in the preceding embodiments. That is to say:

[0117]

[0118] The second orthogonal basis mentioned above is obtained by normalizing the following expression:

[0119] therefore:

[0120] In this way, the center point c of the osteotomy contour and the first orthogonal basis can be used as the basis. Second orthogonal basis and the third orthogonal basis Generate a local coordinate system F= .

[0121] The center point c of the osteotomy contour can be obtained through the operation plane plane={n, c} of the input data.

[0122] For details on how to construct the local coordinate system, please refer to the "Step Two" section of the aforementioned embodiments. It will not be repeated here.

[0123] S602. Project and extend the contour image corresponding to the two-dimensional polygon point set along the first direction, so as to form a continuous extended region in the first direction.

[0124] In the embodiments of this application, the first direction may be related to the direction of movement of the surgical instrument. For example, if the surgical instrument moves longitudinally, the first direction may be longitudinal.

[0125] Therefore, after projecting the three-dimensional contour point set onto the two-dimensional plane to obtain the two-dimensional polygon point set, the computer device can project and expand the contour image corresponding to the two-dimensional polygon point set along the first direction, so that the contour image forms a continuous extended region in the first direction.

[0126] In this embodiment of the application, when projecting and expanding the contour image corresponding to the two-dimensional polygon point set along the first direction, the projected image on the two-dimensional plane can be converted into a binary image first, and the boundary of the binary image can be expanded to distinguish the foreground region and the background region in the projected image; wherein, the foreground region constitutes the contour image corresponding to the two-dimensional polygon point set.

[0127] For details on the process of converting a projected image on a two-dimensional plane into a binary image, please refer to step three of the aforementioned embodiments, which describes the region rasterization process.

[0128] Then, the computer device can project and expand the foreground region along the first direction to extend a continuous foreground region in the projected image. This process can be found in step four of the foregoing embodiments, which describes the directional projection expansion.

[0129] Specifically, taking the first direction as vertical as an example, when the first direction is vertical, the computer device can determine whether there is a pixel belonging to the foreground region above each pixel in the projected image. If there is a pixel belonging to the foreground region above the target pixel, then the target pixel can be set as a foreground region pixel. The target pixel can be any pixel in the projected image.

[0130] For an example of the effect of projecting and expanding the foreground area along the vertical direction, please refer to [link / reference]. Figure 3 As shown.

[0131] S603. Extract the boundary curve of the continuously extended region in the second direction.

[0132] In this embodiment, the second direction can be perpendicular to the first direction. For example, if the first direction is longitudinal, the second direction can be transverse. Thus, after projecting and expanding the foreground region longitudinally, the boundary curve can be extracted transversely.

[0133] In one possible implementation of this application, the number of consecutive extended regions may include multiple regions. When multiple consecutive extended regions exist, gaps may exist between them. Therefore, before extracting the boundary curve along the second direction, the gaps between the multiple consecutive extended regions can be filled.

[0134] Specifically, multiple consecutive extended regions can be divided into multiple intervals along a first direction, such as longitudinal, and adjacent intervals can be paired. Then, for each pair of intervals, a connection start height is determined at the position belonging to the foreground region in the first direction, and each pair of intervals is connected according to the connection start height, thereby filling the gaps in each pair of intervals below the connection start height.

[0135] The process of filling the gaps between multiple consecutive extended regions described above is the same as the operation described in step five of the preceding embodiments, specifically the row-level region connection section. For relevant details, please refer to the description in the preceding embodiments; they will not be repeated here.

[0136] In another possible implementation of this application embodiment, to facilitate adaptation to different types of surgical instruments, after completing the row-level region connection processing, the computer device can also perform morphological dilation on the processed image, which is the operation described in step six of the aforementioned embodiments. Thus, by selecting structural elements of different shapes (e.g., rectangles or circles), the morphological features of the boundary can be controlled, allowing the final generated boundary result to adapt to different engineering requirements. For example, angular or smooth boundaries can be generated to accommodate different types of surgical instruments used for osteotomy.

[0137] Based on this, the computer device can extract the topmost foreground point along a second direction, such as horizontally, as the boundary curve. The extracted boundary curve at this point is merely a functional boundary that meets the specific task requirements, not a complete closed contour.

[0138] Therefore, the computer device can also filter out a large number of redundant points on the boundary and retain only the key endpoints by performing the boundary simplification and monotonic constraint processing corresponding to step eight in the aforementioned embodiments.

[0139] Specifically, the computer device can perform directional consistency detection on each boundary point of the continuously expanding region along the second direction. By merging each boundary point belonging to the same linear trend into a single line segment, the boundary curve of the continuously expanding region in the second direction can be obtained.

[0140] The specific processing steps for performing directional consistency detection on each boundary point can be found in step eight of the aforementioned embodiments, and will not be repeated here.

[0141] S604. Based on the projection matrix of the local coordinate system, the boundary curve is mapped to three-dimensional space to obtain the safe boundary in three-dimensional space.

[0142] Since the extracted boundary curve is a curve on a two-dimensional plane, in order to generate a safe boundary in three-dimensional space, the boundary curve can be mapped to three-dimensional space to obtain a safe boundary in three-dimensional space.

[0143] In one possible implementation of this application, since projecting a three-dimensional contour point set onto a two-dimensional plane to obtain a two-dimensional polygon point set is done in a local coordinate system constructed based on the osteotomy contour, after processing the two-dimensional polygon point set in the aforementioned local coordinate system, the boundary curves in the two-dimensional plane can be remapped to three-dimensional space based on the projection matrix of the local coordinate system to obtain a safe boundary in three-dimensional space. The aforementioned projection matrix is ​​determined when constructing the local coordinate system. Specifically, in the constructed local coordinate system F= In the context of any two-dimensional boundary point The position points of the two-dimensional boundary points in three-dimensional space can be obtained from the projection matrix of the local coordinate system F, i.e.:

[0144] For an explanation of how to map the optimized 2D boundary points back to 3D space based on the above expression, please refer to the description of "Step Nine: Mapping from 2D to 3D" in the aforementioned embodiment, which will not be repeated here.

[0145] As an example of an embodiment of this application, the safety boundary in three-dimensional space can be as follows: Figure 5 The green boundary 502 is shown in the image.

[0146] It should be noted that the three-dimensional safety boundary generation method described in this embodiment has a similar processing procedure to that described in the previous embodiments. For relevant details, please refer to the aforementioned embodiments and... Figures 1 to 5 The description of the corresponding implementation details will not be repeated here.

[0147] In this embodiment, a two-dimensional polygon point set is obtained by projecting a three-dimensional contour point set onto a two-dimensional plane. Based on this, the contour image corresponding to the two-dimensional polygon point set can be projected and expanded along a first direction, so that the projected image can form a continuously expanded region in the first direction. Then, by extracting the boundary curve of the continuously expanded region in a second direction and mapping this boundary curve to three-dimensional space, a safe boundary in three-dimensional space can be obtained. Applying the three-dimensional safe boundary generation method provided in this embodiment, stable and controllable three-dimensional safe boundaries can be generated quickly.

[0148] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0149] Reference Figure 7 The diagram illustrates a three-dimensional security boundary generation device provided in an embodiment of this application, which may specifically include a projection module 701, an expansion module 702, an extraction module 703, and a generation module 704, wherein: Projection module 701 is used to project a three-dimensional contour point set onto a two-dimensional plane to obtain a two-dimensional polygon point set. The three-dimensional contour point set contains multiple ordered three-dimensional position points. The two-dimensional plane is a plane determined in a local coordinate system based on the osteotomy contour construction. The extension module 702 is used to project and extend the contour image corresponding to the two-dimensional polygon point set along the first direction, so as to form a continuous extended region in the first direction. Extraction module 703 is used to extract the boundary curve of the continuous extended region in a second direction, wherein the second direction is perpendicular to the first direction; The generation module 704 is used to map the boundary curve to a three-dimensional space based on the projection matrix of the local coordinate system to obtain a safe boundary in the three-dimensional space. The projection matrix is ​​determined when constructing the local coordinate system.

[0150] In some examples, the first direction can be the longitudinal direction, and correspondingly, the second direction is the transverse direction perpendicular to the longitudinal direction.

[0151] In this embodiment of the application, the projection module 701 can be specifically used for: A local coordinate system is constructed based on the osteotomy contour corresponding to the three-dimensional contour point set; Projecting multiple three-dimensional position points contained in the three-dimensional contour point set onto the local coordinate system yields a two-dimensional polygon point set containing multiple two-dimensional position points.

[0152] In one possible implementation of this application embodiment, the projection module 701 may also be used for: Determine the first normal vector of the plane containing the osteotomy contour and the second direction vector of the surgical instrument movement; The second direction vector of the surgical instrument's motion is projected onto the plane and normalized to obtain the second orthogonal basis; Calculate the cross product between the second orthogonal basis and the third orthogonal basis corresponding to the first normal vector to obtain the first orthogonal basis; A local coordinate system is generated based on the center point of the osteotomy contour and the first, second, and third orthogonal bases.

[0153] In this embodiment of the application, the extension module 702 can be specifically used for: The projected image on the two-dimensional plane is converted into a binary image, and the boundary of the binary image is expanded to distinguish the foreground region and the background region in the projected image; wherein the foreground region constitutes the contour image corresponding to the two-dimensional polygon point set; The foreground region is projected and extended along a first direction to extend a continuous foreground region in the projected image.

[0154] In one possible implementation of this application embodiment, the extension module 702 may also be used for: When the first direction is vertical, determine whether there are pixels belonging to the foreground region above each pixel in the projected image; If there is a pixel belonging to the foreground region above the target pixel, then the target pixel is set as a foreground region pixel, and the target pixel is any pixel in the projected image.

[0155] In this embodiment of the application, the number of continuously extended regions may include multiple regions, and the extraction module 703 may specifically be used for: The gaps between the multiple consecutive extended regions are filled.

[0156] In one possible implementation of this application embodiment, the extraction module 703 may also be used for: Along the first direction, the multiple continuous extended regions are divided into multiple intervals, and adjacent intervals are paired. For each pair of intervals, a connection start height is determined at the position belonging to the foreground region in the first direction, and each pair of intervals is connected according to the connection start height; Fill the gaps in each pair of intervals that are below the connection start height.

[0157] In another possible implementation of this application embodiment, the extraction module 703 may also be used for: Perform directional consistency detection on each boundary point of the continuously expanding region along the second direction; By merging the boundary points belonging to the same linear trend into a single line segment, the boundary curve of the continuously expanding region in the second direction is obtained.

[0158] This application provides a three-dimensional security boundary generation device, which can achieve the aforementioned... Figures 1 to 5 The device or its components, modules, etc., corresponding to the methods or steps in the embodiments. By using this device, the steps in the aforementioned method embodiments can be implemented.

[0159] As the apparatus embodiments are basically similar to the method embodiments, they are described in a relatively simple manner. For relevant details, please refer to the description in the method embodiment section.

[0160] Reference Figure 8 The diagram illustrates a computer device provided in an embodiment of this application. Figure 8 As shown, the computer device 800 in this embodiment includes: a processor 810, a memory 820, and a computer program 821 stored in the memory 820 and executable on the processor 810. When the processor 810 executes the computer program 821, it implements the steps in the various embodiments of the three-dimensional security boundary generation method described above, for example... Figure 1 The steps shown in boxes 101 to 108 are or Figure 6Steps S601 to S604 are shown. Alternatively, when the processor 810 executes the computer program 821, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 7 The functions of modules 701 to 704 are shown.

[0161] For example, the computer program 821 can be divided into one or more modules / units, which are stored in the memory 820 and executed by the processor 810 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which can be used to describe the execution process of the computer program 821 in the computer device 800. For example, the computer program 821 can be divided into a projection module, an extension module, an extraction module, and a generation module, with the specific functions of each module as follows: The projection module is used to project a three-dimensional contour point set onto a two-dimensional plane to obtain a two-dimensional polygon point set. The three-dimensional contour point set contains multiple ordered three-dimensional position points. The two-dimensional plane is a plane determined in a local coordinate system based on the osteotomy contour. An extension module is used to project and extend the contour image corresponding to the two-dimensional polygon point set along a first direction, so as to form a continuous extended region in the first direction. An extraction module is used to extract the boundary curve of the continuously extended region in a second direction, wherein the second direction is perpendicular to the first direction; A generation module is used to map the boundary curve to a three-dimensional space to obtain a safe boundary in the three-dimensional space. The projection matrix is ​​determined when constructing the local coordinate system.

[0162] The computer device 800 may be a device capable of implementing the various steps or corresponding functions in the foregoing method embodiments. The computer device 800 may be a desktop computer, a cloud server, or other similar devices. The computer device 800 may include, but is not limited to, a processor 810 and a memory 820. Those skilled in the art will understand that... Figure 8 This is merely one example of a computer device 800 and does not constitute a limitation on the computer device 800. It may include more or fewer components than shown, or combine certain components, or different components. For example, the computer device 800 may also include input / output devices, network access devices, buses, etc.

[0163] The processor 810 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0164] The memory 820 can be an internal storage unit of the computer device 800, such as a hard disk or memory of the computer device 800. The memory 820 can also be an external storage device of the computer device 800, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 800. Furthermore, the memory 820 can include both internal and external storage units of the computer device 800. The memory 820 is used to store the computer program 821 and other programs and data required by the computer device 800. The memory 820 can also be used to temporarily store data that has been output or will be output.

[0165] This application also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the methods described in the foregoing embodiments.

[0166] This application also discloses a computer-readable storage medium storing a computer program that, when executed by a computer, implements the methods described in the foregoing embodiments.

[0167] This application also discloses a computer program product, including a computer program that, when run on a computer, causes the computer to perform the methods described in the foregoing embodiments.

[0168] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for generating three-dimensional safety boundaries, characterized in that, include: Projecting a three-dimensional contour point set onto a two-dimensional plane yields a two-dimensional polygon point set. The three-dimensional contour point set contains multiple ordered three-dimensional position points. The two-dimensional plane is a plane determined in a local coordinate system based on the osteotomy contour construction. The contour image corresponding to the two-dimensional polygon point set is projected and expanded along a first direction, so that a continuous extended region is formed in the first direction, where the first direction is the longitudinal direction. Extract the boundary curve of the continuously extended region in a second direction, where the second direction is the lateral direction; Based on the projection matrix of the local coordinate system, the boundary curve is mapped to a three-dimensional space to obtain a safe boundary in the three-dimensional space. The projection matrix is ​​determined when constructing the local coordinate system.

2. The method according to claim 1, characterized in that, The process of projecting a three-dimensional contour point set onto a two-dimensional plane to obtain a two-dimensional polygon point set includes: A local coordinate system is constructed based on the osteotomy contour corresponding to the three-dimensional contour point set; Projecting multiple three-dimensional position points contained in the three-dimensional contour point set onto the local coordinate system yields a two-dimensional polygon point set containing multiple two-dimensional position points.

3. The method according to claim 2, characterized in that, The construction of a local coordinate system based on the osteotomy contour corresponding to the three-dimensional contour point set includes: Determine the first normal vector of the plane containing the osteotomy contour and the second direction vector of the surgical instrument movement; The second direction vector of the surgical instrument's motion is projected onto the plane and normalized to obtain the second orthogonal basis; Calculate the cross product between the second orthogonal basis and the third orthogonal basis corresponding to the first normal vector to obtain the first orthogonal basis; A local coordinate system is generated based on the center point of the osteotomy contour and the first, second, and third orthogonal bases.

4. The method according to any one of claims 1 to 3, characterized in that, The projection expansion of the contour image corresponding to the two-dimensional polygon point set along the first direction includes: The projected image on the two-dimensional plane is converted into a binary image, and the boundary of the binary image is expanded to distinguish the foreground region and the background region in the projected image; wherein the foreground region constitutes the contour image corresponding to the two-dimensional polygon point set; The foreground region is projected and extended along a first direction to extend a continuous foreground region in the projected image.

5. The method according to claim 4, characterized in that, The projection expansion of the foreground region along the first direction includes: Determine whether there are pixels belonging to the foreground region above each pixel in the projected image; If there is a pixel belonging to the foreground region above the target pixel, then the target pixel is set as a foreground region pixel, and the target pixel is any pixel in the projected image.

6. The method according to any one of claims 1 to 3 or 5, characterized in that, The number of continuously extended regions includes multiple regions, and before extracting the boundary curves of the continuously extended regions in the second direction, the process further includes: The gaps between the multiple consecutive extended regions are filled.

7. The method according to claim 6, characterized in that, Filling the gaps between the multiple consecutive extended regions includes: Along the first direction, the multiple continuous extended regions are divided into multiple intervals, and adjacent intervals are paired. For each pair of intervals, a connection start height is determined at the position belonging to the foreground region in the first direction, and each pair of intervals is connected according to the connection start height; Fill the gaps in each pair of intervals that are below the connection start height.

8. The method according to any one of claims 1 to 3, 5, or 7, characterized in that, The step of extracting the boundary curve of the continuously extended region in the second direction includes: Perform directional consistency detection on each boundary point of the continuously expanding region along the second direction; By merging the boundary points belonging to the same linear trend into a single line segment, the boundary curve of the continuously expanding region in the second direction is obtained.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it causes the computer device to implement the method as described in any one of claims 1 to 8.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is run, the method as described in any one of claims 1 to 8 is performed.