Iris focusing method, device, electronic device and storage medium for slit lamp device
By automatically controlling the main camera of the slit lamp device, the focus is adjusted using the spot reflective pixel coordinate difference value to adjust the focus, which solves the problems of high time consumption, susceptibility to environmental interference and high operation difficulty of manual focus, and achieves fast and stable iris focus.
Patent Information
- Application Number
- CN202411087817.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-09
AI Technical Summary
The iris focus method of existing slit lamp equipment is manual focus, which has problems such as high time consumption, easy to be disturbed by the environment, slow speed, and high operation difficulty.
By controlling the motor to drive the main camera movement based on the center position coordinates of the eye, obtain the coordinate difference of the spot reflection pixel in the first imaging and the second imaging, automatically adjust the focus position, and realize automatic focus of the main camera.
Increases focus speed, reduces operational difficulty and time cost, reduces the risk of image blur or out of focus due to environmental interference, and ensures that the best shooting time is not missed when quickly capturing images.
Smart Images

Figure CN118614863B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of iris focusing, and in particular, to an iris focusing method, device, electronic device and storage medium for a slit lamp device. Background Art
[0002] Currently, the iris focusing method of the slit lamp device is a manual focusing method, which has the following disadvantages:
[0003] 1. Time consumption: Manual focus requires doctors to spend extra time to adjust the focus distance, so when images need to be captured quickly, the best shooting opportunity may be missed.
[0004] 2. Interference in framing: The manual focus lens has a larger opening and is therefore easily disturbed by the surrounding environment. Factors such as hand shaking and patient movement may cause the image to be blurred or out of focus.
[0005] 3. Slow focusing speed: Compared with the autofocus system, manual focusing is slow, especially when the focus distance needs to be adjusted frequently, which may reduce inspection efficiency.
[0006] 4. High demand for personnel training: Manual focus operation requires high medical expertise and learning of corresponding focus standards. Training an operator who can skillfully focus requires a long labor and time cost. Summary of the invention
[0007] The purpose of the embodiments of the present application is to provide an iris focusing method, device, electronic device and storage medium for a slit lamp device, so as to realize automatic iris focusing and overcome the defects of the manual focusing method such as slow focusing speed, easy interference of framing and easy missing of the best shooting opportunity.
[0008] In a first aspect, the present invention provides an iris focusing method for a slit lamp device, the method comprising:
[0009] Based on the center position coordinates of the eye, the motor is controlled to drive the main camera to move to the center position coordinates of the eye;
[0010] Acquire a first image and a second image, wherein the first image and the second image both include a reflection of a light spot produced by the lamp bead on the eye;
[0011] Based on the difference between the pixel coordinates of the light spot reflection in the first imaging and the pixel coordinates of the light spot reflection in the second imaging, the motor is controlled to drive the main camera to move to a target focus position.
[0012] The method of the first aspect of the present application can control the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye, and then obtain the first image and the second image, wherein the first image and the second image both include the reflection of the light spot produced by the lamp bead on the eye, and can control the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the reflection of the light spot in the first image and the pixel coordinates of the reflection of the light spot in the second image, and finally complete the automatic focus of the main camera. Compared with the prior art, the present application does not require manual operation of the focusing process, and thus does not require the doctor to spend extra time to adjust the focus distance, and thus it is not easy to miss the best shooting time when it is necessary to capture the image quickly. At the same time, since there is no need for manual operation of the focusing process, the opening of the focus lens part can be smaller, so it is not easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus, while the manual focus lens part of the prior art has a larger opening, so it is easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus. On the other hand, the automatic focus of the present application can improve the focusing speed, while the manual focus of the prior art is slow, especially when the focus distance needs to be adjusted frequently, which may reduce the inspection efficiency. On the other hand, the present application can reduce the requirements for the operator's operating level, while the manual focus operation of the prior art requires high medical expertise and corresponding focus standard learning, and training an operator who can focus proficiently requires a long labor and time cost.
[0013] In an optional implementation, before controlling the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye, the method further includes:
[0014] Obtain user face imaging;
[0015] The user face imaging is processed based on a machine learning model to identify an eye portion in the user face imaging, and the center position coordinates of the eye are determined based on the eye portion.
[0016] This optional implementation acquires user facial imaging and then processes the user facial imaging based on a machine learning model to identify the eye portion in the user facial imaging and determine the center position coordinates of the eye based on the eye portion.
[0017] In an optional implementation, after acquiring the first image and the second image, and before determining the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, the method further includes:
[0018] Performing denoising on the first image and the second image based on a Gaussian blur algorithm and a Sobel blur algorithm;
[0019] Converting the first image after denoising and the second image after denoising into grayscale images, and converting the grayscale images into binary images;
[0020] Determine the light spot reflection in the binary image of the first imaging based on a path width search algorithm, and determine the pixel coordinates of the light spot reflection in the first imaging;
[0021] The light spot reflection in the binary image of the second imaging is determined based on the path width finding algorithm, and the pixel coordinates of the light spot reflection in the second imaging are determined.
[0022] This optional implementation can perform denoising on the first image and the second image based on a Gaussian blur algorithm and a Sobel blur algorithm, and then convert the denoised first image and the denoised second image into grayscale images, and convert the grayscale images into binary images, and then determine the light spot reflection in the binary image of the first image based on a path width finding algorithm, and determine the pixel coordinates of the light spot reflection in the first image; on the other hand, determine the light spot reflection in the binary image of the second image based on the path width finding algorithm, and determine the pixel coordinates of the light spot reflection in the second image.
[0023] In an optional implementation, determining the pixel coordinates of the light spot reflection in the first image includes:
[0024] The pixel coordinates of the light spot reflection in the first image are determined based on the triangulation method.
[0025] This optional implementation can determine the pixel coordinates of the light spot reflection in the first image based on the triangulation method.
[0026] In an optional embodiment, after controlling the motor to drive the main camera to move to a target focus position based on the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, the method further includes:
[0027] When the difference between the horizontal coordinate of the first pixel coordinate and the horizontal coordinate of the second pixel coordinate is 0, it is determined that the main camera has moved to the target focus position, and the target focus position is an optimal focus position.
[0028] This optional implementation can determine that the main camera has moved to the target focus position when the difference between the horizontal coordinate of the first pixel coordinate and the horizontal coordinate of the second pixel coordinate is 0, and the target focus position is the optimal focus position.
[0029] In an optional embodiment, controlling the motor to drive the main camera to move to a target focus position based on a difference between pixel coordinates of the light spot reflection in the first image and pixel coordinates of the light spot reflection in the second image includes:
[0030] Calculating the number of movement steps of the motor based on the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, wherein the ratio of the number of movement steps of the motor to the difference is 1000:1;
[0031] The motor is controlled based on the moving steps of the motor to drive the main camera to move to the target focus position.
[0032] In an optional implementation, after acquiring the user face image and before processing the user face image based on the machine learning model, the method further includes:
[0033] The image size of the user's face image is adjusted to 360*360.
[0034] This optional implementation can adjust the image size of the user's facial image to 360*360, thereby improving the recognition efficiency of the machine learning model.
[0035] In a second aspect, the present invention provides an iris focusing device for a slit lamp apparatus, the device comprising:
[0036] A control module, used for controlling the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye;
[0037] A first acquisition module, used to acquire a first image and a second image, wherein the first image and the second image both include a reflection of a light spot generated by the lamp bead on the eye;
[0038] The second control module is used to control the motor to drive the main camera to move to a target focus position based on the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image.
[0039] The device of the second aspect of the present application can control the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye, and then obtain the first image and the second image, wherein the first image and the second image both include the reflection of the light spot produced by the lamp bead on the eye, and can control the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the reflection of the light spot in the first image and the pixel coordinates of the reflection of the light spot in the second image, and finally complete the automatic focus of the main camera. Compared with the prior art, the present application does not require manual operation of the focusing process, and thus does not require the doctor to spend extra time to adjust the focus distance, and thus it is not easy to miss the best shooting time when it is necessary to capture the image quickly. At the same time, since there is no need for manual operation of the focusing process, the opening of the focus lens part can be smaller, so it is not easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus, while the opening of the manual focus lens part of the prior art is larger, so it is easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus. On the other hand, the automatic focus of the present application can improve the focusing speed, while the manual focus of the prior art is slow, especially when the focus distance needs to be adjusted frequently, which may reduce the inspection efficiency. On the other hand, the present application can reduce the requirements for the operator's operating level, while the manual focus operation of the prior art requires high medical expertise and corresponding focus standard learning, and training an operator who can focus proficiently requires a long labor and time cost.
[0040] In a third aspect, the present invention provides an electronic device, comprising:
[0041] Processor; and
[0042] A memory configured to store machine-readable instructions, which, when executed by the processor, perform the iris focusing method of the slit lamp device as described in any of the aforementioned embodiments.
[0043] The electronic device of the third aspect of the present application can control the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye by executing the iris focusing method of the slit lamp device, and then obtain the first image and the second image, wherein the first image and the second image both include the reflection of the light spot generated by the lamp bead on the eye, and can control the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the reflection of the light spot in the first image and the pixel coordinates of the reflection of the light spot in the second image, and finally complete the automatic focusing of the main camera. Compared with the prior art, the present application does not require manual operation of the focusing process, and thus does not require the doctor to spend extra time to adjust the focus distance, and thus it is not easy to miss the best shooting time when it is necessary to capture the image quickly. At the same time, since there is no need for manual operation of the focusing process, the opening of the focus lens part can be smaller, so it is not easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus, while the manual focus lens part of the prior art has a larger opening, so it is easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus. On the other hand, the automatic focus of the present application can improve the focusing speed, while the manual focus of the prior art is slow, especially when the focus distance needs to be adjusted frequently, which may reduce the inspection efficiency. On the other hand, the present application can reduce the requirements for the operator's operating level, while the manual focus operation of the prior art requires high medical expertise and corresponding focus standard learning, and training an operator who can focus proficiently requires a long labor and time cost.
[0044] In a fourth aspect, the present invention provides a storage medium storing a computer program, wherein the computer program is executed by a processor to implement an iris focusing method of a slit lamp device as described in any one of the aforementioned embodiments.
[0045] The storage medium of the fourth aspect of the present application can control the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye by executing the iris focusing method of the slit lamp device, and then obtain the first image and the second image, wherein the first image and the second image both include the reflection of the light spot generated by the lamp bead on the eye, and can control the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the reflection of the light spot in the first image and the pixel coordinates of the reflection of the light spot in the second image, and finally complete the automatic focusing of the main camera. Compared with the prior art, the present application does not require manual operation of the focusing process, and thus does not require the doctor to spend extra time to adjust the focus distance, and thus it is not easy to miss the best shooting time when it is necessary to capture the image quickly. At the same time, since there is no need for manual operation of the focusing process, the opening of the focus lens part can be smaller, so it is not easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus, while the manual focus lens part of the prior art has a larger opening, so it is easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus. On the other hand, the automatic focus of the present application can improve the focusing speed, while the manual focus of the prior art is slow, especially when the focus distance needs to be adjusted frequently, which may reduce the inspection efficiency. On the other hand, the present application can reduce the requirements for the operator's operating level, while the manual focus operation of the prior art requires high medical expertise and corresponding focus standard learning, and training an operator who can focus proficiently requires a long labor and time cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 It is a flow chart of an iris focusing method of a slit lamp device disclosed in an embodiment of the present application;
[0048] Figure 2 It is a structural schematic diagram of an iris focusing device of a slit lamp device disclosed in an embodiment of the present application;
[0049] Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0051] Embodiment 1
[0052] See also Figure 1 , Figure 1 is a flow chart of an iris focusing method of a slit lamp device disclosed in an embodiment of the present application, such as Figure 1 As shown, the method of the embodiment of the present application includes the following steps:
[0053] 101. Based on the center position coordinates of the eyes, control the motor to drive the main camera to move to the center position coordinates of the eyes;
[0054] 102. Acquire a first image and a second image, wherein both the first image and the second image include a reflection of a light spot generated by the lamp bead on the eye;
[0055] 103. Based on the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, control the motor to drive the main camera to move to the target focus position.
[0056] The method of the embodiment of the present application can control the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye, and then obtain the first image and the second image, wherein the first image and the second image both include the reflection of the light spot produced by the lamp bead on the eye, and can control the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the reflection of the light spot in the first image and the pixel coordinates of the reflection of the light spot in the second image, and finally complete the automatic focus of the main camera. Compared with the prior art, the present application does not require manual operation of the focusing process, and thus can eliminate the need for the doctor to spend extra time to adjust the focus distance, and thus it is not easy to miss the best shooting time when it is necessary to capture the image quickly. At the same time, since there is no need for manual operation of the focusing process, the opening of the focus lens part can be smaller, so it is not easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus, while the opening of the manual focus lens part of the prior art is larger, so it is easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus. On the other hand, the automatic focus of the present application can improve the focusing speed, while the manual focus of the prior art is slow, especially when the focus distance needs to be adjusted frequently, which may reduce the inspection efficiency. On the other hand, the present application can reduce the requirements for the operator's operating level, while the manual focus operation of the prior art requires high medical expertise and corresponding focus standard learning, and training an operator who can focus proficiently requires a long labor and time cost.
[0057] In the embodiment of the present application, steps 101-103 can be used as the iris focusing process for a single eye, and the iris focusing for the two eyes of the user can be completed based on the same steps. For example, firstly, steps 101-103 are performed to complete the focusing of the iris of the left eye of the user, and then steps 101-103 are performed to complete the focusing of the iris of the right eye of the user. Accordingly, when focusing on the iris of the left eye of the user, step 101 is to control the motor to drive the main camera to move to the center position coordinates of the left eye based on the center position coordinates of the left eye, and when focusing on the iris of the right eye of the user, step 101 is to control the motor to drive the main camera to move to the center position coordinates of the right eye based on the center position coordinates of the right eye.
[0058] In the embodiment of the present application, the center position of the eye refers to the center point of the eye. Further, in a preset reference coordinate system, the center position of the eye is represented by a coordinate to form the center position coordinate of the eye. Further, the center position coordinate of the eye refers to the position pointed to by the center position coordinate of the eye.
[0059] In an embodiment of the present application, the motor is a component of the slit lamp device, which is connected to the controller of the slit lamp device, so that it can receive a control signal from the controller. Further, the main camera is a component of the slit lamp device, which is connected to the motor, so that the rotation of the motor can drive the main camera to move. Further, the movement direction of the main camera to the center position coordinate of the eye can be along the lateral direction.
[0060] In the embodiment of the present application, the first image and the second image can be obtained by the left and right auxiliary cameras, wherein the left auxiliary camera can obtain the first image and the right auxiliary camera can obtain the second image. Furthermore, when the low-scattering lamp beads located next to the objective lens of the slit lamp device are projected onto the eyes, a light spot reflection can be formed and captured by the left and right auxiliary cameras.
[0061] In an optional implementation manner, before the step of controlling the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye, the method of the embodiment of the present application further includes the following steps:
[0062] Obtain user face imaging;
[0063] The user's facial imaging is processed based on a machine learning model to identify the eye portion in the user's facial imaging, and the center position coordinates of the eye are determined based on the eye portion.
[0064] This optional implementation acquires user facial imaging and then processes the user facial imaging based on a machine learning model to identify the eye portion in the user facial imaging and determine the center position coordinates of the eye based on the eye portion.
[0065] For the above optional implementation, the machine learning model can be a Haar cascade model. Accordingly, the specific process of the Haar cascade model identifying the eye part in the user's facial imaging can be: first identify the facial part in the user's facial imaging, and then identify the eye part in the user's facial imaging based on the facial part.
[0066] In an optional implementation, after acquiring the first image and the second image, and before determining the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, the method of the embodiment of the present application further includes the following steps:
[0067] De-noising the first image and the second image based on Gaussian blur algorithm and Sobel blur algorithm;
[0068] Converting the first image after denoising and the second image after denoising into a grayscale image, and converting the grayscale image into a binary image;
[0069] Determine the reflection of the light spot in the binary image of the first image based on the path width search algorithm, and determine the pixel coordinates of the reflection of the light spot in the first image;
[0070] Based on the path width search algorithm, the reflection of the light spot in the binary image of the second image is determined, and the pixel coordinates of the reflection of the light spot in the second image are determined.
[0071] This optional implementation can perform denoising on the first image and the second image based on the Gaussian blur algorithm and the Sobel blur algorithm, and then convert the denoised first image and the denoised second image into grayscale images, and convert the grayscale images into binary images, and then determine the reflection of the light spot in the binary image of the first image based on the path width search algorithm, and determine the pixel coordinates of the reflection of the light spot in the first image; on the other hand, determine the reflection of the light spot in the binary image of the second image based on the path width search algorithm, and determine the pixel coordinates of the reflection of the light spot in the second image.
[0072] Regarding the above optional implementation, please refer to the prior art for how the Gaussian blur algorithm and the Sobel blur algorithm perform denoising on the first image and the second image, and the present application embodiment will not elaborate on this. This optional implementation emphasizes avoiding the influence of noise on the recognition of the light spot reflection of the picture.
[0073] In an optional embodiment, the step of determining the pixel coordinates of the light spot reflection in the first image comprises the following steps:
[0074] The pixel coordinates of the light spot reflection in the first imaging are determined based on the triangulation method.
[0075] This optional implementation can determine the pixel coordinates of the light spot reflection in the first imaging based on the triangulation method.
[0076] For the above optional implementation manner, please refer to the prior art regarding the triangulation ranging method, which will not be elaborated in the embodiments of the present application.
[0077] In an optional implementation, after the step of controlling the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, the method of the embodiment of the present application further includes the following steps:
[0078] When the difference between the horizontal coordinate of the first pixel coordinate and the horizontal coordinate of the second pixel coordinate is 0, it is determined that the main camera has moved to the target focus position, and the target focus position is the optimal focus position.
[0079] This optional implementation can determine that the main camera has moved to the target focus position when the difference between the horizontal coordinate of the first pixel coordinate and the horizontal coordinate of the second pixel coordinate is 0, and the target focus position is the optimal focus position.
[0080] In an optional embodiment, the step of controlling the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image includes the following sub-steps:
[0081] Calculate the number of movement steps of the motor based on the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, wherein the ratio of the number of movement steps of the motor to the difference is 1000:1;
[0082] The motor is controlled based on the number of movement steps of the motor to drive the main camera to move to the target focus position.
[0083] In an optional implementation manner, after the step of acquiring the user's facial image and before processing the user's facial image based on the machine learning model, the method of the embodiment of the present application further includes the following steps:
[0084] Adjust the image size of the user's face image to 360*360.
[0085] This optional implementation can adjust the image size of the user's facial image to 360*360, thereby improving the recognition efficiency of the machine learning model.
[0086] For the above optional implementation, you can also set the parameters of the machine learning model, for example, scaleFactor=0.95, minSize= 25*25.
[0087] Embodiment 2
[0088] See also Figure 2 , Figure 2 is a schematic diagram of the structure of an iris focusing device of a slit lamp device disclosed in an embodiment of the present application, such as Figure 2 As shown, the device of the embodiment of the present application includes the following functional modules:
[0089] The first control module 201 is used to control the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye;
[0090] A first acquisition module 202 is used to acquire a first image and a second image, wherein the first image and the second image both include a reflection of a light spot produced by the lamp bead on the eye;
[0091] The second control module 203 is used to control the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image.
[0092] The device of the embodiment of the present application can control the motor to drive the main camera to move to the coordinates of the center position of the eye based on the coordinates of the center position of the eye, and then obtain the first image and the second image, wherein the first image and the second image both include the reflection of the light spot produced by the lamp bead on the eye, and can control the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the reflection of the light spot in the first image and the pixel coordinates of the reflection of the light spot in the second image, and finally complete the automatic focus of the main camera. Compared with the prior art, the present application does not require manual operation of the focusing process, and thus does not require the doctor to spend extra time to adjust the focus distance, and thus it is not easy to miss the best shooting time when it is necessary to capture the image quickly. At the same time, since there is no need for manual operation of the focusing process, the opening of the focus lens part can be smaller, so it is not easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus, while the opening of the manual focus lens part of the prior art is larger, so it is easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus. On the other hand, the automatic focus of the present application can improve the focusing speed, while the manual focus of the prior art is slow, especially when the focus distance needs to be adjusted frequently, which may reduce the inspection efficiency. On the other hand, the present application can reduce the requirements for the operator's operating level, while the manual focus operation of the prior art requires high medical expertise and corresponding focus standard learning, and training an operator who can focus proficiently requires a long labor and time cost.
[0093] Embodiment 3
[0094] See also Figure 3 , Figure 3 is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application, such as Figure 3As shown, the electronic device of the embodiment of the present application includes:
[0095] Processor 301; and
[0096] The memory 302 is configured to store machine-readable instructions, which, when executed by the processor 301, execute the iris focusing method of the slit lamp device as described in any of the aforementioned embodiments.
[0097] The electronic device of the embodiment of the present application can control the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye by executing the iris focusing method of the slit lamp device, and then obtain the first image and the second image, wherein the first image and the second image both include the reflection of the light spot generated by the lamp bead on the eye, and can control the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the reflection of the light spot in the first image and the pixel coordinates of the reflection of the light spot in the second image, and finally complete the automatic focusing of the main camera. Compared with the prior art, the present application does not require manual operation of the focusing process, and thus does not require the doctor to spend extra time to adjust the focus distance, and thus it is not easy to miss the best shooting time when it is necessary to capture the image quickly. At the same time, since there is no need for manual operation of the focusing process, the opening of the focus lens part can be smaller, so it is not easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus, while the opening of the manual focus lens part of the prior art is larger, so it is easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus. On the other hand, the automatic focus of the present application can improve the focusing speed, while the manual focus of the prior art is slow, especially when the focus distance needs to be adjusted frequently, which may reduce the inspection efficiency. On the other hand, the present application can reduce the requirements for the operator's operating level, while the manual focus operation of the prior art requires high medical expertise and corresponding focus standard learning, and training an operator who can focus proficiently requires a long labor and time cost.
[0098] Embodiment 4
[0099] An embodiment of the present application provides a storage medium storing a computer program, and the computer program is executed by a processor as the iris focusing method of a slit lamp device according to any of the aforementioned embodiments.
[0100] The storage medium of the embodiment of the present application can control the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye by executing the iris focusing method of the slit lamp device, and then obtain the first image and the second image, wherein the first image and the second image both include the reflection of the light spot generated by the lamp bead on the eye, and can control the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the reflection of the light spot in the first image and the pixel coordinates of the reflection of the light spot in the second image, and finally complete the automatic focusing of the main camera. Compared with the prior art, the present application does not require manual operation of the focusing process, and thus does not require the doctor to spend extra time to adjust the focus distance, and thus it is not easy to miss the best shooting time when it is necessary to capture the image quickly. At the same time, since there is no need for manual operation of the focusing process, the opening of the focus lens part can be smaller, so it is not easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus, while the opening of the manual focus lens part of the prior art is larger, so it is easy to be disturbed by the surrounding environment, such as hand shaking, patient movement and other factors may cause the image to be blurred or out of focus. On the other hand, the automatic focus of the present application can improve the focusing speed, while the manual focus of the prior art is slow, especially when the focus distance needs to be adjusted frequently, which may reduce the inspection efficiency. On the other hand, the present application can reduce the requirements for the operator's operating level, while the manual focus operation of the prior art requires high medical expertise and corresponding focus standard learning, and training an operator who can focus proficiently requires a long labor and time cost.
[0101] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0102] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0103] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0104] It should be noted that if the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0105] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0106] The above are only embodiments of the present application and are not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.
Claims
1. An iris focusing method for a slit lamp device, characterized in that: The method comprises: Based on the center position coordinates of the eye, the motor is controlled to drive the main camera to move to the center position coordinates of the eye; Acquire a first image and a second image, wherein the first image and the second image both include a reflection of a light spot produced by the lamp bead on the eye; Based on the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, controlling the motor to drive the main camera to move to a target focus position; Furthermore, after acquiring the first image and the second image, and before calculating the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, the method further includes: Performing denoising on the first image and the second image based on a Gaussian blur algorithm and a Sobel blur algorithm; Converting the first image after denoising and the second image after denoising into grayscale images, and converting the grayscale images into binary images; Determine the light spot reflection in the binary image of the first imaging based on a path width search algorithm, and determine the pixel coordinates of the light spot reflection in the first imaging; The light spot reflection in the binary image of the second imaging is determined based on the path width finding algorithm, and the pixel coordinates of the light spot reflection in the second imaging are determined.
2. The method according to claim 1, characterized in that Before controlling the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye, the method further includes: Obtain user face imaging; The user face imaging is processed based on a machine learning model to identify an eye portion in the user face imaging, and the center position coordinates of the eye are determined based on the eye portion.
3. The method according to claim 1, characterized in that The determining the pixel coordinates of the light spot reflection in the first image includes: Based on determining the pixel coordinates of the light spot reflection in the first imaging.
4. The method according to claim 1, characterized in that After controlling the motor to drive the main camera to move to the target focus position based on the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, the method further includes: When the difference between the horizontal coordinate of the first pixel coordinate and the horizontal coordinate of the second pixel coordinate is 0, it is determined that the main camera has moved to the target focus position, and the target focus position is an optimal focus position.
5. The method according to claim 4, characterized in that The controlling the motor to drive the main camera to move to a target focus position based on a difference between pixel coordinates of the light spot reflection in the first image and pixel coordinates of the light spot reflection in the second image includes: Calculating the number of movement steps of the motor based on the difference between the pixel coordinates of the light spot reflection in the first imaging and the pixel coordinates of the light spot reflection in the second imaging, wherein the ratio of the number of movement steps of the motor to the difference is 1000:1; The motor is controlled based on the moving steps of the motor to drive the main camera to move to the target focus position.
6. The method according to claim 2, characterized in that After acquiring the user face image and before processing the user face image based on the machine learning model, the method further includes: The image size of the user's face image is adjusted to 360*360.
7. An iris focusing device for a slit lamp device, characterized in that: The device comprises: A control module, used for controlling the motor to drive the main camera to move to the center position coordinates of the eye based on the center position coordinates of the eye; A first acquisition module, used to acquire a first image and a second image, wherein the first image and the second image both include a reflection of a light spot generated by the lamp bead on the eye; A second control module, configured to control the motor to drive the main camera to move to a target focus position based on a difference between pixel coordinates of the light spot reflection in the first image and pixel coordinates of the light spot reflection in the second image; Furthermore, after acquiring the first image and the second image, and before calculating the difference between the pixel coordinates of the light spot reflection in the first image and the pixel coordinates of the light spot reflection in the second image, the device is further used for: Performing denoising on the first image and the second image based on a Gaussian blur algorithm and a Sobel blur algorithm; Converting the first image after denoising and the second image after denoising into grayscale images, and converting the grayscale images into binary images; Determine the light spot reflection in the binary image of the first imaging based on a path width search algorithm, and determine the pixel coordinates of the light spot reflection in the first imaging; The light spot reflection in the binary image of the second imaging is determined based on the path width finding algorithm, and the pixel coordinates of the light spot reflection in the second imaging are determined.
8. An electronic device, characterized in that: include: processor; as well as A memory configured to store machine-readable instructions, which, when executed by the processor, execute the iris focusing method of the slit lamp device according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a computer program, and the computer program is executed by a processor to implement the iris focusing method of the slit lamp device according to any one of claims 1 to 6.
