Medical instrument visual tracking method and device based on Kalman filtering
Through the combination of Kalman filter algorithm and deep learning model, precise tracking of surgical instruments and automatic control of laparoscopy in laparoscopic surgery are achieved, solving the problems of difficulty and low efficiency of surgical operation in the existing technology, and improving the continuity of surgery. sex and safety.
Patent Information
- Application Number
- CN202410845007.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-08-30
AI Technical Summary
Existing mirror-arm robots increase the burden on doctors during laparoscopic surgery, disrupt the continuity of surgery, and reduce surgical efficiency.
A medical device visual tracking method based on Kalman filter is used to obtain laparoscopic video stream data, use a deep learning model to identify the position of the surgical instrument head, and combine the Kalman filter algorithm and IOU matching algorithm to calculate the target position at the end of the robot arm in real time pose to realize automatic tracking of laparoscopy.
It significantly reduces the doctor's extra attention and operating burden on the control device, ensures the continuity and efficiency of the surgical process, and improves the safety and effectiveness of the surgery.
Smart Images

Figure CN118570262A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a medical device visual tracking method, device, computer equipment and storage medium based on Kalman filtering. Background Art
[0002] With the rapid development of medical technology and artificial intelligence technology, intelligent laparoscopic surgery has gradually entered people's field of vision and become one of the development directions of surgical operations. Laparoscopic surgery refers to the doctor inserting a laparoscope into the patient's body, capturing the video stream through the laparoscope and projecting it onto the monitor, so as to observe the lesion area for surgical operations. However, traditional laparoscopic surgery has many problems, which seriously affect the effect and safety of the operation.
[0003] First, doctors often face the problem of eye-hand coordination when performing laparoscopic surgery. Since doctors need to operate through a monitor, the difference between the image on the monitor and the actual operation increases the difficulty of the operation. Secondly, the traditional way of holding the laparoscope limits the flexibility and freedom of the doctor's surgical operation, making the surgical operation restricted. Furthermore, long-term surgical operations will cause doctor fatigue and hand tremors, further increasing the risk and difficulty of the operation.
[0004] In order to solve these problems, the scope-holding arm robot came into being. The scope-holding arm robot has the characteristics of high precision, fast response and good stability. It can effectively replace the operation of handheld laparoscopes, allowing the surgeon to adjust the surgical field of view more flexibly according to the needs of the operation. However, the current scope-holding arm robots mostly use foot pedals and voice control. During the operation, the surgeon needs to issue corresponding operation instructions according to these control methods to drive the scope-holding arm robot to move and adjust the position of the laparoscope.
[0005] This control method brings new problems. First, doctors need to pay extra attention and operate the control device during the operation, which increases the burden on doctors. Second, frequent control operations can easily lead to interruptions in the operation, destroying the continuity of the operation. Finally, such frequent adjustments and control operations also reduce the overall efficiency of the operation. Therefore, the existing mirror-holding arm robot still has many shortcomings in practical applications and urgently needs further improvement and optimization. Summary of the invention
[0006] The main purpose of the present invention is to provide a medical device visual tracking method, device, computer equipment and storage medium based on Kalman filtering to solve the problem that the existing mirror-holding arm robot increases the burden on doctors, destroys the continuity of surgery and reduces the overall efficiency of surgery in practical applications.
[0007] To achieve the above-mentioned purpose, the present invention provides a medical instrument visual tracking method based on Kalman filtering, comprising the following steps: acquiring video stream data captured by a laparoscope; using a preset surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the current image frame in the video stream data, and obtain border image data of multiple instrument heads; in response to a user's selection instruction, determining initial border image data for tracking the target instrument head from the border image data of the multiple instrument heads; using the initial border image data as a state prediction input of a preset Kalman filtering algorithm, performing state estimation analysis, and determining estimated border image data of the initial border image data in the next image frame; using the surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream, and obtain border image data of multiple instrument heads; using a preset surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream, and obtain border image data of multiple instrument heads; The instrument tracking IOU matching algorithm calculates the ratio values between the intersection area and the union area of the estimated border image data and the multiple border image data obtained by the next image frame recognition and segmentation processing; the border image data obtained by the next image frame recognition and segmentation processing with the largest ratio value is used as the target border image data tracked by the head of the target instrument in the next image frame; the target border image data is used as the initial border image data, and the step of "using the initial border image data as the state prediction input of the preset Kalman filter algorithm, performing state prediction analysis, and determining the estimated border image data of the initial border image data in the next image frame" is continued; based on the target border image data determined in sequence, the target posture that the end of the laparoscope's robotic arm needs to reach is calculated in real time, and a drive instruction is sent to the laparoscope's robotic arm in real time according to the target posture, so that the laparoscope tracks the head position of the target instrument in real time.
[0008] Furthermore, a preset surgical instrument tracking deep learning model is used to identify and segment the head position of each surgical instrument in the current image frame in the video stream data to obtain border image data of multiple instrument heads, including: performing Gaussian noise reduction on the current image frame in the video stream data to obtain the current image frame; using the surgical instrument tracking deep learning model to identify and segment the head position of each surgical instrument in the current image frame to obtain initial border data of multiple instrument heads; using a minimum circumscribed rectangle image algorithm to calculate and process the initial border data of each instrument head to obtain border image data of each instrument head.
[0009] Furthermore, in response to a user's selection instruction, initial border image data for tracking a target instrument head is determined from the border image data of the multiple instrument heads, including: numbering and displaying the border image data of the multiple instrument heads; in response to a user's key operation, determining a target code indicated by the key operation, and determining the border image data corresponding to the target code as initial border image data; in response to a user's language instruction, determining the target code indicated by the language instruction, and determining the border image data corresponding to the target code as initial border image data; in response to a user's touch operation, determining the border image data indicated by the touch operation, and determining the indicated border image data as initial border image data.
[0010] Furthermore, the surgical instrument tracking deep learning model is used to identify and segment the head position of each surgical instrument in the next image frame in the surgical video data stream to obtain border image data of multiple instrument heads, including: performing Gaussian noise reduction on the next image frame in the video stream data to obtain the next image frame; using the surgical instrument tracking deep learning model to identify and segment the head position of each surgical instrument in the next image frame of the surgery to obtain initial border data of multiple instrument heads; using the minimum circumscribed rectangle image algorithm to calculate and process the initial border data of each instrument head to obtain border image data of each instrument head.
[0011] Furthermore, the border image data obtained by the recognition and segmentation processing of the next image frame with the largest ratio value is used as the target border image data tracked by the head of the target device in the next image frame, including: sorting the border image data obtained by the recognition and segmentation processing of the next image frame from large to small according to the ratio value; determining the maximum ratio value based on the sorting result, and judging whether the maximum ratio value is greater than or equal to a preset matching threshold; if it is greater than or equal to the preset matching threshold, determining the border image data corresponding to the maximum ratio value as the target border image data; if it is not greater than or equal to the preset matching threshold, adding a unit value to the number of lost target frames and determine whether the number of lost target frames after adding a unit value is less than or equal to a preset lost target frame threshold; if it is less than or equal to the preset lost target frame threshold, execute the step of "using the surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream to obtain border image data of multiple instrument heads"; if it is not less than or equal to the preset lost target frame threshold, execute the step of "responding to the user's selection instruction, determining the initial border image data for tracking the target instrument head from the border image data of the multiple instrument heads" and clear the lost target frame.
[0012] Furthermore, based on the target border image data determined in sequence, the target posture that the end of the laparoscope's robotic arm needs to reach is calculated in real time, including: calculating the pixel coordinates of the four vertices of the border of the target border image data; combining the 3D reference point matrix corresponding to the target instrument head, the laparoscope's camera internal parameter coefficient matrix and the distortion coefficient matrix, and using the visual PNP algorithm to calculate the three-dimensional coordinate transformation matrix of the center point of the target instrument head tracked under the laparoscope field of view based on the laparoscope camera light spot; obtaining a preset transformation relationship matrix from the end of the robotic arm to the laparoscope camera light spot; and according to the transformation relationship matrix from the end of the robotic arm to the laparoscope camera light spot and the three-dimensional coordinate transformation matrix of the center point of the target instrument head based on the camera light spot, inversely solving the target posture that the end of the robotic arm needs to reach.
[0013] Furthermore, before using the visual PNP algorithm to calculate the three-dimensional coordinate transformation matrix of the center point of the target instrument head tracked under the laparoscope field of view based on the camera light point in combination with the 3D reference point matrix corresponding to the target instrument head, the camera intrinsic parameter coefficient matrix and the distortion coefficient matrix of the laparoscope, the medical instrument visual tracking method also includes: using a monocular camera calibration method to obtain the camera intrinsic parameter coefficient matrix and the distortion coefficient matrix of the laparoscope, wherein the camera intrinsic parameter coefficient matrix and the distortion coefficient matrix are constant matrices; determining the actual width and length of the multiple instrument heads, and constructing the 3D reference point matrix of each instrument head according to the actual width and length of each instrument head.
[0014] The present invention also provides a PLC firmware upgrade device, comprising: an acquisition unit, used to acquire video stream data captured by a laparoscope; a tracking unit, used to use a preset surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the current image frame in the video stream data, and obtain border image data of multiple instrument heads; a determination unit, used to determine, in response to a user's selection instruction, initial border image data for tracking the target instrument head from the border image data of the multiple instrument heads; an estimation unit, used to use the initial border image data as a state prediction input of a preset Kalman filtering algorithm, perform state estimation analysis, and determine estimated border image data of the initial border image data in the next image frame; a segmentation unit, used to use the surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream, and obtain border image data of multiple instrument heads; a calculation unit, used to use a preset surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream, and obtain border image data of multiple instrument heads; The invention relates to an IOU matching algorithm for tracking surgical instruments, which calculates the ratio values between the intersection area and the union area of the estimated border image data and the multiple border image data obtained by the recognition and segmentation processing of the next image frame; a segmentation unit, which is used to adopt the border image data obtained by the recognition and segmentation processing of the next image frame with the largest ratio value as the target border image data tracked by the head of the target instrument in the next image frame; an execution unit, which is used to use the target border image data as the initial border image data, and continue to execute the step of "using the initial border image data as the state prediction input of the preset Kalman filter algorithm, performing state prediction analysis, and determining the estimated border image data of the initial border image data in the next image frame"; a driving unit, which is used to calculate in real time the target posture that the end of the laparoscope's robotic arm needs to reach based on the target border image data determined in sequence, and send a driving instruction to the laparoscope's robotic arm in real time according to the target posture, so that the laparoscope tracks the head position of the target instrument in real time.
[0015] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0016] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.
[0017] The medical instrument visual tracking method, device, computer equipment and storage medium based on Kalman filtering provided by the present invention are intended to solve the problems of operation difficulty and surgical efficiency in traditional laparoscopic surgery. The method comprises the following steps: first, obtaining the video stream data captured by the laparoscope. This step ensures that the system can capture the dynamic information of the surgical site in real time. Then, using a preset surgical instrument tracking deep learning model, the head position of each surgical instrument in the current image frame in the video stream data is identified and segmented to obtain the frame image data of multiple instrument heads. This step ensures the precise positioning of the surgical instrument head through the application of the deep learning model. After responding to the user's selection instruction, the initial frame image data for tracking the target instrument head is determined from the frame image data of the multiple instrument heads. Through user selection, the specific surgical instrument to be tracked can be flexibly determined. Then, the initial frame image data is used as the state prediction input of the preset Kalman filter algorithm, and the state estimation analysis is performed to determine the estimated frame image data of the initial frame image data in the next image frame. The introduction of the Kalman filter algorithm improves the accuracy of the prediction and the response speed of the system. Subsequently, the surgical instrument tracking deep learning model is used to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream to obtain the frame image data of multiple instrument heads. This step ensures that the system continues to track dynamic scenes. Next, the preset surgical instrument tracking IOU matching algorithm is used to calculate the ratio between the intersection area and the union area of the estimated frame image data and the multiple frame image data obtained by the next image frame recognition and segmentation processing. The accuracy of the frame matching is further improved by the IOU matching algorithm. The frame image data obtained by the next image frame recognition and segmentation processing with the largest ratio value is used as the target frame image data tracked by the target instrument head in the next image frame. This step ensures the continuity and accuracy of tracking. The target frame image data is used as the initial frame image data, and the step of "using the initial frame image data as the state prediction input of the preset Kalman filter algorithm, performing state estimation analysis, and determining the estimated frame image data of the initial frame image data in the next image frame" is continued. Through the iterative process, the continuity and stability of tracking are maintained. Based on the target frame image data determined in sequence, the target position that the end of the laparoscope's robotic arm needs to reach is calculated in real time, and a driving instruction is sent to the laparoscope's robotic arm in real time according to the target position, so that the laparoscope can track the head position of the target instrument in real time. This step realizes the automation and precise positioning of the laparoscope.
[0018] In general, the invention can enable the scope-holding arm robot to automatically adjust the surgical field of view according to the needs of the surgeon through visual tracking, thereby improving the continuity, stability and safety of the surgery, reducing the burden on the surgeon, and improving the clinical applicability of the scope-holding arm robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic diagram of the steps of a medical device visual tracking method based on Kalman filtering in one embodiment of the present invention; Figure 2 is a flow chart of a medical device visual tracking method in one embodiment of the present invention; Figure 3 It is a structural block diagram of a medical device visual tracking device based on Kalman filtering in one embodiment of the present invention; Figure 4 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.
[0020] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0022] Reference Figure 1 The embodiment of the present invention provides a medical device visual tracking method based on Kalman filtering, comprising the following steps: S1, obtaining video stream data captured by the laparoscope.
[0023] S2, using a preset surgical instrument tracking deep learning model to identify and segment the head position of each surgical instrument in the current image frame in the video stream data, to obtain border image data of multiple instrument heads.
[0024] S3, in response to a user's selection instruction, determining initial frame image data for tracking a target instrument head from the frame image data of the plurality of instrument heads.
[0025] S4, using the initial frame image data as a state prediction input of a preset Kalman filter algorithm, performing state estimation analysis, and determining estimated frame image data of the initial frame image data in the next image frame.
[0026] S5, using the surgical instrument tracking deep learning model to identify and segment the head position of each surgical instrument in the next image frame in the surgical video data stream to obtain frame image data of multiple instrument heads.
[0027] S6, using a preset surgical instrument tracking IOU matching algorithm, calculate the ratio values between the intersection area and the union area of the estimated border image data and the multiple border image data obtained by the next image frame recognition and segmentation processing.
[0028] S7, using the frame image data obtained by the recognition and segmentation processing of the next image frame with the largest ratio value as the target frame image data tracked by the head of the target device in the next image frame.
[0029] S8, using the target border image data as the initial border image data, and continuing to execute the step of "using the initial border image data as the state prediction input of the preset Kalman filter algorithm, performing state estimation analysis, and determining the estimated border image data of the initial border image data in the next image frame".
[0030] S9, based on the target frame image data determined in sequence, calculate in real time the target posture that the end of the laparoscope's robotic arm needs to reach, and send a drive instruction to the laparoscope's robotic arm in real time according to the target posture, so that the laparoscope tracks the head position of the target instrument in real time.
[0031] That is, the embodiment of the present invention provides a medical instrument visual tracking method based on Kalman filtering, which aims to solve the problems of operation difficulty and surgical efficiency in traditional laparoscopic surgery. The method includes the following steps: First, the video stream data captured by the laparoscope is obtained. This step ensures that the system can capture the dynamic information of the surgical site in real time. Then, the preset surgical instrument tracking deep learning model is used to identify and segment the head position of each surgical instrument in the current image frame in the video stream data to obtain the frame image data of multiple instrument heads. This step ensures the precise positioning of the surgical instrument head through the application of the deep learning model. After responding to the user's selection instruction, the initial frame image data for tracking the target instrument head is determined from the frame image data of the multiple instrument heads. Through user selection, the specific surgical instrument to be tracked can be flexibly determined. Then, the initial frame image data is used as the state prediction input of the preset Kalman filter algorithm, and the state estimation analysis is performed to determine the estimated frame image data of the initial frame image data in the next image frame. The introduction of the Kalman filter algorithm improves the accuracy of the prediction and the response speed of the system. Subsequently, the surgical instrument tracking deep learning model is used to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream to obtain the frame image data of multiple instrument heads. This step ensures that the system continues to track dynamic scenes. Next, the preset surgical instrument tracking IOU matching algorithm is used to calculate the ratio between the intersection area and the union area of the estimated frame image data and the multiple frame image data obtained by the next image frame recognition and segmentation processing. The accuracy of the frame matching is further improved by the IOU matching algorithm. The frame image data obtained by the next image frame recognition and segmentation processing with the largest ratio value is used as the target frame image data tracked by the target instrument head in the next image frame. This step ensures the continuity and accuracy of tracking. The target frame image data is used as the initial frame image data, and the step of "using the initial frame image data as the state prediction input of the preset Kalman filter algorithm, performing state estimation analysis, and determining the estimated frame image data of the initial frame image data in the next image frame" is continued. Through the iterative process, the continuity and stability of tracking are maintained. Based on the target frame image data determined in sequence, the target position that the end of the laparoscope's robotic arm needs to reach is calculated in real time, and a driving instruction is sent to the laparoscope's robotic arm in real time according to the target position, so that the laparoscope can track the head position of the target instrument in real time. This step realizes the automation and precise positioning of the laparoscope.
[0032] In general, the above method can significantly reduce the extra attention and operating burden of the doctor on the control device during the operation, ensure the continuity and efficiency of the operation, and improve the safety and effect of the operation. In summary, the medical device visual tracking method based on Kalman filtering of the present invention, by introducing deep learning models and Kalman filtering algorithms, realizes the precise tracking of surgical instruments and the automatic control of laparoscopes, greatly improving the operational flexibility, accuracy and safety of laparoscopic surgery.
[0033] In one example, a preset surgical instrument tracking deep learning model is used to identify and segment the head positions of each surgical instrument in the current image frame in the video stream data to obtain the border image data of multiple instrument heads, including: performing Gaussian noise reduction on the current image frame in the video stream data to obtain the current image frame; using the surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the current image frame to obtain the initial border data of multiple instrument heads; using the minimum circumscribed rectangle image algorithm to calculate and process the initial border data of each instrument head to obtain the border image data of each instrument head. It should be noted that the surgical instrument tracking deep learning model can be a deep learning model such as YOLOV5-Segment, MASKRCNN, etc.
[0034] In this example, the aim is to improve the operational accuracy and efficiency of laparoscopic surgery. The core of this method is to achieve accurate positioning and tracking of surgical instruments through a series of image processing and deep learning technologies. First, by obtaining the video stream data captured by the laparoscope, ensure that the system can capture the dynamic information of the surgical site in real time. The technical effect of this step is to ensure the real-time and integrity of the image data during the operation. Next, the current image frame in the video stream data is subjected to Gaussian noise reduction processing to obtain the processed current image frame. The technical effect of Gaussian noise reduction is to remove noise in the image, improve image quality, and provide a clearer basic image for subsequent image processing and recognition. Subsequently, the preset surgical instrument tracking deep learning model is used to identify and segment the head positions of each surgical instrument in the current image frame of the operation to obtain the initial border data of multiple instrument heads. This step ensures efficient and accurate recognition of the position of the surgical instrument head by applying advanced deep learning models such as YOLOV5-Segment or MASKRCNN, and provides accurate initial border data. Next, the minimum bounding rectangle image algorithm is used to calculate and process the initial border data of each instrument head to obtain the border image data of each instrument head. The technical effect of the minimum circumscribed rectangle algorithm is to further optimize the border data, convert the curved border of the instrument head into a rectangular border, so as to facilitate the calculation of the subsequent center point coordinates and IOU matching, and improve the accuracy of subsequent processing. The border image data obtained above is used as the state prediction input of the Kalman filter algorithm, and the state estimation analysis is performed to determine the estimated border image data of the initial border image data in the next image frame. The technical effect of the Kalman filter algorithm is to improve the accuracy of border data prediction and the response speed of the system. Subsequently, the surgical instrument tracking deep learning model is used again to identify and segment the head position of each surgical instrument in the next image frame in the surgical video data stream to obtain the border image data of multiple instrument heads. This step ensures the continuous tracking and real-time update of the system for dynamic scenes. Next, the preset surgical instrument tracking IOU matching algorithm is used to calculate the ratio value between the intersection area and the union area of the estimated border image data and the multiple border image data obtained by the next image frame recognition and segmentation processing. Through the IOU matching algorithm, the accuracy and reliability of border matching are further improved. The border image data obtained by the next image frame recognition and segmentation processing with the largest ratio value is used as the target border image data tracked by the target instrument head in the next image frame. This step ensures the continuity and accuracy of the tracking process. The target border image data is used as the initial border image data, and the state prediction step of the Kalman filter algorithm is continued to maintain the continuity and stability of the tracking through the iterative process.Based on the target frame image data determined in sequence, the target position that the end of the laparoscope's robotic arm needs to reach is calculated in real time, and a driving instruction is sent to the laparoscope's robotic arm in real time according to the target position, so that the laparoscope tracks the head position of the target instrument in real time. This step realizes the automation and precise positioning of the laparoscope.
[0035] In one example, in response to a user's selection instruction, initial border image data for tracking a target instrument head is determined from the border image data of the multiple instrument heads, including: numbering the border image data of the multiple instrument heads and displaying them; in response to a user's key operation, determining a target code indicated by the key operation, and determining the border image data corresponding to the target code as initial border image data; in response to a user's language instruction, determining the target code indicated by the language instruction, and determining the border image data corresponding to the target code as initial border image data; in response to a user's touch operation, determining the border image data indicated by the touch operation, and determining the indicated border image data as initial border image data.
[0036] In this example, first, the system responds to the user's selection instruction and determines the initial frame image data of the target instrument head for tracking from the frame image data of multiple instrument heads. To achieve this goal, the frame image data of multiple instrument heads are first numbered and the numbering results are displayed to the user. The technical effect of this step is that through numbering and display, the user can clearly and intuitively identify and select the required surgical instrument. Next, the user can issue a selection instruction in a variety of ways. In response to the user's key operation, the system determines the target code indicated by the key operation, and determines the corresponding frame image data as the initial frame image data. The technical effect of this method is to quickly determine the tracking target by utilizing the simplicity and accuracy of the key operation. Another way is to respond to the user's language instruction, the system determines the target code indicated by the language instruction, and determines the corresponding frame image data as the initial frame image data. The technical effect of the language instruction is to provide a more natural interaction method, which is particularly practical when the doctor is busy during the operation. In addition, the user can also make a selection through touch operation, and the system responds to the touch operation, determines the frame image data indicated by the touch operation, and determines it as the initial frame image data. The technical effect of this method is to use the intuitiveness of touch operation to quickly and accurately select the target instrument. Through the above steps, the system determines the initial border image data of the head of the target instrument for tracking. Next, the initial border image data is used as the state prediction input of the Kalman filter algorithm, and the state estimation analysis is performed to determine the estimated border image data of the initial border image data in the next image frame. The technical effect of the Kalman filter algorithm is to improve the accuracy of border data prediction and the response speed of the system. Then, the surgical instrument tracking deep learning model is used to identify and segment the head position of each surgical instrument in the next image frame in the surgical video data stream to obtain the border image data of multiple instrument heads, ensuring the system's continuous tracking and real-time update of dynamic scenes. Next, the preset surgical instrument tracking IOU matching algorithm is used to calculate the ratio between the intersection area and the union area of the estimated border image data and the multiple border image data obtained by the next image frame identification and segmentation processing. Through the IOU matching algorithm, the accuracy and reliability of border matching are improved. The frame image data obtained by the recognition and segmentation of the next image frame with the largest ratio value is used as the target frame image data tracked by the head of the target instrument in the next image frame to ensure the continuity and accuracy of the tracking process. The target frame image data is used as the initial frame image data, and the state prediction step of the Kalman filter algorithm is continued to be executed to maintain the continuity and stability of the tracking through the iterative process. Based on the target frame image data determined in sequence, the target posture that the end of the laparoscope's robotic arm needs to reach is calculated in real time, and the driving instructions are sent to the laparoscope's robotic arm in real time according to the target posture, so that the laparoscope can track the head position of the target instrument in real time, realizing the automation and precise positioning of the laparoscope.
[0037] Scenario example: During the operation, the surgeon is performing laparoscopic surgery and operating the laparoscope to observe and treat the lesion area. At this time, the system has identified and segmented the head position of each surgical instrument in the current image frame through the video stream data captured by the laparoscope, and obtained the frame image data of multiple instrument heads. These frame image data are numbered and displayed on the display, and the head position of each surgical instrument is clearly marked. The surgeon first checks the instrument head marked on the display to determine the target instrument to be tracked. The doctor has three ways to select and determine the instrument target to be tracked. The first way is key operation. The surgeon enters the corresponding target code through the keys on the console. For example, the doctor presses the key numbered "1", and the system immediately determines the frame image data of the instrument head corresponding to the target code "1" as the initial frame image data. The second way is touch screen operation. If the doctor chooses to use the touch screen, he only needs to directly click the marked position of the target instrument on the touch screen of the display. In response to the doctor's touch operation, the system immediately determines that the indicated frame image data is the initial frame image data. The third way is voice operation. The doctor selects the target instrument through voice commands. For example, the doctor says "select instrument 1". After receiving the voice command, the system parses the target code and determines the border image data corresponding to the target code as the initial border image data. Regardless of which method is used, the system will respond quickly and use the determined initial border image data as the state prediction input of the Kalman filter algorithm to perform state estimation analysis and further determine the estimated border image data of the initial border image data in the next image frame. Then, the system continuously tracks the head position of the target instrument through the deep learning model and IOU matching algorithm, calculates the target posture that the end of the laparoscope's robotic arm needs to reach in real time, and sends the corresponding drive command to ensure that the laparoscope tracks the head position of the target instrument in real time. In this scenario, the surgeon can easily select and determine the instrument target to be tracked through buttons, touch screens, or voice operations, achieving flexibility and accuracy of operation, reducing the extra burden during the operation, and improving the efficiency and safety of the operation.
[0038] In one example, the principle formula of the Kalman filter algorithm for performing state estimation analysis on the initial border image data and determining the estimated border image data of the initial border image data in the next image frame is as follows: Status prediction : At the current moment, based on the state and control input at the previous moment, predict the state at the next moment.
[0039] Covariance prediction : Calculate the state covariance matrix for the next moment.
[0040] Kalman Gain :Calculate the Kalman gain matrix based on the state prediction covariance matrix and the observation noise covariance matrix.
[0041] Status Update :Update the current state based on the Kalman gain matrix and observations.
[0042] Covariance Update :According to the Kalman gain matrix and the observation noise covariance matrix, the state covariance matrix of the current moment is updated.
[0043] In one example, the surgical instrument tracking deep learning model is used to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream to obtain the border image data of multiple instrument heads, including: Gaussian noise reduction processing is performed on the next image frame in the video stream data to obtain the next image frame; the surgical instrument tracking deep learning model is used to identify and segment the head positions of each surgical instrument in the next image frame of the surgery to obtain the initial border data of multiple instrument heads; the minimum circumscribed rectangle image algorithm is used to calculate and process the initial border data of each instrument head to obtain the border image data of each instrument head. It should be noted that the initial border data of each instrument head here is obtained by using the surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the next image frame of the surgery, rather than using the surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the current image frame of the surgery.
[0044] In this example, first, the system obtains the video stream data captured by the laparoscope, and performs Gaussian noise reduction processing on the current image frame to obtain a clear image. The technical effect of this step is to remove noise in the image, improve image quality, and provide a better basis for subsequent recognition and processing. After obtaining the processed current image frame, the system uses a surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the image frame, and obtains the initial border data of multiple instrument heads. By applying advanced deep learning models such as YOLOV5-Segment or MASKRCNN, efficient and accurate recognition of the head position of the surgical instrument is ensured. Next, the system uses the minimum bounding rectangle image algorithm to calculate and process the initial border data of each instrument head to obtain the border image data of each instrument head. The technical effect of this step is to further optimize the border data through the minimum bounding rectangle algorithm, and convert the curved border of the instrument head into a rectangular border, so as to facilitate the subsequent calculation of the center point coordinates and IOU matching, thereby improving the recognition accuracy. Then, the system uses these border image data as the state prediction input of the Kalman filter algorithm, performs state estimation analysis, and determines the estimated border image data in the next image frame. The technical effect of the Kalman filter algorithm is to ensure the continuity and response speed of tracking by predicting the border data. For the next image frame, the system performs Gaussian noise reduction processing on it again to ensure image quality. Then, the surgical instrument tracking deep learning model is used to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream to obtain the initial border data of multiple instrument heads. It should be noted here that the initial border data in the next image frame is based on the processing result of the new image frame, not the continuation of the current image frame. Similarly, the system applies the minimum circumscribed rectangle image algorithm to these initial border data to obtain the border image data of each instrument head. The technical effect of this is to ensure that the border data in each frame of the image is the latest and most accurate. Finally, through the above steps, the system calculates the target posture that the end of the laparoscope's robotic arm needs to reach in real time based on the determined target border image data, and sends the corresponding drive instructions to ensure that the laparoscope tracks the head position of the target instrument in real time.
[0045] In one example, the border image data obtained by the recognition and segmentation processing of the next image frame with the largest ratio value is used as the target border image data tracked by the head of the target device in the next image frame, including: sorting the border image data obtained by the recognition and segmentation processing of the next image frame from large to small according to the ratio value; determining the maximum ratio value based on the sorting result, and judging whether the maximum ratio value is greater than or equal to a preset matching threshold; if it is greater than or equal to the preset matching threshold, determining the border image data corresponding to the maximum ratio value as the target border image data; if it is not greater than or equal to the preset matching threshold, adding a unit value to the number of lost target frames. Processing, and determine whether the number of lost target frames after adding a unit value is less than or equal to a preset lost target frame threshold; if it is less than or equal to the preset lost target frame threshold, executing the step of "using the surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream to obtain border image data of multiple instrument heads"; if it is not less than or equal to the preset lost target frame threshold, executing the step of "responding to the user's selection instruction, determining the initial border image data for tracking the target instrument head from the border image data of the multiple instrument heads" and clearing the lost target frame.
[0046] In this example, first, the system obtains the video stream data captured by the laparoscope, and performs Gaussian noise reduction processing on the current image frame to obtain a clear image. The technical effect of this step is to remove noise from the image, improve image quality, and provide a better basis for subsequent recognition and processing. After obtaining the processed current image frame, the system uses a surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the image frame, and obtains the initial bounding box data of multiple instrument heads. By applying advanced deep learning models such as YOLOV5-Segment or MASKRCNN, efficient and accurate recognition of the position of the surgical instrument head is ensured. Next, the system uses the minimum bounding rectangle image algorithm to calculate and process the initial bounding box data of each instrument head to obtain the bounding box image data of each instrument head. The technical effect of this step is to further optimize the bounding box data through the minimum bounding rectangle algorithm, and convert the curved bounding box of the instrument head into a rectangular bounding box, so as to facilitate the subsequent calculation of the center point coordinates and IOU matching, thereby improving the recognition accuracy. These border image data are used as the state prediction input of the Kalman filter algorithm, and the state estimation analysis is performed to determine the estimated border image data of the initial border image data in the next image frame. The technical effect of the Kalman filter algorithm is to ensure the continuity and response speed of tracking by predicting the border data. For the next image frame, the system performs Gaussian noise reduction processing on it again to ensure image quality. Then, the surgical instrument tracking deep learning model is used to identify and segment the head position of each surgical instrument in the next image frame in the surgical video data stream to obtain the initial border data of multiple instrument heads. It should be particularly noted here that the initial border data in the next image frame is based on the processing result of the new image frame, not the continuation of the current image frame. Similarly, the system applies the minimum circumscribed rectangle image algorithm to these initial border data to obtain the border image data of each instrument head. The technical effect of this is to ensure that the border data in each frame of the image is the latest and most accurate. Next, the system sorts the border image data obtained by the recognition and segmentation processing of the next image frame from large to small according to the proportional value. The technical effect of this step is to clarify the priority through sorting, so as to facilitate the selection of the best matching border data. Based on the sorting results, the system determines the maximum ratio value and determines whether the ratio value is greater than or equal to the preset matching threshold. If the ratio value is greater than or equal to the preset matching threshold, the border image data corresponding to the ratio value is determined to be the target border image data, thereby ensuring that the selected border data has a high matching accuracy. If the maximum ratio value does not reach the preset matching threshold, the system adds a unit value to the number of lost target frames and determines whether the number of lost target frames is less than or equal to the preset number of lost target frames threshold. The technical effect of this step is to allow tracking failures for a short period of time without immediately terminating the tracking through a fault-tolerant mechanism.If the number of lost target frames is less than or equal to the preset threshold, the system continues to use the deep learning model to identify and segment the positions of the heads of each surgical instrument in the next image frame to ensure that the system can maintain continuity after a short tracking failure. If the number of lost target frames exceeds the preset threshold, the system responds to the user's selection instruction, re-determines the initial border image data for tracking from the border image data of multiple instrument heads, and clears the number of lost target frames. The technical effect of this step is to ensure that the system can reposition the target instrument and resume normal tracking operations through user reselection.
[0047] In one example, based on the target border image data determined in sequence, the target posture that the end of the laparoscope's robotic arm needs to reach is calculated in real time, including: calculating the pixel coordinates of the four vertices of the border of the target border image data; combining the 3D reference point matrix corresponding to the target instrument head, the laparoscope's camera internal parameter coefficient matrix and the distortion coefficient matrix, and using the visual PNP algorithm to calculate the three-dimensional coordinate transformation matrix of the center point of the target instrument head tracked under the laparoscope field of view based on the laparoscope camera light point; obtaining a preset transformation relationship matrix from the end of the robotic arm to the laparoscope camera light point; and according to the transformation relationship matrix from the end of the robotic arm to the laparoscope camera light point and the three-dimensional coordinate transformation matrix of the center point of the target instrument head based on the camera light point, inversely solving the target posture that the end of the robotic arm needs to reach.
[0048] In one example, before calculating the three-dimensional coordinate transformation matrix of the center point of the target instrument head tracked under the laparoscope field of view based on the camera light point in combination with the 3D reference point matrix corresponding to the target instrument head, the camera intrinsic parameter coefficient matrix and the distortion coefficient matrix of the laparoscope using a visual PNP algorithm, the medical instrument visual tracking method also includes: obtaining the camera intrinsic parameter coefficient matrix and the distortion coefficient matrix of the laparoscope using a monocular camera calibration method, wherein the camera intrinsic parameter coefficient matrix and the distortion coefficient matrix are constant matrices; determining the actual width and length of the multiple instrument heads, and constructing a 3D reference point matrix of each instrument head according to the actual width and length of each instrument head.
[0049] In other words, in the algorithm flow of the surgical robot field of view tracking system, the intrinsic coefficient matrix and distortion coefficient matrix of the laparoscope camera need to be determined first. These parameters are determined by the monocular camera calibration method and are independent of scene changes. As long as the focal length remains unchanged, they can be used continuously once calibrated. In addition, the 3D reference point matrix needs to be determined based on the width and length of the surgical instrument head. Before the operation, the focal length of the mirror holding arm has been planned and regarded as a fixed focal length. In actual operation, the pixel coordinates of the four vertices of the border are first calculated from the border data of the tracking target. Next, the three-dimensional coordinate transformation matrix of the center point of the tracking target based on the camera light point under the endoscope field of view is calculated by combining the 3D reference point matrix, the intrinsic coefficient matrix of the laparoscope camera and the distortion coefficient matrix. After that, the conversion relationship matrix from the robot end to the endoscope camera light point and the three-dimensional coordinate transformation matrix of the center point of the tracking target based on the camera light point are used to inversely solve the end target posture that the robot needs to reach. During the operation, the robot is given a driving command based on the real-time updated target position of the robot end, so that the scope holding arm tracks the surgical instrument in real time and automatically adjusts the surgical field of view, thus ensuring a stable and accurate field of view during the operation.
[0050] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0051] Reference Figure 2 The medical device visual tracking device based on Kalman filtering according to an embodiment of the present invention comprises the following steps: S1, obtain a frame of image data.
[0052] S2, identifying and calculating the edge data information of each instrument head.
[0053] S3, select the tracking target.
[0054] S4, predict the edge data information of the next frame target.
[0055] S5, obtaining the next frame of image data.
[0056] S6, identifying and calculating the border data information of each device head.
[0057] S7, calculating the IOU values of the bounding box data information respectively.
[0058] S8, calculate the maximum IOU value MAXIOU.
[0059] S9, determine whether MAXIOU is greater than a threshold, if so, go to S10, if not, go to S11.
[0060] S10, determine it as a target to be tracked, and turn to S4.
[0061] S11, the number of target frames lost n is greater than a threshold.
[0062] S12, target lost, turn to S3.
[0063] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.
[0064] Reference Figure 3 This embodiment also provides a medical device visual tracking device based on Kalman filtering, including: The acquisition unit 1 is used to acquire the video stream data captured by the laparoscope.
[0065] The tracking unit 2 is used to use a preset surgical instrument tracking deep learning model to identify and segment the head position of each surgical instrument in the current image frame in the video stream data to obtain border image data of multiple instrument heads.
[0066] The determination unit 3 is used to determine the initial frame image data for tracking the target instrument head from the frame image data of the plurality of instrument heads in response to a user's selection instruction.
[0067] The estimation unit 4 is used to use the initial frame image data as a state prediction input of a preset Kalman filter algorithm, perform state estimation analysis, and determine estimated frame image data of the initial frame image data in the next image frame.
[0068] The segmentation unit 5 is used to use the surgical instrument tracking deep learning model to identify and segment the head position of each surgical instrument in the next image frame in the surgical video data stream to obtain frame image data of multiple instrument heads.
[0069] The calculation unit 6 is used to use a preset surgical instrument tracking IOU matching algorithm to calculate the ratio between the intersection area and the union area of the estimated border image data and the multiple border image data obtained by the next image frame recognition and segmentation processing.
[0070] The segmentation unit 7 is used to use the frame image data obtained by the recognition and segmentation processing of the next image frame with the largest ratio value as the target frame image data tracked by the head of the target device in the next image frame.
[0071] Execution unit 8 is used to use the target border image data as initial border image data, and continue to execute the step of "using the initial border image data as the state prediction input of the preset Kalman filter algorithm, performing state estimation analysis, and determining the estimated border image data of the initial border image data in the next image frame".
[0072] The driving unit 9 is used to calculate in real time the target posture that the end of the laparoscope's robotic arm needs to reach based on the target frame image data determined in sequence, and send driving instructions to the laparoscope's robotic arm in real time according to the target posture, so that the laparoscope tracks the head position of the target instrument in real time.
[0073] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.
[0074] Reference Figure 4 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.
[0075] Those skilled in the art will understand that Figure 4 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied.
[0076] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0077] In summary, the medical instrument visual tracking method based on Kalman filtering provided by the present invention improves the operation accuracy and efficiency in laparoscopic surgery through multiple technical steps. First, a preset surgical instrument tracking deep learning model is used to identify and segment the head position of each surgical instrument in the current image frame in the video stream data to obtain the border image data of multiple instrument heads. This technical point solves the problem of the difficulty in identifying the position of the surgical instrument head in traditional laparoscopic surgery, ensures the precise positioning of the surgical instrument head, and improves the accuracy of recognition and the robustness of the system.
[0078] Secondly, the initial border image data is used as the state prediction input of the preset Kalman filter algorithm to perform state estimation analysis to determine the estimated border image data of the initial border image data in the next image frame. The introduction of the Kalman filter algorithm solves the problem of the constantly changing movement speed and direction of surgical instruments in real-time surgical scenes. It is difficult to accurately predict their positions based solely on the data of the current image frame. The Kalman filter algorithm improves the accuracy of position prediction and the response speed of the system, ensuring the continuity and stability of the tracking process.
[0079] In addition, the preset surgical instrument tracking IOU matching algorithm is used to calculate the ratio between the intersection area and the union area of the estimated border image data and the multiple border image data obtained by the next image frame recognition and segmentation processing, and the border image data with the largest ratio is used as the target border image data. In a multi-instrument scene, the borders of different instruments are prone to overlap, resulting in mismatching. The IOU matching algorithm improves the accuracy and reliability of matching and ensures the accuracy of tracking.
[0080] Finally, the 3D reference point matrix corresponding to the target instrument head, the laparoscope camera internal parameter coefficient matrix and the distortion coefficient matrix are combined, and the visual PNP algorithm is used to calculate the three-dimensional coordinate transformation matrix of the center point of the target instrument head tracked under the laparoscope field of view based on the laparoscope camera light point. This technical point solves the problem that changes in the laparoscope viewing angle and focal length during surgery may lead to inaccurate calculation of the target posture. By combining the visual PNP algorithm and the 3D reference point matrix, the target posture is accurately calculated, ensuring the automation and precise positioning of the laparoscope, and improving the stability and accuracy of the surgical field of view adjustment.
[0081] In summary, the present invention significantly improves the operational accuracy, efficiency and safety in laparoscopic surgery through the comprehensive application of technologies such as deep learning model, Kalman filtering algorithm, IOU matching algorithm and visual PNP algorithm, reduces the operating burden of doctors, and enhances the clinical applicability of the laparoscopic arm robot.
[0082] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided by the present invention and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM.
[0083] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0084] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A medical device visual tracking method based on Kalman filtering, characterized in that: The following steps are involved: Acquire video stream data captured by the laparoscope; Using a preset surgical instrument tracking deep learning model to identify and segment the head position of each surgical instrument in the current image frame in the video stream data, and obtain frame image data of multiple instrument heads; In response to a user's selection instruction, determining initial frame image data for tracking a target instrument head from the frame image data of the plurality of instrument heads; Using the initial frame image data as a state prediction input of a preset Kalman filter algorithm, performing state estimation analysis, and determining estimated frame image data of the initial frame image data in the next image frame; Using the surgical instrument tracking deep learning model to identify and segment the head position of each surgical instrument in the next image frame in the surgical video data stream, and obtain frame image data of multiple instrument heads; Using a preset surgical instrument tracking IOU matching algorithm, calculate the ratio values between the intersection area and the union area of the estimated border image data and the multiple border image data obtained by the next image frame recognition and segmentation processing; Using the frame image data obtained by the recognition and segmentation process of the next image frame with the largest ratio value as the target frame image data tracked by the head of the target device in the next image frame; The target frame image data is used as the initial frame image data, and the step of "using the initial frame image data as the state prediction input of the preset Kalman filter algorithm, performing state estimation analysis, and determining the estimated frame image data of the initial frame image data in the next image frame" is continued; Based on the target frame image data determined in sequence, the target posture that the end of the laparoscope's robotic arm needs to reach is calculated in real time, and a driving instruction is sent to the laparoscope's robotic arm in real time according to the target posture, so that the laparoscope tracks the head position of the target instrument in real time.
2. The medical device visual tracking method according to claim 1, characterized in that: The preset surgical instrument tracking deep learning model is used to identify and segment the head position of each surgical instrument in the current image frame in the video stream data to obtain frame image data of multiple instrument heads, including: Performing Gaussian noise reduction processing on a current image frame in the video stream data to obtain a current image frame; The surgical instrument tracking deep learning model is used to identify and segment the head positions of each surgical instrument in the current surgical image frame to obtain initial frame data of multiple instrument heads; The minimum circumscribed rectangle image algorithm is used to calculate and process the initial frame data of each instrument head to obtain the frame image data of each instrument head.
3. The medical device visual tracking method according to claim 1, characterized in that: In response to a user's selection instruction, determining initial frame image data for tracking a target instrument head from the frame image data of the plurality of instrument heads includes: Performing numbering and display processing on the frame image data of the plurality of instrument heads; In response to a key operation by a user, determining a target code indicated by the key operation, and determining frame image data corresponding to the target code as initial frame image data; In response to a user's language instruction, determining a target code indicated by the language instruction, and determining the frame image data corresponding to the target code as initial frame image data; In response to a touch operation of a user, frame image data indicated by the touch operation is determined, and the indicated frame image data is determined as initial frame image data.
4. The medical device visual tracking method according to claim 1, characterized in that: The surgical instrument tracking deep learning model is used to identify and segment the head position of each surgical instrument in the next image frame in the surgical video data stream to obtain frame image data of multiple instrument heads, including: Performing Gaussian noise reduction processing on the next image frame in the video stream data to obtain the next image frame; The surgical instrument tracking deep learning model is used to identify and segment the head position of each surgical instrument in the next image frame of the surgery to obtain initial frame data of multiple instrument heads; The minimum circumscribed rectangle image algorithm is used to calculate and process the initial frame data of each instrument head to obtain the frame image data of each instrument head.
5. The medical device visual tracking method according to claim 1, characterized in that: The frame image data obtained by the recognition and segmentation process of the next image frame with the largest ratio value is used as the target frame image data tracked by the head of the target device in the next image frame, including: According to the ratio value, the frame image data obtained by the recognition and segmentation process of the next image frame is sorted from large to small; Determine a maximum ratio value based on the sorting result, and determine whether the maximum ratio value is greater than or equal to a preset matching threshold; If it is greater than or equal to the preset matching threshold, determining the frame image data corresponding to the maximum ratio value as the target frame image data; If it is not greater than or equal to the preset matching threshold, then adding a unit value to the number of lost target frames, and determining whether the number of lost target frames after adding the unit value is less than or equal to the preset lost target frame threshold; If it is less than or equal to the preset target frame loss threshold, the step of "using the surgical instrument tracking deep learning model to identify and segment the head positions of each surgical instrument in the next image frame in the surgical video data stream to obtain frame image data of multiple instrument heads" is executed; If it is not less than or equal to the preset target lost frame number threshold, the step of "determining the initial border image data for tracking the target instrument head from the border image data of the multiple instrument heads in response to the user's selection instruction" is executed, and the target lost frame number is cleared.
6. The medical device visual tracking method according to claim 1, characterized in that: Based on the target frame image data determined in sequence, the target posture that the end of the laparoscope robot arm needs to reach is calculated in real time, including: Calculate the pixel coordinates of four vertices of the frame of the target frame image data; Combining the 3D reference point matrix corresponding to the target instrument head, the laparoscope camera internal parameter coefficient matrix and the distortion coefficient matrix, and using the visual PNP algorithm, the three-dimensional coordinate transformation matrix of the center point of the target instrument head tracked under the laparoscope field of view is calculated based on the laparoscope camera light point; Obtain the preset transformation relationship matrix from the end of the robotic arm to the light spot of the laparoscope camera; According to the transformation relationship matrix from the end of the robot arm to the laparoscope camera light spot and the three-dimensional coordinate transformation matrix of the center point of the target instrument head based on the camera light spot, the target posture that the end of the robot arm needs to reach is obtained by inverse solution.
7. The medical device visual tracking method according to claim 6, characterized in that: Before calculating the three-dimensional coordinate transformation matrix of the center point of the target instrument head tracked under the laparoscope field of view based on the camera light point by combining the 3D reference point matrix corresponding to the target instrument head, the camera internal parameter coefficient matrix of the laparoscope, and the distortion coefficient matrix, using the visual PNP algorithm, the medical instrument visual tracking method further includes: Using a monocular camera calibration method to obtain a camera intrinsic parameter matrix and a distortion coefficient matrix of a laparoscope, wherein the camera intrinsic parameter matrix and the distortion coefficient matrix are constant matrices; The actual widths and lengths of the multiple instrument heads are determined, and a 3D reference point matrix of each instrument head is constructed according to the actual width and length of each instrument head.
8. A medical device visual tracking device based on Kalman filtering, comprising: An acquisition unit, used for acquiring video stream data captured by the laparoscope; A tracking unit, configured to use a preset surgical instrument tracking deep learning model to identify and segment the head position of each surgical instrument in the current image frame in the video stream data to obtain frame image data of multiple instrument heads; a determination unit, configured to determine, in response to a user's selection instruction, initial frame image data for tracking a target instrument head from the frame image data of the plurality of instrument heads; An estimation unit, used for taking the initial frame image data as a state prediction input of a preset Kalman filter algorithm, performing state estimation analysis, and determining estimated frame image data of the initial frame image data in a next image frame; A segmentation unit, configured to use the surgical instrument tracking deep learning model to identify and segment the head position of each surgical instrument in the next image frame in the surgical video data stream to obtain frame image data of multiple instrument heads; A calculation unit, used to calculate the ratio values between the intersection area and the union area of the estimated border image data and the multiple border image data obtained by the next image frame recognition and segmentation processing by using a preset surgical instrument tracking IOU matching algorithm; A segmentation unit, configured to use the frame image data obtained by the recognition and segmentation processing of the next image frame with the largest ratio value as the target frame image data tracked by the head of the target device in the next image frame; an execution unit, configured to use the target border image data as initial border image data, and continue to execute the step of "using the initial border image data as a state prediction input of a preset Kalman filter algorithm, performing state estimation analysis, and determining estimated border image data of the initial border image data in a next image frame"; A driving unit is used to calculate in real time the target posture that the end of the laparoscope's robotic arm needs to reach based on the target frame image data determined in sequence, and send a driving instruction to the laparoscope's robotic arm in real time according to the target posture, so that the laparoscope tracks the head position of the target instrument in real time.
9. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
