Breathing phase detection method and device, computer equipment and storage medium
By constructing a reference plane and comparing and analyzing the reference distance between the second marker and the reference distance between the preset time, the problem in the prior art that the patient's real-time respiratory phase and the respiratory phase difference during CT is solved, real-time respiratory phase monitoring and accurate lesion position judgment in the operation are achieved, and surgical accuracy is improved.
Patent Information
- Application Number
- CN202510137089.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art cannot accurately understand the difference between the patient's real-time respiratory phase and the respiratory phase when taking CT, making it difficult to achieve accurate lesion position judgment in soft tissue puncture surgery.
By obtaining the spatial coordinate information of the first marker and the second marker, a reference plane is constructed and the real-time distance of the second marker relative to the reference plane is calculated, the reference distance at the preset time is recorded, the real-time distance and the reference distance are compared and analyzed, and the indication signal of the gap between the current respiratory phase and the preset time is output.
It realizes dynamic monitoring of the patient's respiratory phase, provides real-time feedback for the operation, ensures that the surgical operation accurately reaches the target position, and improves the surgical accuracy.
Smart Images

Figure CN120053072A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of information processing, and particularly relates to a method and device for detecting respiratory phase, a computer device, and a storage medium. Background Art
[0002] With the continuous development of computer technology, medical technology has also achieved significant breakthroughs. Minimally invasive surgery has gradually become more popular than open surgery because, compared with open surgery, minimally invasive surgery has the characteristics of a small trauma area, a low infection rate, a fast patient recovery, and a short hospital stay. Many minimally invasive surgeries cause surgeons to lose direct visual feedback on the surgical site, and there are also problems such as too small an intraoperative visual field area and the need to repeatedly view preoperative images. Therefore, surgical navigation technology has become a feasible solution to alleviate these defects. Through an optical measurement device, the actual scenes such as surgical needles and patient bodies can be mapped into a software system in real time. Doctors can obtain more information through the software system in the computer, thereby improving the surgical accuracy and reducing stress.
[0003] Although the surgical navigation system has many advantages, in the puncture surgery of soft tissues, such as lung puncture surgery, real-time monitoring of the patient's respiratory phase is an important step. The puncture surgery judges the lesion position based on the patient's one-time computed tomography (CT) image, but the CT image is static, while the patient's breathing is dynamic. Therefore, it is impossible to accurately know the difference between the patient's real-time respiratory phase and the respiratory phase when the CT was taken. Summary of the Invention
[0004] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a method and device for detecting respiratory phase, a computer device, and a storage medium to solve the technical problem of being unable to accurately know the difference between the patient's real-time respiratory phase and the respiratory phase when the CT was taken.
[0005] To achieve the above purpose, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present invention provides a method for detecting respiratory phase, including:
[0007] Obtaining the spatial coordinate information of a first marker and constructing a reference plane;
[0008] Obtaining the spatial coordinate information of a second marker and calculating the real-time distance of the second marker relative to the reference plane;
[0009] Recording the reference distance of the second marker relative to the reference plane at a preset moment;
[0010] Compare and analyze the real-time distance with the reference distance, and output an indication signal indicating the gap between the current breathing phase and the breathing phase at a preset moment according to the comparison and analysis result.
[0011] In a second aspect, the present invention provides a breathing phase detection device, including:
[0012] A calibration module for obtaining the spatial coordinate information of a first marker and constructing a reference plane;
[0013] A tracking module for obtaining the spatial coordinate information of a second marker and calculating the real-time distance of the second marker relative to the reference plane;
[0014] A recording module for recording the reference distance of the second marker relative to the reference plane at a preset moment;
[0015] An analysis module for comparing and analyzing the real-time distance with the reference distance, and outputting an indication signal indicating the gap between the current breathing phase and the breathing phase at a preset moment according to the comparison and analysis result.
[0016] In a third aspect, the present invention provides a computer device, characterized by including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the breathing phase detection method as described above is implemented.
[0017] In a fourth aspect, the present invention provides a storage medium storing a computer program, the computer program including program instructions, and the program instructions can implement the breathing phase detection method as described above when executed by a processor.
[0018] The breathing phase detection method of the present invention can dynamically monitor the breathing phase of a patient through the comparison and analysis of the real-time distance and the reference distance, provide real-time feedback for surgical execution, ensure that the surgical operation accurately reaches the target position, and improve surgical precision.
[0019] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other objects, features, and advantages of the present invention more obvious and understandable, the following preferred embodiments are specifically described in detail as follows. Description of the Drawings
[0020] Figure 1 It is a flowchart of the breathing phase detection method according to an embodiment of the present invention;
[0021] Figure 2 It is a first sub-flowchart of the breathing phase detection method according to an embodiment of the present invention;
[0022] Figure 3 It is the second sub - flowchart of the breathing phase detection method according to the embodiments of the present invention;
[0023] Figure 4 It is the third sub - flowchart of the breathing phase detection method according to the embodiments of the present invention;
[0024] Figure 5 It is the fourth sub - flowchart of the breathing phase detection method according to the embodiments of the present invention;
[0025] Figure 6 It is the first application scenario of the breathing phase detection method according to the embodiments of the present invention;
[0026] Figure 7 It is the second application scenario of the breathing phase detection method according to the embodiments of the present invention;
[0027] Figure 8 It is a schematic diagram of the breathing phase detection device according to the embodiments of the present invention;
[0028] Figure 9 It is a schematic block diagram of a computer device provided by the embodiments of the present invention. Detailed implementation manners
[0029] In order to make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners.
[0030] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts belong to the scope of protection of the present invention.
[0031] In the description of the present invention, it should be understood that the orientation or positional relationships indicated by the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "resin", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc. are the orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.
[0032] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality of" means two or more unless otherwise specifically defined.
[0033] In the present invention, unless otherwise clearly defined and limited, the terms "mounted", "connected", "coupled", "fixed", etc. shall be construed broadly. For example, it may be a connection, a detachable connection, or an integral body; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two elements or the interaction relationship between two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0034] In the present invention, unless otherwise clearly defined and limited, the first feature being "on" or "under" the second feature may include the direct contact between the first and second features, or may include the situation where the first and second features are not in direct contact but in contact through other features therebetween. Moreover, the first feature being "above", "over" and "on top of" the second feature includes that the first feature is directly above and obliquely above the second feature, or merely means that the horizontal height of the first feature is higher than that of the second feature. The first feature being "under", "beneath" and "underneath" the second feature includes that the first feature is directly below and obliquely below the second feature, or merely means that the horizontal height of the first feature is lower than that of the second feature.
[0035] In the description of this specification, the description with reference to terms such as "an embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms should not be understood as necessarily referring to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0036] Please refer to Figure 1 , Figure 1 which is a flowchart of the breathing phase detection method according to the embodiment of the present invention. The embodiment of the present invention provides a breathing phase detection method, including S100 - S300:
[0037] S100. Obtain the spatial coordinate information of the first marker and construct a reference plane.
[0038] In some embodiments, the step S100 includes defining a reference plane, which can be defined by the following formula:
[0039] ax + by + d = z;
[0040] where a, b, and d are the plane parameters of the reference plane, obtained by using the least squares method with the spatial coordinate information of the first marker. Specifically, a is the slope of the reference plane in the x direction, b is the slope of the reference plane in the y direction, and d is the constant term. Preferably, the number of the first markers is 4.
[0041] Further, the step S100 further includes establishing an error function to define the prediction error for the spatial coordinate information (x i , y i , z i ) of each first marker. The error function can be established by the following formula:
[0042] e i = z i - (ax i + by i + d);
[0043] where i = 1, 2, 3, 4, representing the spatial coordinate information of the i-th first marker.
[0044] Further, the step S100 further includes constructing a least squares objective function to minimize the sum of the squares of the total errors. The least squares objective function can be constructed by the following formula:
[0045]
[0046] Further, the step S100 further includes taking partial derivatives to obtain the normal equations. Taking partial derivatives of a, b, and d respectively and setting the derivatives to zero, the following three equations are obtained:
[0047]
[0048] Further, the step S100 further includes arranging them into matrix form. Arranging the system of equations into matrix multiplication form, the following matrix is obtained:
[0049]
[0050] where represents the coefficient matrix A, represents the constant vector b.
[0051] Further, the step S100 further includes solving by matrix inversion. Solving the equation with the inverse matrix of the coefficient matrix A can be performed by the following formula:
[0052]
[0053] Finally, a, b, and d are solved to obtain a definite reference plane.
[0054] As Figure 6 shown, Figure 6 This is the first application scenario of the breathing phase detection method according to the embodiment of the present invention. In some embodiments, the first marker 10 is pasted on the surface of the CT scanning bed 40, so that the reference plane is the definition of the surface of the CT scanning bed 40. It should be noted that the number of the first markers 10 should be greater than 3. In this embodiment, the number of the first markers 10 is selected to be 4, but in other embodiments, it can also be 5 or 6 or other numbers. It should be noted that the first marker 10 is a reflective marker. This method uses the optical tracking camera 30 to collect the position of each first marker 10 in the coordinate system of the optical tracking camera 30 to obtain the spatial coordinate information of the first marker 10.
[0055] S200. Obtain the spatial coordinate information of the second marker, and calculate the real-time distance of the second marker relative to the reference plane.
[0056] As Figure 7 shown, Figure 7 This is the second application scenario of the breathing phase detection method according to the embodiment of the present invention. In some embodiments, the second marker 20 is pasted on the surface of the patient's skin. Thus, the change in the spatial coordinate information of the second marker 20 can represent the change in the breathing phase of the patient. For example, the change in the spatial coordinate information of the second marker 20 may represent that the patient is in the inhalation state or the exhalation state. It should be noted that the number of the second markers 20 should be between 3 and 10, and there is no rigid connection structure between the second markers 20, so that multiple second markers 20 can accurately reflect the breathing phase of the patient. It should be noted that the second marker 20 is a reflective marker. This method uses the optical tracking camera 30 to collect the spatial coordinate information of each second marker 20. And since the patient lies on the surface of the CT scanning bed 40, and this method defines a reference plane for the surface of the CT scanning bed 40, the real-time distance of the second marker 20 relative to the reference plane, that is, the CT scanning bed 40, can be calculated. Through the multi-point collaborative monitoring scheme, this method can obtain the complete three-dimensional deformation information of the chest cavity. The spatial distribution design of multiple second markers 20 enables the system to capture complex non-uniform deformations, which can not only reflect the surface movement but also indirectly reflect the internal tissue displacement.
[0057] As Figure 2 shown, Figure 2 This is the first sub-flowchart of the breathing phase detection method according to the embodiment of the present invention. The step S200 includes S210 - S220:
[0058] S210. Obtain the relative position information between the second markers and construct a reference distance matrix.
[0059] In this embodiment, the reflective points of the second markers are captured by an optical tracking camera to obtain their spatial coordinate information. At this stage, interfering reflective points within the shooting area of the optical tracking camera can be removed through manual control, or the reflective points representing the second markers can be manually input or determined to determine the spatial coordinate information of the second markers. Then, based on the spatial coordinate information of the second markers, the relative distances between them are calculated to construct a reference distance matrix. The reference distance matrix describes the relative distance relationship between the second markers and is the benchmark for subsequent point cloud data matching. Through the reference distance matrix, the system can quickly screen out the correct reflective points and exclude interfering reflective points during the real-time tracking stage.
[0060] S220. Obtain point cloud data and use the reference distance matrix to match a point set representing the second markers in the point cloud data.
[0061] In this embodiment, the optical tracking camera is used to obtain point cloud data in real time, and a point set representing the spatial coordinate information of the second markers is matched using the reference distance matrix. This stage is the real-time tracking stage for identifying the second markers. Among them, the optical tracking camera captures all the reflective points within the shooting area in real time to generate point cloud data. The point cloud data contains the spatial coordinate information of all the reflective points, which may include the reflective points of the second markers and interfering reflective points. Using the reference distance matrix, a point set of the reflective points that truly represent the second markers can be matched from the point cloud data.
[0062] It should be noted that in this embodiment, the spatial position information of the second markers is obtained through an optical tracking camera. The second markers are reflective markers. When the lens of the optical tracking camera obtains the spatial position information of the second markers, it will collect the reflected light signals in the target area using the lens and then convert them into electrical signals for processing and analysis. However, in actual applications, there may be interfering reflective points in the shooting area of the optical tracking camera, such as the reflection of the patient's clothing, the reflection of surgical instruments, or other reflective objects in the environment. Therefore, the number of reflective points obtained by the optical tracking camera may exceed the set number of the second markers, resulting in the optical tracking camera capturing extra reflective points. The extra reflective points may be misidentified as the second markers, leading to inaccurate spatial positioning results. Therefore, through the reference distance matrix and point cloud data matching technology, the present application can accurately screen out the correct reflective points corresponding to the second markers, exclude interfering reflective points, and the screened correct reflective points can provide accurate spatial coordinate information to ensure the positioning accuracy of the patient's breathing phase.
[0063] As Figure 3 shown, Figure 3This is the second sub - flowchart of the breathing phase detection method according to the embodiments of the present invention. The step S220 includes S221 - S223:
[0064] S221. Generate all point sets that match the number of the second markers based on the point cloud data, and construct the corresponding current distance matrix according to the relative positions of the points in each point set.
[0065] In this embodiment, the optical tracking camera captures all the reflective points in the shooting area in real time to generate point cloud data. The point cloud data contains the spatial coordinate information of all the reflective points, which may include the reflective points of the second markers and interfering reflective points. This application generates all possible point sets based on the point cloud data. Each point set contains the same number of reflective points as the second markers. These point sets are potential candidate point sets and may contain correct reflective points and interfering reflective points. For each candidate point set, calculate its current distance matrix, which describes the relative distance relationship between the reflective points in the point set. The calculation method of the current distance matrix is the same as that of the reference distance matrix.
[0066] S222. Calculate the difference value between the current distance matrix and the reference distance matrix, and filter out the point sets with the difference value less than the first threshold.
[0067] In this embodiment, compare the current distance matrix of each candidate point set with the reference distance matrix, calculate the difference value, and filter out the candidate point sets with the difference value less than the preset threshold.
[0068] S223. Select the point set with the smallest difference value between the current distance matrix and the reference distance matrix as the point set representing the second marker.
[0069] In this embodiment, select the point set with the smallest difference value as the final matching result, and use the selected point set as the correct reflective points representing the spatial coordinate information of the second marker. These reflective points will be used for subsequent breathing phase detection.
[0070] As Figure 4 shown, Figure 4 This is the third sub - flowchart of the breathing phase detection method according to the embodiments of the present invention. The step S200 includes S230 - S235:
[0071] S230. Define the set of the second markers according to the following formula:
[0072] M = {P 1 , P 2 , …, P n}, P i ∈ R 3 , n > 3;
[0073] where n represents the number of the second markers, and R 3Represents a set of three-dimensional real vectors. It can be understood that the set M of the second markers contains n markers, and each second marker P i is a point in three-dimensional space, and its coordinates are represented as (x i , y i , z i ).
[0074] S231. Construct the reference distance matrix of the second markers according to the following formula:
[0075] D ref (i, j) = ||P i - P j || 2 , i, j ∈ {1, 2, …, n}, i < j.
[0076] Among them, the reference distance matrix D ref (i, j) is a symmetric matrix, which describes the relative distance relationship between the second markers. Each element of the matrix represents the Euclidean distance between two second markers. This matrix is used as the benchmark for subsequent point cloud data matching to screen out the correct reflective points.
[0077] S232. Construct the point cloud data according to the following formula:
[0078] C = {C 1 , C 2 ,..., C}, C i ∈R 3 , m ≥ n;
[0079] Among them, m represents the number of second marker recognition information. It can be understood that the point cloud data C contains m reflective points, and each reflective point C i is a point in three-dimensional space. These reflective points may include the reflective points of the second markers and interfering reflective points (such as the reflection of the patient's clothing or surgical instruments).
[0080] S233. Generate a point set that matches the number of the second markers according to the following formula:
[0081]
[0082] Among them, S represents the point set selected from the point cloud data, and |S| represents the number of points in S. It can be understood that all possible point sets S are generated from the point cloud data C, and each point set contains n reflective points. These point sets are potential candidate point sets and may contain correct reflective points and interfering reflective points.
[0083] S234. Screen out the point sets with a difference value less than the first threshold according to the following formula:
[0084]
[0085] Among them, D k (i, j) represents the current distance matrix, and ε represents a preset first threshold. It can be understood that for each candidate point set S, its current distance matrix D k (i, j) is calculated, and compared with the reference distance matrix D ref (i, j) to calculate the difference value, and the point sets with the difference value less than the first threshold ε are filtered out. These point sets may be correct reflective points. Optionally, the first threshold can be set to 5% - 10% of the maximum distance in the reference distance matrix. For example, assuming the maximum distance in the reference distance matrix is 100 mm, the initial threshold can be set to 5 - 10 mm. During the running of the method, if it is found that the distribution of the difference values is relatively concentrated, the first threshold can be appropriately reduced; if it is found that the distribution of the difference values is relatively dispersed, the first threshold can be appropriately increased.
[0086] S235. Select the point set with the smallest difference value between the current distance matrix and the reference distance matrix according to the following formula:
[0087]
[0088] It can be understood that the point set S with the smallest difference value is selected from the filtered point sets best , as the correct reflective point representing the spatial coordinate information of the second marker, and this point set will be used for subsequent respiratory phase detection.
[0089] It should be explained that a point set meeting the requirements cannot be obtained in every frame of image data of the optical tracking camera. If a point set meeting the requirements cannot be obtained in the current frame of image data, this frame is regarded as an invalid frame, and the point cloud data of the next frame of image data is continuously used to obtain a point set meeting the requirements.
[0090] It can be understood that the respiratory phase detection method of the present application realizes the accurate identification of non-rigidly connected markers, breaks through the limitations of traditional rigid tools. Due to the adoption of the relative distance matching algorithm, the second marker can deform freely with the chest cavity, more accurately reflecting the actual respiratory movement. And through the multi-point collaborative monitoring scheme, the complete three-dimensional deformation information of the chest cavity is obtained. The spatial distribution of multiple second markers can capture complex non-uniform deformations, not only reflecting the surface movement but also indirectly reflecting the internal tissue displacement. The respiratory phase detection method of the present application establishes an objective respiratory phase evaluation standard based on distance changes. By calculating the distance changes of the second marker to the reference plane in real time, subjective experience is transformed into quantifiable indicators, making the respiratory phase judgment more accurate and reliable.
[0091] After determining the spatial coordinate information of the second marker, it is necessary to calculate the real-time distance of the second marker relative to the reference plane. In some embodiments, the real-time distance of each second marker relative to the reference plane is calculated according to the following formula:
[0092]
[0093] wherein, the spatial coordinate information of the second marker is expressed as (x i , y i , z i ), and ax + by + z + d = 0 is the equation of the reference plane.
[0094] S300. Record the reference distance of the second marker relative to the reference plane at a preset moment.
[0095] In some embodiments, the preset moment is selected as the scanning moment of the CT scanner because at this time, the breathing phase of the patient is consistent with the CT image, which can be used as a reference for subsequent operation steps. For example, in a lung puncture operation, real-time monitoring of the patient's breathing phase is an important step. The puncture operation is based on a CT image of the patient's one-time computed tomography (CT). The CT image is static, while the patient's breathing is dynamic. In this embodiment, by recording the reference distance of the second marker relative to the reference plane at the scanning moment of the CT scanner, a reference benchmark can be provided for the subsequent puncture operation.
[0096] S400. Compare and analyze the real-time distance with the reference distance, and output an indication signal indicating the gap between the current breathing phase and the breathing phase at the preset moment according to the comparison and analysis result.
[0097] As Figure 5 shown, Figure 5 is the fourth sub-flowchart of the breathing phase detection method according to the embodiment of the present invention, and the step S400 includes S410 - S440:
[0098] S410. Calculate the distance difference between the real-time distance and the reference distance of each second marker relative to the reference plane according to the following formula:
[0099]
[0100] wherein, Δd i represents the distance difference between the real-time distance of the i-th second marker relative to the reference plane at the current moment and the reference state, represents the real-time distance of the i-th second marker relative to the reference plane at the current moment, represents the reference distance of the i-th second marker relative to the reference plane; n represents the number of second markers.
[0101] S420. Evaluate the respiratory phase according to the following formula:
[0102]
[0103] where Q represents a preset second threshold. Optionally, in a lung puncture operation, the second threshold Q can be selected as 20 mm. This second threshold is set based on clinical experience and can effectively identify respiratory phases that are not suitable for puncture. In this embodiment, when the displacement deviation of more than half of the second markers relative to the reference distance exceeds the second threshold Q, the output result is "warning"; otherwise, the output result is "normal".
[0104] S430. When the evaluation output result of the respiratory phase is "warning", output a first indication signal indicating that the current respiratory phase does not meet the operation requirements.
[0105] In some embodiments, the first indication signal can be a red indicator light or other prompt signals, used to indicate to the operator that the respiratory phase of the patient at the current moment has a large gap from the respiratory phase at the CT scan moment, and the puncture operation cannot be performed. The operator can adjust the surgical plan according to this signal, such as waiting for the patient's breathing to stabilize or performing a CT scan again. It should be noted that the first indication signal can be a visual signal (such as a red / green indicator light), an auditory signal (such as a buzzer), or a tactile signal (such as vibration feedback).
[0106] S440. When the evaluation output result of the respiratory phase is "normal", output a second indication signal indicating that the current respiratory phase meets the operation requirements.
[0107] In some embodiments, the first indication signal can be a green indicator light or other prompt signals, used to indicate to the operator that the respiratory phase of the patient at the current moment has a small gap from the respiratory phase at the CT scan moment, and the puncture operation can be performed. The operator can continue the surgical operation according to this signal to ensure that the surgical instrument can accurately reach the target position. It should be noted that the second indication signal can be a visual signal (such as a red / green indicator light), an auditory signal (such as a buzzer), or a tactile signal (such as vibration feedback).
[0108] As Figure 8 shown, an embodiment of the present invention also provides a respiratory phase detection device 500, including a calibration module 501, a tracking module 502, a recording module 503, and an analysis module 504.
[0109] The calibration module 501 is used to obtain the spatial coordinate information of the first marker and construct a reference plane;
[0110] The tracking module 502 is used to obtain the spatial coordinate information of the second marker and calculate the real-time distance of the second marker relative to the reference plane;
[0111] A recording module 503, configured to record a reference distance of the second marker relative to the reference plane at a preset moment;
[0112] An analysis module 504, configured to compare and analyze the real-time distance with the reference distance, and output an indication signal indicating a gap between the current breathing phase and the breathing phase at the preset moment according to the result of the comparison and analysis.
[0113] It should be noted that those skilled in the art can clearly understand that the specific implementation processes of the above device and each unit can refer to the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity of description, they will not be elaborated herein.
[0114] The above breathing phase detection device can be implemented in the form of a computer program, and the computer program can run on a computer device as shown in Figure 9 shown.
[0115] Referring to Figure 9 , the computer device 600 includes a processor 602, a memory, and a network interface 605 connected through a system bus 601. Among them, the memory may include a non-volatile storage medium 603 and an internal memory 604.
[0116] The non-volatile storage medium 603 can store an operating system 6031 and a computer program 6032. The computer program 6032 includes program instructions. When the program instructions are executed, the processor 602 can be enabled to execute a breathing phase detection method: obtaining spatial coordinate information of a first marker and constructing a reference plane; obtaining spatial coordinate information of a second marker and calculating a real-time distance of the second marker relative to the reference plane; recording a reference distance of the second marker relative to the reference plane at a preset moment; comparing and analyzing the real-time distance with the reference distance, and outputting an indication signal indicating a gap between the current breathing phase and the breathing phase at the preset moment according to the result of the comparison and analysis.
[0117] The processor 602 is configured to provide computing and control capabilities to support the operation of the entire computer device 600.
[0118] The internal memory 604 provides an environment for the operation of the computer program 6032 in the non-volatile storage medium 603. When the computer program 6032 is executed by the processor 602, the processor 602 can be enabled to execute a breathing phase detection method.
[0119] The network interface 605 is configured to communicate with other devices through a network. Those skilled in the art can understand that Figure 9The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device 600 to which the solution of this application is applied. Specifically, the computer device 600 may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0120] Among them, the processor 602 is used to run the computer program 6032 stored in the memory to implement the following steps S100 to S400:
[0121] S100, obtain the spatial coordinate information of the first marker and construct a reference plane;
[0122] S200, obtain the spatial coordinate information of the second marker and calculate the real-time distance of the second marker relative to the reference plane;
[0123] S300, record the reference distance of the second marker relative to the reference plane at a preset moment;
[0124] S400, compare and analyze the real-time distance with the reference distance, and output an indication signal indicating the gap between the current breathing phase and the breathing phase at the preset moment according to the comparison and analysis result.
[0125] It should be understood that in the embodiment of this application, the processor 602 may be a central processing unit (CPU), and this processor 602 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or this processor may also be any conventional processor, etc.
[0126] Those of ordinary skill in the art can understand that all or part of the processes of the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. This computer program includes program instructions, and the computer program can be stored in a storage medium, and this storage medium is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0127] Therefore, the present invention also provides a storage medium. The storage medium can be a computer-readable storage medium. The storage medium stores a computer program, where the computer program includes program instructions, and when the program instructions are executed by a processor, the above-mentioned respiratory phase detection method can be implemented. The storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the above-mentioned method can be implemented. The program instructions include the following steps:
[0128] S100. Obtain the spatial coordinate information of the first marker and construct a reference plane;
[0129] S200. Obtain the spatial coordinate information of the second marker and calculate the real-time distance of the second marker relative to the reference plane;
[0130] S300. Record the reference distance of the second marker relative to the reference plane at a preset moment;
[0131] S400. Compare and analyze the real-time distance with the reference distance, and output an indication signal indicating the gap between the current respiratory phase and the respiratory phase at the preset moment according to the comparison and analysis result.
[0132] The storage medium can be a variety of computer-readable storage media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disc, etc., which can store program codes.
[0133] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0134] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of each unit is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0135] The steps in the method of the embodiments of the present invention can be adjusted, combined, and deleted according to actual needs. The units in the device of the embodiments of the present invention can be combined, divided, and deleted according to actual needs. In addition, in each embodiment of the present invention, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0136] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present invention.
[0137] The above only further illustrates the technical content of the present invention with embodiments to make it easier for readers to understand, but it does not mean that the implementation manners of the present invention are limited to this. Any technical extension or re-creation made according to the present invention is protected by the present invention. The protection scope of the present invention is subject to the claims.
Claims
1. A breathing phase detection method, characterized in that: include: Acquire spatial coordinate information of the first marker and construct a reference plane; Acquiring spatial coordinate information of a second marker, and calculating a real-time distance of the second marker relative to the reference plane; Recording a reference distance of the second marker relative to the reference plane at a preset time; The real-time distance is compared and analyzed with the reference distance, and an indication signal indicating the difference between the current respiratory phase and the respiratory phase at a preset time is output according to the comparison and analysis result.
2. A respiratory phase detection method according to claim 1, characterized in that: The obtaining of the spatial coordinate information of the second marker includes: Obtaining relative position information between second markers and constructing a reference distance matrix; Point cloud data is acquired, and a point set representing the second marker is matched in the point cloud data using the reference distance matrix.
3. A respiratory phase detection method according to claim 2, characterized in that: The step of acquiring point cloud data for identifying a second marker and matching a point set representing the second marker in the point cloud data using the reference distance matrix comprises: Generate all point sets matching the number of the second markers based on the point cloud data, and construct a corresponding current distance matrix according to the relative positions of the points in each point set; Calculating the difference between the current distance matrix and the reference distance matrix, and selecting a point set whose difference is less than a first threshold; A point set with the smallest difference between the current distance matrix and the reference distance matrix is selected as the point set representing the second marker.
4. A respiratory phase detection method according to claim 1, characterized in that: The obtaining of the spatial coordinate information of the second marker includes: The set of the second markers is defined as follows: M={P1,P2,…,P n },P i ∈R 3 ,n>3; Where n represents the number of the second marker, R 3 represents the set of three-dimensional real vectors; The reference distance matrix of the second marker is constructed according to the following formula: D ref (i,j)=||P i -P j ||2,i,j∈{1,2,…,n},i<j; Construct point cloud data according to the following formula: C={C1,C2,...,C},C i ∈R 3 ,m≥n; Wherein, m represents the number of second marker identification information; A point set matching the second marker quantity is generated according to the following formula: Where S represents the point set selected from the point cloud data, and |S| represents the number of points in S; According to the following formula, the point set with difference value less than the first threshold is selected: Among them, D k (i, j) represents the current distance matrix, ε represents the preset first threshold; Select the point set with the smallest difference between the current distance matrix and the reference distance matrix according to the following formula:
5. A respiratory phase detection method according to claim 1, characterized in that: The step of acquiring the spatial coordinate information of the first marker and constructing a reference plane includes: Define the reference plane as follows: ax+by+d=z; Among them, a, b, and d are plane parameters of the reference plane, which are obtained by using the least squares method using the spatial coordinate information of the first marker.
6. A respiratory phase detection method according to claim 5, characterized in that: The calculating the real-time distance of the second marker relative to the reference plane comprises: The real-time distance of each second marker relative to the reference plane is calculated according to the following formula: Wherein, the spatial coordinate information of the second marker is expressed as (x i ,y i ,z i ).
7. A respiratory phase detection method according to claim 6, characterized in that: The comparing and analyzing the real-time distance with the reference distance, and outputting an indication signal indicating the difference between the current respiratory phase and the respiratory phase at a preset time according to the comparison and analysis result, comprises: The distance difference between the real-time distance of each second marker relative to the reference plane and the reference distance is calculated according to the following formula: Where, Δd i represents the distance difference between the real-time distance of the i-th second marker relative to the reference plane at the current moment and the distance of the reference state, represents the real-time distance of the i-th second marker relative to the reference plane at the current moment, represents the reference distance of the i-th second marker relative to the reference plane; n represents the number of second markers; The respiratory phase is assessed as follows: Wherein, Q represents a preset second threshold; When the evaluation output result of the respiratory phase is warning, outputting a first indication signal indicating that the current respiratory phase does not meet the operation requirements; When the evaluation output result of the respiratory phase is normal, a second indication signal indicating that the current respiratory phase meets the operation requirement is output.
8. A breathing phase detection device, characterized in that: include: A calibration module, used to obtain the spatial coordinate information of the first marker and construct a reference plane; A tracking module, used to obtain the spatial coordinate information of the second marker and calculate the real-time distance of the second marker relative to the reference plane; A recording module, used for recording a reference distance of the second marker relative to the reference plane at a preset time; The analysis module is used to compare and analyze the real-time distance with the reference distance, and output an indication signal indicating the difference between the current respiratory phase and the respiratory phase at a preset time according to the comparison and analysis result.
9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the respiratory phase detection method according to any one of claims 1 to 7 when executing the computer program.
10. A storage medium, characterized in that: The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the respiratory phase detection method according to any one of claims 1 to 7 can be implemented.