A dental surgery camera automatic focusing method, system and storage medium

By acquiring a focus mapping table and coordinate transformation matrix, and combining it with image data collected by a binocular navigator, automatic focusing of the dental surgical camera is achieved, solving the problem of cumbersome manual focusing in existing technologies and reducing surgical labor costs.

CN120881387BActive Publication Date: 2025-12-05SHENZHEN CALVIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511344165.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2025-12-05
Estimated Expiration
2045-09-19

AI Technical Summary

Technical Problem

In dental surgery, cameras need to be manually focused frequently, which increases the labor costs of the surgery, and current technology cannot achieve automatic and precise focusing during the operation.

Method used

By acquiring the focus mapping table and coordinate transformation matrix, and combining the image data collected by the binocular navigator, the camera's focal length and working distance are calculated in real time to achieve automatic focusing.

Benefits of technology

It enables automatic and precise focusing of the camera during dental surgery, reducing the need for manual focusing and lowering surgical labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120881387B_ABST
    Figure CN120881387B_ABST
Patent Text Reader

Abstract

The application provides a dental surgery camera automatic focusing method, system and storage medium, real-time three-dimensional coordinates of a mouth reference plate in a navigator three-dimensional coordinate system are obtained through real-time image analysis of reference plate identification points, a relative position relationship between a surgical area and a surgery camera is captured in real time based on the reference, real-time working distance of the surgery camera is obtained through mapping relationship between a focal length and a working distance of the surgery camera and conversion of real-time images of the reference plate identification points on the mouth reference plate, and the focal length of the surgery camera is adjusted in combination with a focusing mapping table, so that a technical purpose of automatic real-time tracking and accurate focusing during surgery is achieved, and a problem of complicated focusing in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical device technology, and specifically to a method, system, and storage medium for automatic focusing of a dental surgical camera for real-time video capture during oral treatment procedures. Background Technology

[0002] During dental surgery, dentists record the intraoral procedure using a camera for later review, teaching, and other purposes. Because the intraoral surgical area is small, and because the patient is flanked by the dentist and assistant during the procedure, a camera with high magnification and a long focal length needs to be mounted at a distance from the patient to avoid obstructions and clearly capture the intraoral surgical area. Typically, since the areas illuminated by the surgical light and the camera's mounting position overlap, the camera can be mounted on the surgical light.

[0003] Dental surgical cameras use lenses with long focal lengths and high magnification, resulting in a typically shallow depth of field of only a few millimeters. When there is relative movement between the camera and the patient, manual focusing is usually required to capture a clear image of the surgical area. During surgery, patient movement is inevitable, and the surgeon and assistants often need to constantly change positions for better operation. This necessitates adjusting the position of the surgical light and camera. When the adjustment is significant, the camera cannot autofocus. Therefore, frequent manual focusing is necessary during surgery. Surgical lights are often contaminated with bacteria, and the focusing buttons require a separate nurse to adjust them, increasing the labor costs of the procedure.

[0004] Therefore, the industry urgently needs to propose a camera autofocus solution that can track the surgical area location in real time and automatically and accurately adjust the focus to solve the application problems in existing technologies. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a method, system and storage medium for automatic focusing of a dental surgical camera, which can adjust the focus of the surgical camera according to the relative position of the surgical area and the surgical camera during the operation, so as to achieve precise intraoperative focusing.

[0006] To ensure navigation accuracy and treatment effectiveness.

[0007] The technical solution adopted by this invention to solve the technical problem is as follows:

[0008] An automatic focusing method for a dental surgical camera includes:

[0009] S1. Obtain a focus mapping table, which includes the mapping relationship between the focal length and working distance of the surgical camera. The focal length is the distance between the optical center of the surgical camera and the focal point, and the working distance is the distance between the optical center of the surgical camera and the surgical area.

[0010] S2. Calibrate the surgical camera and the binocular navigation system to obtain the coordinate transformation matrix between the camera's 3D coordinate system and the binocular navigation system's 3D coordinate system. V H C ;

[0011] S3. When the positioning probe comes into contact with the surgical area in the patient's mouth, control the binocular navigation device to acquire the image of the probe marker point on the positioning probe, and obtain the initial three-dimensional coordinates P1 of the surgical area in the three-dimensional coordinate system of the navigation device through the image analysis of the probe marker point, where P1=(X1,Y1,Z1).

[0012] S4. Control the binocular navigator to acquire images of reference board markers fixed on the patient's mouth reference board. Analyze the images of the reference board markers to obtain the initial three-dimensional coordinates P2 of the mouth reference board in the navigator's three-dimensional coordinate system, where P2 = (X2, Y2, Z2).

[0013] S5. Based on the initial three-dimensional coordinates of the surgical area in the navigator's three-dimensional coordinate system and the initial three-dimensional coordinates of the oral reference plate in the navigator's three-dimensional coordinate system, the relative positional relationship ΔP between the surgical area and the oral reference plate is calculated.

[0014] S6. Control the binocular navigator to acquire real-time images of the reference board markers on the mouth reference board, and obtain the real-time three-dimensional coordinates P3 of the mouth reference board in the navigator's three-dimensional coordinate system by analyzing the real-time images of the reference board markers, where P3=(X3,Y3,Z3).

[0015] S7. Based on the relative positional relationship between the surgical area and the oral reference plate, and the real-time three-dimensional coordinates of the oral reference plate in the navigation system, the real-time position of the surgical area is derived, and the real-time three-dimensional coordinates P of the surgical area in the navigation system are obtained. t ;

[0016] S8. Based on the real-time three-dimensional coordinates P of the surgical area in the navigation system. t Combining the coordinate transformation matrix between the camera's 3D coordinate system and the navigator's 3D coordinate system V H C The real-time three-dimensional coordinates P of the surgical area in the camera's three-dimensional coordinate system were calculated. T , where P T =P t * V H C ;

[0017] S9. Based on the real-time three-dimensional coordinates P of the surgical area in the camera's three-dimensional coordinate system. T Calculate the real-time working distance of the surgical camera;

[0018] S10. Obtain the real-time focal length of the surgical camera based on the real-time working distance and focus mapping table, and adjust the focal length of the surgical camera based on the real-time focal length.

[0019] S11. Acquire real-time images from the surgical camera and perform a sharpness test based on the real-time images from the surgical camera; if the sharpness test passes, perform intraoperative photography; if the sharpness test fails, return to step S1 to refocus.

[0020] Compared with the prior art, the beneficial effects of this technical solution are: based on the mapping relationship between the focal length and working distance of the surgical camera, the real-time working distance of the surgical camera is calculated by acquiring real-time images of the reference plate marking points on the oral reference plate, and then the focal length of the surgical camera is adjusted by combining the focus mapping table, thereby achieving the technical purpose of precise focus adjustment and solving the problem of cumbersome focus adjustment in the prior art.

[0021] Furthermore, step S2 specifically includes the following steps:

[0022] S201. Control the surgical camera and binocular navigator to simultaneously acquire images from the camera calibration board, and obtain the camera calibration board image and the navigator calibration board image;

[0023] S202. Extract feature points from the camera calibration board image and the navigator calibration board image and perform feature point matching;

[0024] S203. Obtain coordinate data of multiple identical feature points based on the camera calibration board image and the navigator calibration board image: Obtain the calibration three-dimensional coordinate value P of the feature point in the calibration board's three-dimensional coordinate system. w The 3D coordinates P of the same feature point in the camera's 3D coordinate system are obtained based on the image of the camera calibration board and the distance between the camera calibration board and the surgical camera. v ; Obtain the three-dimensional coordinates P of the same feature point in the navigator's three-dimensional coordinate system based on the navigator calibration board image. c ;

[0025] S204. Based on the coordinate data of multiple identical feature points, analyze and obtain the translation factor T1 and rotation factor R1 between the camera's 3D coordinate system and the calibration board's 3D coordinate system; analyze and obtain the translation factor T2 and rotation factor R2 between the navigator's 3D coordinate system and the calibration board's 3D coordinate system; where P v =R1·P w +T1, P c=R2·P w +T2;

[0026] S205. Based on the translation factor T1 and rotation factor R1 between the camera's 3D coordinate system and the calibration board's 3D coordinate system, and the translation factor T2 and rotation factor R2 between the navigator's 3D coordinate system and the calibration board's 3D coordinate system, the coordinate transformation matrix between the surgical camera's 3D coordinate system and the binocular navigator's 3D coordinate system is analyzed and obtained. V H C .

[0027] The beneficial effects of adopting the above scheme are as follows: the surgical camera and the binocular navigator are calibrated by a camera calibration board. Images of the camera calibration board are acquired by the surgical camera and the binocular navigator. After feature point matching, the calibration three-dimensional coordinate values ​​of the feature points in the calibration board's three-dimensional coordinate system, the camera's three-dimensional coordinate system, and the navigator's three-dimensional coordinate system are obtained. After clarifying the transformation relationship between the camera's three-dimensional coordinate system and the calibration board's three-dimensional coordinate system, and between the navigator's three-dimensional coordinate system and the calibration board's three-dimensional coordinate system, the coordinate transformation matrix between the surgical camera's camera three-dimensional coordinate system and the binocular navigator's navigator three-dimensional coordinate system can be obtained.

[0028] Furthermore, in step S5, the relative positional relationship between the surgical area and the oral reference plate is ΔP = (ΔX, ΔY, ΔZ), where ΔX = X2 - X1, ΔY = Y2 - Y1, and ΔZ = Z2 - Z1.

[0029] The advantages of adopting the above scheme are: the position of the surgical area is characterized by the image of the probe marking point on the positioning probe, and the relative positional relationship between the surgical area and the oral reference plate can be calculated by combining the reference plate marking point on the oral reference plate with the fixed relative position between the surgical area and the oral reference plate.

[0030] Furthermore, in step S7, the real-time three-dimensional coordinates P of the surgical area in the navigator's three-dimensional coordinate system are... t =(X t ,Y t Z t ), where X t =X³ + ΔX,Y t =Y3+ΔY,Z t =Z3+ΔZ.

[0031] The beneficial effect of adopting the above scheme is that after the oral reference plate is fixedly set in the patient's oral cavity, the relative position between the surgical area and the oral reference plate is fixed. Based on this premise, after obtaining the real-time three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator, the real-time three-dimensional coordinates of the surgical area in the three-dimensional coordinate system of the navigator can be further calculated.

[0032] Furthermore, step S11 specifically includes the following steps:

[0033] S1101. Convert the real-time image from the surgical camera into a grayscale image;

[0034] S1102. Calculate the image gradient of pixel I(x,y) on the X-axis of the grayscale image, and obtain the gradient value G of the pixel in the X direction. X (x,y), where G X (x,y)=Sx*(x-1:x+1,y-1:y+1), where the convolution kernel is located in the X direction.

[0035] S1103. Calculate the image gradient of pixel I(x,y) on the Y-axis of the grayscale image, and obtain the gradient value G of the pixel in the Y direction. Y (x,y), where G Y (x,y)=Sy*(x-1:x+1,y-1:y+1), where the convolution kernel is located in the Y direction.

[0036] S1104. Calculate the gradient magnitude T(x,y) of pixel I(x,y) in a grayscale image, where T(x,y) = [G X (x,y)] 2 +[G Y (x,y)] 2 ;

[0037] S1105. Sharpness detection is performed by comparing the gradient magnitude T(x,y) of pixel I(x,y) in the grayscale image with the gradient threshold. If the gradient magnitude is greater than the gradient threshold, the pixel is considered to be a sharp pixel; otherwise, the pixel is considered to be an invalid pixel.

[0038] The advantages of adopting the above scheme are: by performing image gradient analysis on the X and Y axes of the grayscale image after grayscale processing, based on the principle that the grayscale changes drastically at the edge of a clear image, the image is considered clear when the gradient magnitude is greater than the gradient threshold, and the pixel is considered invalid when the gradient magnitude is less than or equal to the gradient threshold. It has the advantages of fast operation speed and accurate and reliable results.

[0039] The technical solution adopted by this invention to solve the technical problem is as follows:

[0040] An automatic focusing system for a dental surgical camera includes:

[0041] The mapping table acquisition module is used to acquire a focus mapping table, which includes the mapping relationship between the focal length and working distance of the surgical camera. The focal length is the distance between the optical center of the surgical camera and the focal point, and the working distance is the distance between the optical center of the surgical camera and the surgical area.

[0042] The transformation matrix acquisition module is used to calibrate the surgical camera and the binocular navigator, obtaining the coordinate transformation matrix between the camera's 3D coordinate system and the navigator's 3D coordinate system. V H C ;

[0043] The first initial coordinate acquisition module is used to control the binocular navigation device to acquire images of probe markers on the positioning probe when the positioning probe is in contact with the surgical area in the patient's oral cavity. The initial three-dimensional coordinates P1 of the surgical area in the three-dimensional coordinate system of the navigation device are obtained by analyzing the images of the probe markers, where P1 = (X1, Y1, Z1).

[0044] The second initial coordinate acquisition module is used to control the binocular navigator to acquire images of reference plate markers fixed on the patient's mouth reference plate. The initial three-dimensional coordinates P2 of the mouth reference plate in the navigator's three-dimensional coordinate system are obtained by analyzing the images of the reference plate markers, where P2 = (X2, Y2, Z2).

[0045] The relative position calculation module is used to calculate the relative position relationship ΔP between the surgical area and the oral reference plate based on the initial three-dimensional coordinates of the surgical area in the three-dimensional coordinate system of the navigator and the initial three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator.

[0046] The real-time coordinate acquisition module is used to control the binocular navigator to acquire real-time images of the reference board markers on the mouth reference board. The real-time three-dimensional coordinates P3 of the mouth reference board in the navigator's three-dimensional coordinate system are obtained by analyzing the real-time images of the reference board markers, where P3 = (X3, Y3, Z3).

[0047] The real-time position acquisition module for the surgical area is used to derive the real-time position of the surgical area based on the relative positional relationship between the surgical area and the oral reference plate and the real-time three-dimensional coordinates of the oral reference plate in the navigator's three-dimensional coordinate system. It then analyzes and obtains the real-time three-dimensional coordinates P of the surgical area in the navigator's three-dimensional coordinate system. t ;

[0048] The real-time coordinate calculation module for the surgical area calculates the real-time three-dimensional coordinates P of the surgical area in the navigation system. t Combining the coordinate transformation matrix between the camera's 3D coordinate system and the navigator's 3D coordinate system V H C The real-time three-dimensional coordinates P of the surgical area in the camera's three-dimensional coordinate system were calculated. T, where P T =P t * V H C ;

[0049] The real-time working distance calculation module is used to calculate the real-time three-dimensional coordinates P of the surgical area in the camera's three-dimensional coordinate system. T Calculate the real-time working distance of the surgical camera;

[0050] The focus adjustment module is used to obtain the real-time focus of the surgical camera based on the real-time working distance of the surgical camera and the focus mapping table, and to adjust the focus of the surgical camera based on the real-time focus.

[0051] The sharpness detection module is used to acquire real-time images from the surgical camera and perform sharpness detection based on these images. If the sharpness detection passes, intraoperative photography is performed; if the sharpness detection fails, refocusing is performed.

[0052] Furthermore, the transformation matrix acquisition module includes:

[0053] The image acquisition unit is used to control the surgical camera and the binocular navigator to simultaneously acquire images from the camera calibration board, thereby obtaining images from the camera calibration board and the navigator calibration board.

[0054] The feature point matching unit is used to extract feature points from the camera calibration board image and the navigator calibration board image and perform feature point matching.

[0055] The coordinate data acquisition unit is used to acquire coordinate data information of multiple identical feature points based on the camera calibration board image and the navigator calibration board image: acquiring the calibration three-dimensional coordinate value P of the feature point in the calibration board's three-dimensional coordinate system. w The 3D coordinates P of the same feature point in the camera's 3D coordinate system are obtained based on the image of the camera calibration board and the distance between the camera calibration board and the surgical camera. v ; Obtain the three-dimensional coordinates P of the same feature point in the navigator's three-dimensional coordinate system based on the navigator calibration board image. c ;

[0056] The factor analysis unit is used to analyze and obtain the translation factor T1 and rotation factor R1 between the camera's 3D coordinate system and the calibration board's 3D coordinate system, and the translation factor T2 and rotation factor R2 between the navigator's 3D coordinate system and the calibration board's 3D coordinate system, based on the coordinate data of multiple identical feature points; where P v =R1·P w +T1, P c =R2·P w +T2;

[0057] The transformation matrix analysis unit is used to analyze and obtain the coordinate transformation matrix between the camera's 3D coordinate system and the binocular navigator's 3D coordinate system, based on the translation factors T1 and R1 between the camera's 3D coordinate system and the calibration board's 3D coordinate system, and the translation factors T2 and R2 between the navigator's 3D coordinate system and the calibration board's 3D coordinate system. V H C .

[0058] Furthermore, in the relative position calculation module, based on the initial three-dimensional coordinates of the surgical area in the navigator's three-dimensional coordinate system and the initial three-dimensional coordinates of the oral reference plate in the navigator's three-dimensional coordinate system, the relative positional relationship ΔP between the surgical area and the oral reference plate is calculated, wherein the relative positional relationship ΔP between the surgical area and the oral reference plate is ΔP = (ΔX, ΔY, ΔZ), ΔX = X2 - X1, ΔY = Y2 - Y1, ΔZ = Z2 - Z1;

[0059] In the real-time position acquisition module of the surgical area, the real-time position of the surgical area is derived based on the relative positional relationship between the surgical area and the oral reference plate and the real-time three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator. The real-time three-dimensional coordinates P of the surgical area in the three-dimensional coordinate system of the navigator are then analyzed and obtained. t Among them, the real-time three-dimensional coordinates P of the surgical area in the three-dimensional coordinate system of the navigation device t =(X t ,Y t Z t ), X t =X³ + ΔX,Y t =Y3+ΔY,Z t =Z3+ΔZ.

[0060] Furthermore, the sharpness detection module includes:

[0061] The grayscale conversion unit is used to convert real-time images from the surgical camera into grayscale images;

[0062] The first gradient value calculation unit is used to calculate the image gradient of pixel I(x,y) in the grayscale image along the X-axis, and obtain the gradient value G of the pixel in the X direction. X (x,y), where G X (x,y)=Sx*(x-1:x+1,y-1:y+1), where the convolution kernel is located in the X direction.

[0063] The second gradient value calculation unit is used to calculate the image gradient of pixel I(x,y) in the grayscale image along the Y-axis, and obtain the gradient value G of the pixel in the Y direction. Y (x,y), where G Y(x,y)=Sy*(x-1:x+1,y-1:y+1), where the convolution kernel is located in the Y direction.

[0064] The gradient magnitude calculation unit is used to calculate the gradient magnitude T(x,y) of pixel I(x,y) in a grayscale image, where T(x,y) = [G X (x,y)] 2 +[G Y (x,y)] 2 ;

[0065] The sharpness detection unit is used to detect sharpness by comparing the gradient magnitude T(x,y) of pixel I(x,y) in the grayscale image with a gradient threshold. If the gradient magnitude is greater than the gradient threshold, the pixel is considered to be a sharp pixel; otherwise, the pixel is considered to be an invalid pixel.

[0066] Correspondingly, a storage medium stores a computer program, the computer program including program instructions, which, when executed by a processor, execute the automatic focusing method for a dental surgical camera as described above. Attached Figure Description

[0067] Figure 1 This is a flowchart of the automatic focusing method for a dental surgical camera according to the present invention.

[0068] Figure 2 This is a schematic diagram of the automatic focusing system for the dental surgical camera of the present invention.

[0069] The components represented by each number in the diagram are listed below:

[0070] Modules 1-1: Mapping table acquisition module; 2-2: Transformation matrix acquisition module; 3-3: First initial coordinate acquisition module; 4-4: Second initial coordinate acquisition module; 5-5: Relative position calculation module; 6-6: Real-time coordinate acquisition module; 7-7: Real-time surgical area position acquisition module; 8-8: Real-time surgical area coordinate calculation module; 9-9: Real-time working distance calculation module; 10-11: Focus adjustment module; 11-12: Sharpness detection module. Detailed Implementation

[0071] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0072] In the description of this invention, it should be understood that the terms "center," "upper," "lower," "front," "rear," "left," and "right," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or component referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0073] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. When a component is referred to as being "fixed to" or "set on" another element, it can be directly on the other component or there may be an intervening component. When a component is considered to be "connected" to another element, it can be directly connected to the other element or there may be an intervening component. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0074] During surgery, doctors use surgical cameras to record the entire process, allowing for simultaneous operation and recording. This provides data support for subsequent surgical review and teaching. In oral surgeries, such as dental implant surgery, the surgical area within the mouth is relatively small, and the patient is flanked by the doctor and assistant. Therefore, a camera equipped with a high magnification and long focal length lens needs to be installed at a distance from the patient to avoid obstructions and clearly capture the intraoral surgical area. Typically, since the illumination area and installation position of the surgical light and camera overlap, the camera can be mounted on the surgical light.

[0075] Dental surgical cameras use lenses with long focal lengths and high magnification, resulting in a typically shallow depth of field of only a few millimeters. When there is relative movement between the camera and the patient, manual focusing is usually required to capture a clear image of the surgical area. During surgery, patient movement is inevitable, and the surgeon and assistants often need to constantly change positions for better operation. This necessitates adjusting the position of the surgical light and camera. When the adjustment is significant, the camera cannot autofocus. Therefore, frequent manual focusing is necessary during surgery. Surgical lights are often contaminated with bacteria, and the focusing buttons require a separate nurse to adjust them, increasing the labor costs of the procedure.

[0076] Therefore, the industry urgently needs to propose a camera autofocus solution that can track the surgical area location in real time and automatically and accurately adjust the focus to solve the application problems in existing technologies.

[0077] To address the aforementioned problems, the present invention provides an automatic focusing method, system, and storage medium for a dental surgical camera, wherein the automatic focusing method, system, and storage medium for a dental surgical camera are implemented based on an automatic focusing device for a dental surgical camera.

[0078] The dental surgical camera autofocus device includes a surgical light, a surgical camera, and a binocular navigator. The surgical light includes a support body and multiple LEDs mounted on the support body; the surgical light provides intraoperative illumination through the LEDs; the surgical camera and the binocular navigator are fixedly mounted on the support body; the surgical camera is used to collect real-time video data during the surgical process, and the binocular navigator is used for real-time positioning of the positioning probe, oral reference plate, etc. The binocular navigator includes a first camera and a second camera, which are respectively fixedly mounted on both sides of the surgical camera.

[0079] like Figure 1 As shown, in order to solve the above problems, the present invention provides an automatic focusing method for a dental surgical camera, the method comprising the following steps:

[0080] S1. Obtain a focus mapping table, which includes a mapping relationship between the focal length and working distance of the surgical camera. The focal length is the distance between the optical center and the focal point of the surgical camera, and the working distance is the distance between the optical center and the surgical area of ​​the surgical camera. The focus mapping table is pre-obtainable data. On one hand, it can be obtained based on the factory settings of the surgical camera; on the other hand, it can be obtained by testing the surgical camera. By placing the focus adjustment plate at different distances in front of the surgical camera, adjusting the focal length of the surgical camera at each distance, recording the corresponding focal length and working distance, and establishing a mapping relationship, the focus mapping table can be obtained. Based on the focus mapping table, the focal length corresponding to each working distance of the surgical camera can be determined. Adjusting the focal length according to the working distance ensures that the surgical camera can acquire clear video data.

[0081] S2. Calibrate the surgical camera and the binocular navigation system to obtain the coordinate transformation matrix between the camera's 3D coordinate system and the binocular navigation system's 3D coordinate system. V H CIn step S2, the surgical camera acquires two-dimensional planar data. By adding the distance between the surgical camera and the observed object, a three-dimensional coordinate system for the camera can be established, resulting in three-dimensional data. The binocular navigator is equipped with a first camera and a second camera. The observed object, the first camera, and the second camera form a triangular relationship, thus allowing the binocular navigator to acquire three-dimensional planar data. The surgical camera has its own three-dimensional coordinate system; the binocular navigator has its own three-dimensional coordinate system. The purpose of step S2 is to establish a coordinate transformation matrix between the camera's three-dimensional coordinate system and the navigator's three-dimensional coordinate system. V H C .

[0082] S3. When the positioning probe is placed against the surgical area inside the patient's mouth, the binocular navigation system is controlled to acquire images of the probe markers on the positioning probe. The initial three-dimensional coordinates P1 of the surgical area in the navigation system's three-dimensional coordinate system are obtained through image analysis of the probe markers, where P1 = (X1, Y1, Z1). One end of the positioning probe has a probe tip, and the other end has a probe marker. After calibration, the initial three-dimensional coordinates of the probe markers in the navigation system can be obtained by acquiring images of the probe markers on the positioning probe using the binocular navigation system. Since the relative positional relationship between the probe markers and the probe tip at both ends of the positioning probe is known, and the probe tip is placed against the surgical area inside the patient's mouth, the initial three-dimensional coordinates of the surgical area in the navigation system can be obtained in step S3 by acquiring images of the probe markers on the positioning probe.

[0083] S4. Control the binocular navigator to acquire images of reference plate markers fixed on the patient's mouth reference plate. Analyze these images to obtain the initial three-dimensional coordinates P2 of the mouth reference plate in the navigator's three-dimensional coordinate system, where P2 = (X2, Y2, Z2). The positioning principle of the mouth reference plate is the same as that of the positioning probe. After the mouth reference plate is fixed to the patient's mouth and calibrated, the initial three-dimensional coordinates of the reference plate markers in the navigator's three-dimensional coordinate system can be obtained by acquiring images of the reference plate markers on the mouth reference plate using the binocular navigator. Since the positions of the reference plate markers on the mouth reference plate are known, the initial three-dimensional coordinates of the mouth reference plate in the navigator's three-dimensional coordinate system can be obtained through image analysis of the reference plate markers.

[0084] S5. Based on the initial three-dimensional coordinates of the surgical area and the oral reference plate in the navigator's three-dimensional coordinate system, the relative positional relationship ΔP between the surgical area and the oral reference plate is calculated. Based on the three-dimensional coordinate data obtained in steps S3 and S4, the relative positional relationship between the surgical area and the oral reference plate can be further calculated.

[0085] S6. Control the binocular navigator to acquire real-time images of the reference plate markers on the oral reference plate. Analyze these real-time images to obtain the real-time three-dimensional coordinates P3 of the oral reference plate in the navigator's three-dimensional coordinate system, where P3 = (X3, Y3, Z3). In step S6, after completing the preliminary preparations, data analysis can be performed on the real-time images of the reference plate markers to obtain the real-time three-dimensional coordinates of the oral reference plate in the navigator's three-dimensional coordinate system. When the patient moves, the reference plate markers on the oral reference plate will move accordingly, and the real-time images of the reference plate markers acquired by the binocular navigator will also change. Therefore, the real-time three-dimensional coordinates of the oral reference plate in the navigator's three-dimensional coordinate system are obtained through the analysis of the real-time images of the reference plate markers.

[0086] S7. Based on the relative positional relationship between the surgical area and the oral reference plate, and the real-time three-dimensional coordinates of the oral reference plate in the navigation system, the real-time position of the surgical area is derived, and the real-time three-dimensional coordinates P of the surgical area in the navigation system are obtained. t Based on the known real-time three-dimensional coordinates of the oral reference plate in the navigator's three-dimensional coordinate system, and according to the relative positional relationship between the surgical area and the oral reference plate known in step S5, the real-time three-dimensional coordinates of the surgical area in the navigator's three-dimensional coordinate system can be further analyzed and obtained.

[0087] S8. Based on the real-time three-dimensional coordinates P of the surgical area in the navigation system. t Combining the coordinate transformation matrix between the camera's 3D coordinate system and the navigator's 3D coordinate system V H C The real-time three-dimensional coordinates P of the surgical area in the camera's three-dimensional coordinate system were calculated. T , where P T =P t * V H C Due to the coordinate transformation matrix between the camera's 3D coordinate system and the navigator's 3D coordinate system. V H C Given that the 3D coordinates of a point in one of the camera's 3D coordinate system and the navigator's 3D coordinate system are known, the 3D coordinates of that point in the other 3D coordinate system can be obtained.

[0088] S9. Based on the real-time three-dimensional coordinates P of the surgical area in the camera's three-dimensional coordinate system. T Calculate the real-time working distance of the surgical camera. As mentioned earlier, the working distance is the distance between the optical center of the surgical camera and the surgical area. In step S9, the real-time three-dimensional coordinates of the surgical area in the camera's three-dimensional coordinate system are known, and the optical center of the surgical camera in the camera's three-dimensional coordinate system is also known, thus the real-time working distance of the surgical camera can be directly obtained.

[0089] S10. Obtain the real-time focal length of the surgical camera based on its real-time working distance and a focus mapping table, and adjust the focal length of the surgical camera accordingly. Since the focus mapping table was obtained in step S1, the focal length corresponding to a certain working distance can be determined from the table. Therefore, the corresponding focal length can be directly obtained from the real-time working distance in step S9. Adjusting the focal length of the surgical camera based on this focal length ensures that the surgical camera can capture clear video data.

[0090] S11. Acquire real-time images from the surgical camera and perform a sharpness test based on the real-time images from the surgical camera; if the sharpness test passes, perform intraoperative photography; if the sharpness test fails, return to step S1 to refocus.

[0091] This technical solution creatively obtains the real-time three-dimensional coordinates of the oral reference board in the navigator's three-dimensional coordinate system through real-time image analysis of the reference board marker points. Based on this, the relative positional relationship between the surgical area and the surgical camera is captured in real time. According to the mapping relationship between the focal length and working distance of the surgical camera, the real-time working distance of the surgical camera is calculated by acquiring real-time images of the reference board marker points on the oral reference board. Then, combined with the focus mapping table, the focal length of the surgical camera is adjusted, thereby achieving the technical purpose of automatic real-time tracking and precise focus adjustment during surgery, solving the problem of cumbersome focus adjustment in existing technologies.

[0092] The purpose of step S2 is to establish a coordinate transformation matrix between the camera's three-dimensional coordinate system and the navigator's three-dimensional coordinate system. Preferably, step S2 specifically includes the following steps:

[0093] S201. Control the surgical camera and binocular navigator to simultaneously acquire images from the camera calibration board, obtaining images of the camera calibration board and the navigator calibration board. The camera calibration board is used to calibrate the surgical camera and the binocular navigator. Acquiring images of the camera calibration board and the navigator calibration board is to obtain images of the marker points on the camera calibration board under the surgical camera and the binocular navigator.

[0094] S202. Extract feature points from the camera calibration board image and the navigator calibration board image and perform feature point matching. Since the marker points on the camera calibration board all have feature points, which are points that are different from the outside world, in step S202, the camera calibration board image and the navigator calibration board image are matched according to the feature points, that is, the correspondence of the same feature point on the camera calibration board image and the navigator calibration board image is obtained.

[0095] S203. Obtain coordinate data information of multiple identical feature points based on the camera calibration board image and the navigator calibration board image. In step S203, obtaining the coordinate data information of the feature points includes the following technical solutions: First, based on the three-dimensional data model of the camera calibration board itself, the relative positional relationships of each point on the camera calibration board can be known. Therefore, based on the three-dimensional data model of the camera calibration board, the calibration three-dimensional coordinate value P of a certain feature point in the three-dimensional coordinate system of the calibration board can be obtained. w Second, as mentioned above, the surgical camera has only one lens, which acquires two-dimensional planar data. By introducing the distance between the surgical camera and the observed object, a three-dimensional coordinate system of the camera can be established, and three-dimensional data can be obtained. Therefore, the three-dimensional coordinate value P of the same feature point in the camera's three-dimensional coordinate system can be obtained based on the image of the camera calibration plate and the distance between the camera calibration plate and the surgical camera. v Third, since a binocular navigator includes a first camera and a second camera, based on the principle of triangulation, the three-dimensional coordinates P of the same feature point in the navigator's three-dimensional coordinate system are obtained through the image of the navigator calibration board. c .

[0096] S204. Based on the coordinate data of multiple identical feature points, analyze and obtain the translation factor T1 and rotation factor R1 between the camera's 3D coordinate system and the calibration board's 3D coordinate system; analyze and obtain the translation factor T2 and rotation factor R2 between the navigator's 3D coordinate system and the calibration board's 3D coordinate system; where P v =R1·P w +T1, P c =R2·P w +T2. Coordinate transformation between two three-dimensional coordinate systems, including translation and rotation. In step S204, the translation factor T1 and rotation factor R1 between the camera's three-dimensional coordinate system and the calibration board's three-dimensional coordinate system, and the translation factor T2 and rotation factor R2 between the navigator's three-dimensional coordinate system and the calibration board's three-dimensional coordinate system, can all be obtained through analysis of the coordinate data information of the feature points.

[0097] S205. Based on the translation factor T1 and rotation factor R1 between the camera's 3D coordinate system and the calibration board's 3D coordinate system, and the translation factor T2 and rotation factor R2 between the navigator's 3D coordinate system and the calibration board's 3D coordinate system, the coordinate transformation matrix between the surgical camera's 3D coordinate system and the binocular navigator's 3D coordinate system is analyzed and obtained. V H CIn step S205, using the calibration board's three-dimensional coordinate system as a bridge, and based on the known translation factors T1 and R1 between the camera's three-dimensional coordinate system and the calibration board's three-dimensional coordinate system, and the translation factors T2 and R2 between the navigator's three-dimensional coordinate system and the calibration board's three-dimensional coordinate system, the coordinate transformation matrix between the surgical camera's three-dimensional coordinate system and the binocular navigator's three-dimensional coordinate system can be calculated. V H C .

[0098] Based on the above technical solution, the surgical camera and the binocular navigator are calibrated using a camera calibration board. Images of the camera calibration board are acquired by the surgical camera and the binocular navigator. After feature point matching, the calibration three-dimensional coordinates of the feature points in the calibration board's three-dimensional coordinate system, the camera's three-dimensional coordinate system, and the navigator's three-dimensional coordinate system are obtained. After clarifying the transformation relationships between the camera's three-dimensional coordinate system and the calibration board's three-dimensional coordinate system, and between the navigator's three-dimensional coordinate system and the calibration board's three-dimensional coordinate system, the coordinate transformation matrix between the surgical camera's three-dimensional coordinate system and the binocular navigator's three-dimensional coordinate system can be obtained.

[0099] Preferably, in step S5, the relative positional relationship between the surgical area and the oral reference plate is ΔP = (ΔX, ΔY, ΔZ), where ΔX = X2 - X1, ΔY = Y2 - Y1, and ΔZ = Z2 - Z1. The position of the surgical area is characterized by the image of the probe markers on the positioning probe. Based on the premise that the relative position between the surgical area and the oral reference plate is fixed, the relative positional relationship between the surgical area and the oral reference plate can be calculated by combining the reference plate markers on the oral reference plate.

[0100] Preferably, in step S7, the real-time three-dimensional coordinates P of the surgical area in the three-dimensional coordinate system of the navigator are... t =(X t ,Y t Z t ), where X t =X³ + ΔX,Y t =Y3+ΔY,Z t =Z3+ΔZ. After the oral reference plate is fixedly set in the patient's oral cavity, the relative position between the surgical area and the oral reference plate is fixed. Based on this premise, after obtaining the real-time three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator, the real-time three-dimensional coordinates of the surgical area in the three-dimensional coordinate system of the navigator can be further calculated.

[0101] The purpose of step S11 is to perform a sharpness test to verify whether the surgical camera can capture a clear image after focusing. Step S11 specifically includes the following steps:

[0102] S1101. Convert the real-time image from the surgical camera into a grayscale image. The basic logic of this technical solution for sharpness detection is: a sharp image has sharper edges and richer textures, and these areas will exhibit larger image gradient values. In step S1, a real-time image is extracted from the video data acquired by the surgical camera, and this real-time image is converted into a grayscale image.

[0103] S1102. Calculate the image gradient of pixel I(x,y) on the X-axis of the grayscale image, and obtain the gradient value G of the pixel in the X direction. X (x,y), where G X (x,y)=Sx*(x-1:x+1,y-1:y+1), where the convolution kernel is located in the X direction.

[0104] S1103. Calculate the image gradient of pixel I(x,y) on the Y-axis of the grayscale image, and obtain the gradient value G of the pixel in the Y direction. Y (x,y), where G Y (x,y)=Sy*(x-1:x+1,y-1:y+1), where the convolution kernel is located in the Y direction. In steps S1102 and S1103, convolution operations are performed on a certain neighborhood centered on pixel I(x,y) in the grayscale image using convolution kernels in the X and Y directions.

[0105] S1104. Calculate the gradient magnitude T(x,y) of pixel I(x,y) in a grayscale image, where T(x,y) = [G X (x,y)] 2 +[G Y (x,y)] 2 Generally, the gradient magnitude can be measured by calculating the sum of squares or the absolute value of the gradient values. In step S1104, the gradient magnitude is measured by the sum of squares.

[0106] S1105. Sharpness detection is performed by comparing the gradient magnitude T(x,y) of pixel I(x,y) in the grayscale image with a gradient threshold. If the gradient magnitude is greater than the gradient threshold, the pixel is considered a sharp pixel; otherwise, it is considered an invalid pixel. The gradient threshold needs to be determined experimentally based on the overall grayscale range and noise level of the image. It can usually be set to an empirical value or dynamically calculated based on the image grayscale. When the gradient magnitude is greater than the gradient threshold, the pixel is determined to be in a valid edge or texture region and is considered a sharp pixel.

[0107] Based on the above technical solution, image gradient analysis is performed on the X and Y axes of the grayscale image after grayscale processing. Based on the principle that the grayscale changes drastically at the edges of a clear image, the image is considered clear when the gradient magnitude is greater than the gradient threshold, and the pixel is considered invalid when the gradient magnitude is less than or equal to the gradient threshold. This method has the advantages of fast processing speed and accurate and reliable results.

[0108] like Figure 2 As shown, in order to solve the above problems, the present invention provides an automatic focusing system for a dental surgical camera. The system includes a mapping table acquisition module 1, a transformation matrix acquisition module 2, a first initial coordinate acquisition module 3, a second initial coordinate acquisition module 4, a relative position calculation module 5, a real-time coordinate acquisition module 6, a real-time position acquisition module for the surgical area 7, a real-time coordinate calculation module for the surgical area 8, a real-time working distance calculation module 9, a focus adjustment module 10, and a sharpness detection module 11.

[0109] The mapping table acquisition module 1 is used to acquire a focus mapping table, which includes the mapping relationship between the focal length and working distance of the surgical camera. The focal length is the distance between the optical center of the surgical camera and the focal point, and the working distance is the distance between the optical center of the surgical camera and the surgical area.

[0110] Transformation matrix acquisition module 2 is used to calibrate the surgical camera and the binocular navigator, obtaining the coordinate transformation matrix between the camera's 3D coordinate system and the navigator's 3D coordinate system. V H C ;

[0111] The first initial coordinate acquisition module 3 is used to control the binocular navigation device to acquire images of probe markers on the positioning probe when the positioning probe is in contact with the surgical area in the patient's oral cavity, and to obtain the initial three-dimensional coordinates P1 of the surgical area in the three-dimensional coordinate system of the navigation device through image analysis of the probe markers, where P1 = (X1, Y1, Z1).

[0112] The second initial coordinate acquisition module 4 is used to control the binocular navigator to acquire images of reference plate markers fixed on the oral reference plate at the patient's mouth. The initial three-dimensional coordinates P2 of the oral reference plate in the three-dimensional coordinate system of the navigator are obtained by analyzing the images of the reference plate markers, where P2 = (X2, Y2, Z2).

[0113] The relative position calculation module 5 is used to calculate the relative position relationship ΔP between the surgical area and the oral reference plate based on the initial three-dimensional coordinates of the surgical area in the three-dimensional coordinate system of the navigator and the initial three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator.

[0114] The real-time coordinate acquisition module 6 is used to control the binocular navigator to acquire real-time images of the reference board marker points on the mouth reference board. The real-time three-dimensional coordinates P3 of the mouth reference board in the three-dimensional coordinate system of the navigator are obtained by analyzing the real-time images of the reference board marker points, where P3 = (X3, Y3, Z3).

[0115] The real-time position acquisition module 7 for the surgical area is used to derive the real-time position of the surgical area based on the relative positional relationship between the surgical area and the oral reference plate and the real-time three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator, and to analyze and obtain the real-time three-dimensional coordinates P of the surgical area in the three-dimensional coordinate system of the navigator. t ;

[0116] The real-time coordinate calculation module 8 of the surgical area calculates the real-time three-dimensional coordinates P of the surgical area in the navigation system. t Combining the coordinate transformation matrix between the camera's 3D coordinate system and the navigator's 3D coordinate system V H C The real-time three-dimensional coordinates P of the surgical area in the camera's three-dimensional coordinate system were calculated. T , where P T =P t * V H C ;

[0117] Real-time working distance calculation module 9 is used to calculate the real-time three-dimensional coordinates P of the surgical area in the camera's three-dimensional coordinate system. T Calculate the real-time working distance of the surgical camera;

[0118] The focus adjustment module 10 is used to obtain the real-time focus of the surgical camera based on the real-time working distance of the surgical camera and the focus mapping table, and to adjust the focus of the surgical camera based on the real-time focus.

[0119] The sharpness detection module 11 is used to acquire real-time images from the surgical camera and perform sharpness detection based on the real-time images from the surgical camera; if the sharpness detection passes, intraoperative photography is performed; if the sharpness detection fails, refocusing is performed.

[0120] Preferably, the transformation matrix acquisition module includes:

[0121] The image acquisition unit is used to control the surgical camera and the binocular navigator to simultaneously acquire images from the camera calibration board, thereby obtaining images from the camera calibration board and the navigator calibration board.

[0122] The feature point matching unit is used to extract feature points from the camera calibration board image and the navigator calibration board image and perform feature point matching.

[0123] The coordinate data acquisition unit is used to acquire coordinate data information of multiple identical feature points based on the camera calibration board image and the navigator calibration board image: acquiring the calibration three-dimensional coordinate value P of the feature point in the calibration board's three-dimensional coordinate system. w The 3D coordinates P of the same feature point in the camera's 3D coordinate system are obtained based on the image of the camera calibration board and the distance between the camera calibration board and the surgical camera. v ; Obtain the three-dimensional coordinates P of the same feature point in the navigator's three-dimensional coordinate system based on the navigator calibration board image. c ;

[0124] The factor analysis unit is used to analyze and obtain the translation factor T1 and rotation factor R1 between the camera's 3D coordinate system and the calibration board's 3D coordinate system, and the translation factor T2 and rotation factor R2 between the navigator's 3D coordinate system and the calibration board's 3D coordinate system, based on the coordinate data of multiple identical feature points; where P v =R1·P w +T1, P c =R2·P w +T2;

[0125] The transformation matrix analysis unit is used to analyze and obtain the coordinate transformation matrix between the camera's 3D coordinate system and the binocular navigator's 3D coordinate system, based on the translation factors T1 and R1 between the camera's 3D coordinate system and the calibration board's 3D coordinate system, and the translation factors T2 and R2 between the navigator's 3D coordinate system and the calibration board's 3D coordinate system. V H C .

[0126] Preferably, in the relative position calculation module, the relative position relationship ΔP between the surgical area and the oral reference plate is calculated based on the initial three-dimensional coordinates of the surgical area in the three-dimensional coordinate system of the navigator and the initial three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator. The relative position relationship ΔP between the surgical area and the oral reference plate is ΔP = (ΔX, ΔY, ΔZ), where ΔX = X2 - X1, ΔY = Y2 - Y1, and ΔZ = Z2 - Z1.

[0127] Preferably, in the real-time position acquisition module of the surgical area, the real-time position of the surgical area is derived based on the relative positional relationship between the surgical area and the oral reference plate and the real-time three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator, and the real-time three-dimensional coordinates P of the surgical area in the three-dimensional coordinate system of the navigator are obtained by analysis. t Among them, the real-time three-dimensional coordinates P of the surgical area in the three-dimensional coordinate system of the navigation device t =(X t ,Y t Z t ), X t =X³ + ΔX,Y t=Y3+ΔY,Z t =Z3+ΔZ.

[0128] Preferably, the sharpness detection module includes:

[0129] The grayscale conversion unit is used to convert real-time images from the surgical camera into grayscale images;

[0130] The first gradient value calculation unit is used to calculate the image gradient of pixel I(x,y) in the grayscale image along the X-axis, and obtain the gradient value G of the pixel in the X direction. X (x,y), where G X (x,y)=Sx*(x-1:x+1,y-1:y+1), where the convolution kernel is located in the X direction.

[0131] The second gradient value calculation unit is used to calculate the image gradient of pixel I(x,y) in the grayscale image along the Y-axis, and obtain the gradient value G of the pixel in the Y direction. Y (x,y), where G Y (x,y)=Sy*(x-1:x+1,y-1:y+1), where the convolution kernel is located in the Y direction.

[0132] The gradient magnitude calculation unit is used to calculate the gradient magnitude T(x,y) of pixel I(x,y) in a grayscale image, where T(x,y) = [G X (x,y)] 2 +[G Y (x,y)] 2 ;

[0133] The sharpness detection unit performs sharpness detection by comparing the gradient magnitude T(x,y) of a pixel I(x,y) in the grayscale image with a gradient threshold. If the gradient magnitude is greater than the gradient threshold, the pixel is considered a sharp pixel; otherwise, it is considered an invalid pixel.

[0134] To address the aforementioned problems, the present invention provides a storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, execute the automatic focusing method for a dental surgical camera as described above.

[0135] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A method for automatic focusing of a dental surgery camera, characterized in that, The automatic focusing method of the dental surgery camera is implemented based on an automatic focusing device of the dental surgery camera, and the automatic focusing device of the dental surgery camera comprises: A surgical lamp comprising a support body and a plurality of lamp beads arranged on the support body; A surgical camera fixedly arranged on the support body; A binocular navigator fixedly arranged on the support body, the binocular navigator comprising a first camera and a second camera, and the first camera and the second camera are fixedly arranged on two sides of the surgical camera respectively; The method comprises the following steps: S1. Obtain a focusing mapping table, the focusing mapping table comprising a mapping relationship between a focal length of the surgical camera and a working distance, the focal length being a distance between an optical center of the surgical camera and a focal point, and the working distance being a distance between the optical center of the surgical camera and a surgical area; S2. Calibrate the surgical camera and the binocular navigator to obtain a coordinate conversion matrix between a camera three-dimensional coordinate system of the surgical camera and a navigator three-dimensional coordinate system of the binocular navigator V H C ; S3. When the positioning probe abuts against the surgical area in the oral cavity of the patient, control the binocular navigator to collect an image of a probe marker point on the positioning probe, and obtain an initial three-dimensional coordinate P1 of the surgical area in a three-dimensional coordinate system of the navigator through image analysis of the probe marker point, wherein P1=(X1, Y1, Z1); S4. Control the binocular navigator to collect an image of a reference plate marker point on a mouth reference plate fixed to the mouth of the patient, and obtain an initial three-dimensional coordinate P2 of the mouth reference plate in the three-dimensional coordinate system of the navigator through image analysis of the reference plate marker point, wherein P2=(X2, Y2, Z2); S5. Based on the initial three-dimensional coordinate of the surgical area in the three-dimensional coordinate system of the navigator and the initial three-dimensional coordinate of the mouth reference plate in the three-dimensional coordinate system of the navigator, calculate a relative position relationship ΔP of the surgical area and the mouth reference plate; S6. Control the binocular navigator to collect a real-time image of the reference plate marker point on the mouth reference plate, and obtain a real-time three-dimensional coordinate P3 of the mouth reference plate in the three-dimensional coordinate system of the navigator through real-time image analysis of the reference plate marker point, wherein P3=(X3, Y3, Z3); S7. According to the relative position relationship between the surgical area and the oral reference plate and the real-time three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator, the real-time position of the surgical area is derived, and the real-time three-dimensional coordinates P of the surgical area in the three-dimensional coordinate system of the navigator are analyzed t ; S8. Real-time three-dimensional coordinates P of the surgical area in the navigation system three-dimensional coordinate system t , combined with the coordinate conversion matrix between the camera three-dimensional coordinate system and the navigation system three-dimensional coordinate system V H C , the real-time three-dimensional coordinates P of the surgical area in the camera three-dimensional coordinate system are calculated T , wherein P T =P t * V H C ; S9. The real-time three-dimensional coordinates P of the surgical area under the three-dimensional coordinate system of the camera T Calculate the real-time working distance of the surgical camera; S10. Obtain a real-time working distance of the surgical camera, and obtain a real-time focal length of the surgical camera according to the focusing mapping table, and adjust the focal length of the surgical camera according to the real-time focal length; S11. Obtain a real-time image of the surgical camera, and perform clarity detection according to the real-time image of the surgical camera; when the clarity detection passes, perform intraoperative photography; when the clarity detection does not pass, return to step S1 to re-focus.

2. The automatic focusing method of a dental surgical camera according to claim 1, wherein, The step S2 specifically comprises the following steps: S201. Control the surgical camera and the binocular navigator to simultaneously collect images of the camera calibration board, and obtain a camera calibration board image and a navigator calibration board image; S202. Extract feature points on the camera calibration board image and the navigator calibration board image, and perform feature point matching; S203. Obtain coordinate data information of a plurality of same feature points according to the camera calibration board image and the navigator calibration board image: obtain the calibration three-dimensional coordinate value P of the feature point in the three-dimensional coordinate system of the calibration board w ; obtain the three-dimensional coordinate value P of the same feature point in the three-dimensional coordinate system of the camera according to the camera calibration board image and the distance between the camera calibration board and the surgical camera v ; obtain the three-dimensional coordinate value P of the same feature point in the three-dimensional coordinate system of the navigator according to the navigator calibration board image c ; S204. According to the coordinate data information of the plurality of same feature points, a translation factor T1 and a rotation factor R1 between the camera three-dimensional coordinate system and the calibration board three-dimensional coordinate system are analyzed to obtain, and a translation factor T2 and a rotation factor R2 between the navigator three-dimensional coordinate system and the calibration board three-dimensional coordinate system are analyzed to obtain; wherein, P v =R1·P w +T1, P c =R2·P w +T2; S205. According to the translation factor T1 and the rotation factor R1 between the camera three-dimensional coordinate system and the calibration board three-dimensional coordinate system, and the translation factor T2 and the rotation factor R2 between the navigator three-dimensional coordinate system and the calibration board three-dimensional coordinate system, the coordinate conversion matrix between the camera three-dimensional coordinate system of the surgical camera and the navigator three-dimensional coordinate system of the binocular navigator is analyzed V H C .

3. The automatic focusing method of a dental surgical camera according to claim 1, wherein, In step S5, the relative position relationship ΔP of the surgical area and the mouth reference plate is (ΔX, ΔY, ΔZ), wherein ΔX=X2-X1, ΔY=Y2-Y1, and ΔZ=Z2-Z1.

4. The automatic focusing method of a dental surgical camera according to claim 3, wherein, In step S7, the real-time three-dimensional coordinates P of the surgical area in the navigation three-dimensional coordinate system t =(X t ,Y t ,Z t ), wherein X t =X3+ΔX, Y t =Y3+ΔY, and Z t =Z3+ΔZ.

5. The automatic focusing method of a dental surgical camera according to claim 1, wherein, The step S11 specifically comprises the following steps: S1101. Convert the real-time image of the surgical camera into a gray-scale image; S1102. Calculate the image gradient of the pixel I(x, y) in the gray image on the X axis of the image, and obtain the gradient value G X (x, y) of the pixel on the X direction X (x, y) = Sx*(x-1:x+1, y-1:y+1), the convolution kernel in the X direction S1103. Calculate the image gradient of the pixel I(x, y) in the gray image on the Y axis of the image, and obtain the gradient value G Y (x, y) of the pixel on the Y direction Y (x, y) = Sy*(x-1:x+1, y-1:y+1), the convolution kernel S1104. Calculate the gradient amplitude T(x, y) of the pixel point I(x, y) in the gray image, wherein T(x, y) = [G X (x,y)] 2 + [G Y (x,y)] 2 (x, y)] S1105. The definition is detected by comparing the gradient amplitude T(x, y) of the pixel I(x, y) in the gray image with the gradient threshold value. When the gradient amplitude is greater than the gradient threshold value, the pixel is considered to be a clear pixel, otherwise the pixel is considered to be an invalid pixel.

6. A dental surgery camera autofocusing system, characterized by, The dental surgery camera automatic focusing system is implemented based on a dental surgery camera automatic focusing device. The surgical lamp comprises a support body and a plurality of lamp beads arranged on the support body; The surgical camera is fixedly arranged on the support body; The binocular navigator is fixedly arranged on the support body, and comprises a first camera and a second camera, which are respectively fixedly arranged on two sides of the surgical camera; The system comprises: A mapping table acquisition module is configured to acquire a focusing mapping table, wherein the focusing mapping table comprises a mapping relationship between a focal length of the surgical camera and a working distance, the focal length is a distance between an optical center of the surgical camera and a focal point, and the working distance is a distance between the optical center of the surgical camera and a surgical area; The conversion matrix obtaining module is configured to calibrate the surgical camera and the binocular navigator to obtain a coordinate conversion matrix between a camera three-dimensional coordinate system of the surgical camera and a navigator three-dimensional coordinate system of the binocular navigator V H C ; A first initial coordinate acquisition module is configured to control the binocular navigator to acquire an image of a probe marker point on a positioning probe when the positioning probe abuts against the surgical area in the oral cavity of the patient, and obtain an initial three-dimensional coordinate P1 of the surgical area in a three-dimensional coordinate system of the navigator through image analysis of the probe marker point, wherein P1=(X1, Y1, Z1). A second initial coordinate acquisition module is configured to control the binocular navigator to acquire an image of a reference plate marker point on a reference plate fixed to the oral part of the patient, and obtain an initial three-dimensional coordinate P2 of the reference plate in the three-dimensional coordinate system of the navigator through image analysis of the reference plate marker point, wherein P2=(X2, Y2, Z2). A relative position calculation module is configured to calculate a relative position relationship ΔP of the surgical area and the reference plate based on the initial three-dimensional coordinate of the surgical area in the three-dimensional coordinate system of the navigator and the initial three-dimensional coordinate of the reference plate in the three-dimensional coordinate system of the navigator. A real-time coordinate acquisition module is configured to control the binocular navigator to acquire a real-time image of the reference plate marker point on the reference plate, and obtain a real-time three-dimensional coordinate P3 of the reference plate in the three-dimensional coordinate system of the navigator through real-time image analysis of the reference plate marker point, wherein P3=(X3, Y3, Z3). The real-time position acquisition module is configured to derive the real-time position of the operation area according to the real-time three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator and the relative position relationship between the operation area and the oral reference plate, and analyze to obtain the real-time three-dimensional coordinates P of the operation area in the three-dimensional coordinate system of the navigator t ; The real-time coordinate calculation module calculates the real-time three-dimensional coordinate P of the operation area in the camera three-dimensional coordinate system according to the real-time three-dimensional coordinate P of the operation area in the navigator three-dimensional coordinate system and the coordinate conversion matrix H between the camera three-dimensional coordinate system and the navigator three-dimensional coordinate system. t V H C T T t V H C ;​​​​​ a real-time working distance calculation module, configured to calculate a real-time working distance of the surgical camera according to real-time three-dimensional coordinates P of the surgical area in the three-dimensional coordinate system of the camera T calculate a real-time working distance of the surgical camera; A focal length adjustment module is configured to acquire a real-time focal length of the surgical camera according to a real-time working distance of the surgical camera and the focusing mapping table, and adjust the focal length of the surgical camera according to the real-time focal length. A definition detection module is configured to acquire a real-time image of the surgical camera, and perform definition detection according to the real-time image of the surgical camera; when the definition detection is passed, intraoperative photography is performed; and when the definition detection is not passed, refocusing is performed.

7. The automatic focusing system for dental surgical camera according to claim 6, wherein, The conversion matrix acquisition module comprises: An image acquisition unit is configured to control the surgical camera and the binocular navigator to simultaneously acquire an image of a camera calibration board, and obtain a camera calibration board image and a navigator calibration board image. The feature point matching unit is configured to extract feature points on the camera calibration board image and the navigator calibration board image and perform feature point matching. The coordinate data acquisition unit is configured to acquire coordinate data information of a plurality of same feature points according to the camera calibration board image and the navigator calibration board image: acquire a calibration three-dimensional coordinate value P of the feature point in a three-dimensional coordinate system of the calibration board w ; acquire a three-dimensional coordinate value P of the same feature point in a three-dimensional coordinate system of the camera according to the camera calibration board image and the distance between the camera calibration board and the surgical camera v ; acquire a three-dimensional coordinate value P of the same feature point in a three-dimensional coordinate system of the navigator according to the navigator calibration board image c ; a factor analysis unit, configured to analyze translation factor T1 and rotation factor R1 between the camera three-dimensional coordinate system and the calibration board three-dimensional coordinate system according to coordinate data information of the plurality of same feature points, and analyze translation factor T2 and rotation factor R2 between the navigator three-dimensional coordinate system and the calibration board three-dimensional coordinate system; wherein, P v =R1·P w +T1, P c =R2·P w +T2; A conversion matrix analysis unit is configured to analyze a coordinate conversion matrix between a camera three-dimensional coordinate system of the surgical camera and a navigator three-dimensional coordinate system of the binocular navigator according to a translation factor T1 and a rotation factor R1 between the camera three-dimensional coordinate system and the calibration plate three-dimensional coordinate system, and a translation factor T2 and a rotation factor R2 between the navigator three-dimensional coordinate system and the calibration plate three-dimensional coordinate system V H C .

8. The automatic focusing system for dental surgical camera according to claim 6, wherein, In the relative position calculation module, based on the initial three-dimensional coordinates of the surgical area in the navigator three-dimensional coordinate system and the initial three-dimensional coordinates of the oral reference plate in the navigator three-dimensional coordinate system, the relative position relationship ΔP between the surgical area and the oral reference plate is calculated, wherein the relative position relationship ΔP between the surgical area and the oral reference plate is ΔP=(ΔX, ΔY, ΔZ), ΔX=X2-X1, ΔY=Y2-Y1, and ΔZ=Z2-Z1. In the real-time position acquisition module of the operation area, the real-time position of the operation area is derived according to the relative position relationship between the operation area and the oral reference plate and the real-time three-dimensional coordinates of the oral reference plate in the three-dimensional coordinate system of the navigator, and the real-time three-dimensional coordinates P of the operation area in the three-dimensional coordinate system of the navigator are obtained by analysis t , wherein the real-time three-dimensional coordinates P of the operation area in the three-dimensional coordinate system of the navigator t =(X t ,Y t ,Z t ), X t =X3+ΔX, Y t =Y3+ΔY, Z t =Z3+ΔZ.

9. The automatic focusing system for dental surgical camera according to claim 6, wherein, The definition detection module comprises: The gray scale conversion unit is configured to convert the real-time image of the surgical camera into a gray scale image. A first gradient value calculation unit is configured to calculate the image gradient of a pixel point I(x, y) in the gray-scale image in the X-axis direction of the image to obtain a gradient value G X (x, y) of the pixel point in the X direction X (x, y) = Sx*(x-1:x+1, y-1:y+1), wherein the convolution kernel A second gradient value calculation unit is configured to calculate the image gradient of the pixel point I(x, y) in the gray-scale image in the Y-axis direction of the image to obtain the gradient value G Y (x, y) of the pixel point in the Y direction Y (x, y) = Sy*(x-1:x+1, y-1:y+1), wherein the convolution kernel a gradient magnitude calculation unit configured to calculate a gradient magnitude T(x, y) of the pixel point I(x, y) in the gray-scale image, wherein T(x, y) = [G X (x,y)] 2 + [G Y (x,y)] 2 ​ The definition detection unit is configured to perform definition detection by comparing the gradient amplitude T(x, y) of the pixel I(x, y) in the gray scale image with a gradient threshold value, and when the gradient amplitude is greater than the gradient threshold value, the pixel is considered to be a clear pixel, otherwise, the pixel is considered to be an invalid pixel.

10. A storage medium, characterized by The storage medium stores a computer program, and the computer program comprises program instructions. When the program instructions are executed by the processor, the processor executes the dental surgery camera automatic focusing method in any one of claims 1-5.

Citation Information

Patent Citations

  • Robot visual servo operation method based on finite time control

    CN116872216A

  • Color image acquisition method, system and equipment, medium and intraoral scanning device

    CN117557485A