Full-automatic control method and device of slit lamp microscope, electronic equipment and storage medium
The fully automated control method of slit-lamp microscope enables automatic focusing and imaging of the iris, eyelashes, red eye, and cornea, solving the problem of reliance on manual operation in traditional slit-lamp microscopes, improving examination accuracy, and reducing dependence on doctors.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WANLINGBANGQIAO MEDICAL EQUIP (GUANGZHOU) CO LTD
- Filing Date
- 2025-09-11
- Publication Date
- 2026-07-21
AI Technical Summary
Traditional slit-lamp microscopy examinations rely on manual operation, making it difficult to achieve high-precision ophthalmic examinations in areas with scarce medical resources.
The fully automated control method of slit-lamp microscope is adopted. The main camera automatically focuses and captures images of the iris, eyelashes, red eye, and cornea. Image processing technology is used to determine the focus position, realizing automatic focusing and capturing of the iris, eyelashes or red eye, and cornea.
It has enabled fully automated operation of slit-lamp microscopes, improving examination accuracy and reducing reliance on doctors, especially in areas with scarce medical resources.
Smart Images

Figure CN121015126B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of slit-lamp microscope technology, and more specifically, to a fully automatic control method, apparatus, electronic device, and storage medium for a slit-lamp microscope. Background Technology
[0002] With economic development and social progress, convenient and intelligent healthcare has become a social consensus. Various medical devices are increasingly developing towards smaller, more convenient, more intelligent, and more multifunctional designs. The slit-lamp microscope, as one of the most traditional and important ophthalmic medical devices, is no exception.
[0003] A typical slit-lamp microscope consists of a simple optical structure and hardware, and the examination process is performed manually by a doctor with professional skills and experience. Summary of the Invention
[0004] The purpose of this application is to provide a fully automated control method, device, electronic equipment, and storage medium for a slit-lamp microscope. This fully automated control method, device, electronic equipment, and storage medium for a slit-lamp microscope can realize fully automated operation of the slit lamp, avoid reliance on manual labor, and improve operational accuracy. Especially in areas with scarce medical resources, it can reduce reliance on doctors.
[0005] In a first aspect, the present invention provides a fully automated control method for a slit-lamp microscope, the method comprising:
[0006] The main camera of the slit-lamp microscope is moved to the iris focal position to capture an image of the iris;
[0007] Based on the real-time images captured by the main camera, determine the eyelash focus position or the red eye focus position, and control the main camera to move to the eyelash focus position or the red eye focus position to capture the eyelashes or the red eye.
[0008] The main camera acquires an eye image including the slit light blade, and the coordinates of the lower half of the light blade are determined based on the eye image.
[0009] The corneal focal position is determined based on the coordinates of the lower half of the laser blade, and the main camera is controlled to move to the corneal focal position to capture the cornea.
[0010] The method of the first aspect of this application can achieve automatic focusing and shooting of the iris, eyelashes or red eye, and cornea, thereby enabling fully automatic operation of the slit lamp, avoiding reliance on manual labor and improving operational accuracy. Especially in areas with scarce medical resources, it can reduce reliance on doctors.
[0011] In an optional implementation, determining the eyelash focus position based on the real-time image from the main camera and controlling the main camera to move to the eyelash focus position includes:
[0012] The first region is masked based on the first mask and the second region is extracted, wherein the first region is the region in the real-time image whose color is not within the range of black and gray, and the second region is the unmasked region in the real-time image;
[0013] A second mask is determined based on the second region, and the second mask is used to cover the real-time image to obtain the first target image, wherein the first target image is an image that only includes the eyelashes;
[0014] Gradient calculation is performed on the first target image to determine the eyelash focal position, wherein the eyelash focal position is the position with the largest eyelash gradient difference.
[0015] This optional implementation can cover a first region and extract a second region based on a first mask. The first region is the area in the real-time image whose color is not within the range of black and gray, and the second region is the uncovered area in the real-time image. Then, a second mask can be determined based on the second region, and the second mask can be used to cover the real-time image to obtain the first target image. The first target image is an image that only includes the eyelashes. Gradient calculation can be performed on the first target image to determine the eyelash focal position. The eyelash focal position is the position with the largest gradient difference in the eyelashes. Finally, the accuracy of the eyelash focal position is improved based on gradient calculation.
[0016] In an optional implementation, determining the second mask based on the second region includes:
[0017] The second region is binarized and line detection is performed to obtain a binary line map;
[0018] The second mask is determined based on the binary graph of the line.
[0019] This optional implementation can perform binarization and line detection on the second region to obtain a line binary map, and then determine a second mask based on the line binary map. Furthermore, it can use binarization and line detection to further simplify image information, highlight the eyelash image part, and locate the region with eyelash image information, so that the second mask determined based on this can more accurately locate the eyelash part in the original image.
[0020] In an optional implementation, determining the red-eye focus position based on the real-time image from the main camera and controlling the main camera to move to the red-eye focus position includes:
[0021] A second target image is determined based on the real-time image, wherein the second target image is an image that only includes red eyes;
[0022] The number of red-eyed pixels in the second target image is counted, and the position with the most red-eyed pixels in the second target image is determined as the red-eyed focal point position based on the count results.
[0023] This optional implementation can determine a second target image based on the real-time image, wherein the second target image is an image that only includes red eyes. Then, it can count the number of red eye pixels in the second target image, and determine the position with the most red eye pixels in the second target image as the red eye focus position based on the count of red eye pixels, thereby enabling more accurate determination of the red eye focus position using the number of red eye pixels.
[0024] In an optional implementation, determining the second target image based on the real-time image includes:
[0025] A third mask is determined, and a third region is covered based on the determined third mask to obtain a first intermediate processed image, wherein the third region is the region in the real-time image whose color is not within the range of skin color.
[0026] The iris region and the fourth mask in the first intermediate image are determined, and the iris region is covered based on the fourth mask to obtain the second intermediate image, which is an image that only includes the red and white parts of the eye.
[0027] A fifth mask is determined, and a fourth region is masked based on the fifth mask to obtain the second target image, wherein the fourth region is the area in the second intermediate image whose color is not within the red range.
[0028] This optional implementation can determine a third mask and cover a third region based on the determined third mask to obtain a first intermediate image, wherein the third region is the area in the real-time image whose color is not within the skin color range. Then, it can determine the iris region and a fourth mask in the first intermediate image and cover the iris region based on the fourth mask to obtain a second intermediate image, which is an image containing only red and white irises. Then, it can determine a fifth mask and cover a fourth region based on the fifth mask to obtain a second target image, wherein the fourth region is the area in the second intermediate image whose color is not within the red range. Thus, it can first mask the background image information based on the skin color range, then mask the iris region, thereby obtaining an image containing only red and white irises, and finally, by masking the white-colored area, obtain an image containing only red irises.
[0029] In an optional implementation, before determining the third mask and covering the third region based on the determined third mask, the method further includes:
[0030] The color space of the real-time image is converted from the RGB color space to the HSV color space.
[0031] This optional implementation can convert the color space of the real-time image from RGB to HSV color space, thereby decoupling the illumination information and facilitating the selection of specific image information based on color.
[0032] In an optional implementation, the method further includes:
[0033] The first intermediate image is subjected to binarization and Gaussian denoising.
[0034] The iris region in the first intermediate image is determined based on the Hough circle recognition algorithm.
[0035] This optional implementation performs binarization and Gaussian denoising on the first intermediate image, thereby enabling the determination of the iris region in the first intermediate image based on the Hough circle recognition algorithm.
[0036] In an optional implementation, determining the position coordinates of the lower half of the laser scalpel based on the eye image includes:
[0037] The eye image is processed based on an object detection model, so that the object detection model can extract multi-scale image features of the eye image;
[0038] The target detection model is used to fuse multi-scale image features of the eye image to obtain a feature fusion result, and the coordinates of the lower half of the light knife are determined based on the feature fusion result.
[0039] This optional implementation can extract multi-scale image features of the eye image based on the target detection model, and then fuse the multi-scale image features of the eye image based on the target detection model to obtain a feature fusion result, and automatically determine the position coordinates of the lower half of the light knife based on the feature fusion result.
[0040] In an optional implementation, determining the corneal focal position based on the coordinates of the lower half of the laser scalpel includes:
[0041] Based on the position coordinates of the lower half of the light blade, the eye image is processed to obtain an ROI image; the ROI image is then converted into a grayscale image.
[0042] The grayscale image is processed by Gaussian denoising and adaptive binarization to obtain a first binary image;
[0043] The first binary image is subjected to three operations: opening, expanding, and opening again.
[0044] Determine the outline in the first binary image whose length is equal to the length of the ROI image and whose width is less than 0.6 times the width of the ROI image, and determine the second binary image based on the outline;
[0045] The second binary image is processed based on morphological dilation and closing operations to obtain a full-shaped laser blade binary image.
[0046] The sixth mask is determined based on the full-shaped light blade binary image, and the sixth mask and the ROI image are ANDed to obtain the fifth target image, wherein the fifth target image is an RGB image containing only the light blade;
[0047] Edge extraction is performed on the fifth target image, and the pixel values of the light blade edge are counted and the maximum width of the light blade is determined based on the extraction results;
[0048] The corneal focal position is determined in the fifth target image based on the edge pixel value of the laser blade and the maximum width of the laser blade.
[0049] This optional implementation can perform ROI processing on the eye image based on the position coordinates of the lower half of the light blade to obtain an ROI image; convert the ROI image into a grayscale image, and then process the grayscale image based on Gaussian denoising and adaptive binarization to obtain a first binary image; then perform three operations—opening, dilation, and opening—on the first binary image to determine a contour in the first binary image whose length is equal to the length of the ROI image and whose width is less than 0.6 times the width of the ROI image; and determine a second binary image based on the contour, thereby enabling morphological... The second binary image is processed by dilation and closing operations to obtain a full-size laser scalpel binary image. A sixth mask can then be determined based on this full-size laser scalpel binary image. The sixth mask and the ROI image are then ANDed to obtain a fifth target image, which is an RGB image containing only the laser scalpel. Edge extraction can then be performed on the fifth target image, and the laser scalpel edge pixel values and maximum laser scalpel width can be determined based on the extraction results. Therefore, the corneal focal position can be determined in the fifth target image based on the laser scalpel edge pixel values and the maximum laser scalpel width.
[0050] In an optional implementation, determining the corneal focal position in the fifth target image based on the edge pixel values of the scalpel and the maximum width of the scalpel includes:
[0051] The location in the fifth target image that meets the preset conditions is determined as the corneal focal position, wherein the preset conditions are that the edge pixel value of the light blade is greater than 120 and the maximum width of the light blade is less than 50.
[0052] This optional implementation can determine the location in the sixth target image that meets the preset conditions as the corneal focal position. The condition that the edge pixel value of the light blade is greater than 120 and the maximum width of the light blade is less than 50 can improve the positioning accuracy of the corneal focal position.
[0053] In a second aspect, the present invention provides a control device for a slit-lamp microscope, the device comprising:
[0054] The iris autofocus imaging module is used to control the main camera of the slit-lamp microscope to move to the iris focal position in order to capture an image of the iris.
[0055] The eyelash and red eye autofocus shooting module is used to determine the eyelash focus position or the red eye focus position based on the real-time image captured by the main camera, and control the main camera to move to the eyelash focus position or the red eye focus position to capture the eyelash or the red eye.
[0056] The light blade determination module is used to acquire an eye image including a slit light blade based on the main camera, and to determine the light blade based on the eye image.
[0057] The corneal autofocus determination module is used to determine the corneal focal position based on the position coordinates of the lower half of the light knife, and control the main camera to move to the corneal focal position to capture the cornea.
[0058] The device of the second aspect of this application, by implementing a fully automatic control method for a slit-lamp microscope, can achieve automatic focusing and imaging of the iris, eyelashes or red eye, and cornea, thereby enabling fully automatic operation of the slit lamp, avoiding reliance on manual labor and improving operational accuracy. Especially in areas with scarce medical resources, it can reduce reliance on doctors.
[0059] Thirdly, the present invention provides an electronic device, comprising:
[0060] Processor; and
[0061] The memory is configured to store machine-readable instructions that, when executed by the processor, perform a fully automated control method for a slit-lamp microscope as described in any of the foregoing embodiments.
[0062] The electronic device of the third aspect of this application, by implementing a fully automatic control method for a slit-lamp microscope, can achieve automatic focusing and imaging of the iris, eyelashes or red eye, and cornea, thereby enabling fully automatic operation of the slit lamp, avoiding reliance on manual labor and improving operational accuracy. Especially in areas with scarce medical resources, it can reduce dependence on doctors.
[0063] Fourthly, the present invention provides a storage medium storing a computer program, the computer program being executed by a processor using the fully automatic control method for a slit-lamp microscope as described in any of the foregoing embodiments.
[0064] The storage medium of the fourth aspect of this application, by implementing a fully automated control method for a slit-lamp microscope, can achieve automatic focusing and imaging of the iris, eyelashes or red eye, and cornea, thereby enabling fully automated operation of the slit lamp, avoiding reliance on manual labor and improving operational accuracy. Especially in areas with scarce medical resources, it can reduce reliance on doctors.
[0065] Other features and advantages of this application will be described in detail in the following detailed description section. Attached Figure Description
[0066] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0067] Figure 1 This is a schematic diagram of the structure of a slit-lamp microscope provided in an embodiment of this application;
[0068] Figure 2 This is a schematic diagram of another slit-lamp microscope provided in an embodiment of this application;
[0069] Figure 3 This is a flowchart illustrating a fully automated control method for a slit-lamp microscope provided in an embodiment of this application.
[0070] Figure 4 This is a schematic diagram of the structure of a control device for a slit-lamp microscope disclosed in an embodiment of this application;
[0071] Figure 5 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application.
[0072] Icons: 1. Motor; 2. Headrest; 3. Light source swing arm; 4. Integrated image acquisition and imaging system arm; 5. Status decorative light; 6. Upper moving platform; 7. Lower base; 8. Touch screen display; 9. HDMI projection port; 10. Power and USB expansion port; 11. Eye-finding camera; 12. Auxiliary focusing optical path system; 13. Focusing auxiliary light; 14. Slit light emitting lens group; 15. Detailed Implementation
[0073] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0074] With economic development and social progress, convenient and intelligent healthcare has become a social consensus. Various medical devices are increasingly developing towards smaller, more convenient, more intelligent, and more multifunctional designs. The slit-lamp microscope, as one of the most traditional and important ophthalmic medical devices, is no exception.
[0075] A typical slit-lamp microscope consists of a simple optical structure and hardware, and the examination process is performed manually by a skilled and experienced physician. However, in the growing optometry industry, such facilities are becoming increasingly scarce, as most doctors cannot be stationed at optometry clinics for extended periods, and basic eye examinations are often unavailable in remote areas due to a lack of medical resources.
[0076] To address the aforementioned deficiencies, this application provides a fully automated control method, apparatus, electronic device, and storage medium for a slit-lamp microscope. This method enables automatic focusing and imaging of the iris, eyelashes or red eye, and cornea, thereby achieving fully automated operation of the slit lamp. This avoids reliance on manual labor and improves operational accuracy, especially in areas with scarce medical resources, reducing dependence on doctors.
[0077] Furthermore, to facilitate understanding of the embodiments of this application, the structure and usage of the slit-lamp microscope are described. Please refer to [link to relevant documentation]. Figure 1 , Figure 2 , Figure 1 This is a schematic diagram of the structure of a slit-lamp microscope provided in an embodiment of this application. Figure 2 This is a schematic diagram of another slit-lamp microscope provided in an embodiment of this application. (See attached diagram.) Figure 1 and Figure 2 As shown, the slit-lamp microscope consists of a motor 1, a headrest 2, a light source swing arm 3, an integrated image acquisition and imaging system arm 4, a status decorative light 5, an upper moving platform 6, a lower base 7, a touch screen display 8, an HDMI projection port 9, a power switch 10, a power and USB expansion port 11, an eye-finding camera 12, an auxiliary focusing optical path system 13, a focusing auxiliary light 14, a slit light emitting lens group 15, and an electrically controlled lower chin rest.
[0078] In use, the electronically controlled chin rest automatically aligns with the user's chin to support it. Furthermore, motor 1 drives the movement of the light source arm 3 and the moving platform 6 on the arm of the integrated image acquisition and imaging system, enabling focusing as needed.
[0079] Furthermore, the status decorative light 5 is used to display the status, the slit light emitting lens group 15 is used to generate a light knife, the auxiliary focusing optical path system 13 and the focusing auxiliary light 14 are used to assist focusing, and the eye-finding camera 12 includes the main camera.
[0080] Furthermore, the touch display 8 can respond to the user's selected eye detection items.
[0081] Furthermore, HDMI projection port 9 can project the real-time image generated during detection onto the screen.
[0082] Furthermore, the switch button 10 is used to turn the device on and off, while the power and USB expansion port 11 is used to provide power and a data interface.
[0083] Please see Figure 3 , Figure 3 This is a flowchart illustrating a fully automated control method for a slit-lamp microscope provided in an embodiment of this application. Figure 3 As shown, the method in this application embodiment includes the following steps:
[0084] 101. Control the main camera of the slit-lamp microscope to move to the iris focal position in order to take a picture of the iris;
[0085] 102. Determine the eyelash focus position or red eye focus position based on the real-time image captured by the main camera, and control the main camera to move to the eyelash focus position or red eye focus position to capture the eyelash or red eye.
[0086] 103. Based on the main camera, acquire an eye image including the slit light blade, and determine the position coordinates of the lower half of the light blade based on the eye image;
[0087] 104. Determine the corneal focal position based on the coordinates of the lower half of the laser blade, and control the main camera to move to the corneal focal position to capture the cornea.
[0088] The method in this application embodiment can achieve automatic focusing shooting of the iris, eyelashes or red eye, and cornea, thereby enabling fully automatic operation of the slit lamp, avoiding reliance on manual labor and improving operational accuracy. Especially in areas with scarce medical resources, it can reduce reliance on doctors.
[0089] In this embodiment, the slit-lamp microscope may have a built-in control chip, which may be pre-programmed with an executable program to implement the method of this embodiment. Alternatively, the slit-lamp microscope may be connected to an external computer via an interface to receive control commands from the external computer, thereby implementing the method of this embodiment.
[0090] In this embodiment, the movement of the main camera of the slit-lamp microscope is achieved by driving a motor.
[0091] In this embodiment of the application, the iris focal position refers to the position where the main camera can focus on the iris so that the user can clearly observe the iris.
[0092] In this embodiment of the application, the eyelash focus position refers to the position where the main camera can focus on the eyelashes so that the user can clearly observe the condition of the eyelashes.
[0093] In this embodiment of the application, the red-eye focus position refers to the position where the main camera can focus on the red-eye so that the user can clearly observe the red-eye condition.
[0094] In this embodiment, after completing step 101, there are several scenarios. If the user selects the eyelash check but not the redness-in-the-eye check, the eyelash focus position is determined solely based on the real-time image captured by the main camera, and the main camera is moved to that focus position to capture the eyelashes. If the user selects the redness-in-the-eye check but not the eyelash check, the redness-in-the-eye focus position is determined solely based on the real-time image captured by the main camera, and the main camera is moved to that focus position to capture the redness-in-the-eyes. If the user selects both the redness-in-the-eye and eyelash checks, the eyelashes can be captured first, followed by the redness-in-the-eyes, or vice versa.
[0095] In this embodiment of the application, the slit-light emitting lens group can emit light towards the cornea of the eye, thereby forming a light blade on the patient's cornea. At this time, the main camera takes a picture of the patient's eye, and can obtain an eye image containing the slit-light light blade.
[0096] In this embodiment, since the slit lamp blade has a large vertical span when it is irradiated on the cornea, which is not conducive to edge extraction, and the vertical symmetry of the blade is easily affected by the afterimage of the slit lamp source, only the position coordinates of the lower half of the blade are determined to simplify the calculation, facilitate edge extraction, and avoid using the complete blade affected by the afterimage of the slit lamp source to determine the corneal focal position. This reduces the influence of the afterimage of the slit lamp source on the positioning of the corneal focal position and improves the accuracy of the corneal focal position positioning.
[0097] In an embodiment of the present application, as an optional implementation manner, the steps of determining the eyelash focus position based on the real-time picture of the main camera and controlling the main camera to move to the eyelash focus position include the following sub-steps:
[0098] Cover the first area with the first mask and extract the second area, where the first area is the area in the real-time picture where the color is not within the range of black and gray colors, and the second area is the area in the real-time picture that is not covered.
[0099] Determine the second mask based on the second area and cover the real-time picture with the second mask to obtain the first target picture, where the first target picture is a picture that only includes the eyelash part.
[0100] Perform gradient calculation on the first target picture to determine the eyelash focus position, where the eyelash focus position is the position with the largest eyelash gradient difference.
[0101] This optional implementation manner can cover the first area with the first mask and extract the second area, where the first area is the area in the real-time picture where the color is not within the range of black and gray colors, and the second area is the area in the real-time picture that is not covered. Furthermore, it can determine the second mask based on the second area and cover the real-time picture with the second mask to obtain the first target picture, where the first target picture is a picture that only includes the eyelash part. Thus, it can perform gradient calculation on the first target picture to determine the eyelash focus position, where the eyelash focus position is the position with the largest eyelash gradient difference, and finally, based on the gradient calculation, the positioning accuracy of the eyelash focus position is higher.
[0102] In this optional implementation manner, the first mask is the image mask MASK, where the image mask MASK can be a matrix or an image with the same size as the real-time picture, and through the specified matrix operation, the first area can be covered.
[0103] In an embodiment of the present application, the first mask can be set according to the color to be covered. For example, when it is necessary to cover the color outside the range of black and gray colors, the implementation picture is first converted to the HSV color space, and then a binary mask is generated according to the cv2.inRange function, and this binary mask is used as the first mask.
[0104] In this optional implementation manner, the color not within the range of black and gray colors means that the color is not within the range from black to gray. For example, in the HSV color space, black is represented by H = any value, S = 0, V = 0, and gray is represented by H = any value, S = 0, V = 0.5. Then, the color that does not satisfy 0 < V < 0.5 and S = 0 is the color not within the range of black and gray colors.
[0105] In this embodiment of the application, since the color of the first region does not match the color of the eyelashes, the first region cannot have eyelash image information. Therefore, by covering this part of the region that cannot have eyelash image information, the image information processing can be further simplified.
[0106] In this embodiment of the application, the eyelash focal position can also be determined without covering the first area. For example, the eyelash focal position can be identified by an image recognition model.
[0107] In this embodiment of the application, since the second region is an unmasked area in the real-time image, it may be the area where the eyelash image is located, or it may be other areas that appear as black or gray. Therefore, in order to distinguish between these two cases, it is necessary to determine the second mask based on the second region, that is, to distinguish between these two cases by the second mask.
[0108] In this embodiment of the application, gradient calculation of the first target image refers to detecting and extracting the edge of the eyelash portion of the first target image, so as to determine the eyelash focal position based on the edge detection result. The position with the largest gradient difference corresponds to the region with the most drastic brightness change in the image, and the region with the most drastic brightness change in the image is usually the center position of the edge.
[0109] In this embodiment of the application, as an optional implementation, determining the second mask based on the second region includes the following sub-steps:
[0110] The second region is binarized and line detection is performed to obtain a binary line map;
[0111] The second mask is determined based on the binary graph of the line.
[0112] This optional implementation can perform binarization and line detection on the second region to obtain a line binary map, and then determine a second mask based on the line binary map. Furthermore, it can use binarization and line detection to further simplify image information, highlight the eyelash image part, and locate the region with eyelash image information, so that the second mask determined based on this can more accurately locate the eyelash part in the original image.
[0113] In this embodiment, binarizing the second region distinguishes the eyelash image portion within the second region from the background image portion, which can also be represented by a black to gray color range. Specifically, a threshold is set to differentiate the eyelash image and the background image. On the other hand, line detection extracts the structural information of the eyelash image portion. This allows the eyelash contour to be determined based on the structural information of the eyelash image portion, and a second mask to be determined based on the eyelash contour. This second mask, when overlaid on the original image, can extract the region corresponding to the eyelash contour.
[0114] In this embodiment of the application, line detection specifically includes retaining the line portion with a length between 40 and 100 pixels, thereby obtaining the eyelash contour.
[0115] In this application embodiment, as an optional implementation, determining the red-eye focus position based on the real-time image of the main camera and controlling the main camera to move to the red-eye focus position includes the following sub-steps:
[0116] The second target image is determined based on real-time images, wherein the second target image is an image that only includes red eyes;
[0117] The number of red-eyed pixels in the second target image is counted, and the location with the most red-eyed pixels in the second target image is determined as the red-eyed focal point based on the count.
[0118] This optional implementation can determine a second target image based on a real-time image, wherein the second target image is an image that only includes red eyes. Then, the number of red eye pixels in the second target image can be counted, and the position with the most red eye pixels in the second target image can be determined as the red eye focus position based on the count of red eye pixels, thereby enabling more accurate determination of the red eye focus position using the number of red eye pixels.
[0119] In this optional embodiment, the location with the most red pixels represents the most severe lesion at that location and is the most diagnostically representative. Therefore, this location can be positioned as the focal point of the red pixels, so that the location can be clearly imaged.
[0120] In this embodiment of the application, as an optional implementation, determining the second target image based on real-time images includes the following steps:
[0121] A third mask is determined, and a third region is covered based on the determined third mask to obtain a first intermediate processed image, wherein the third region is the area in the real-time image whose color is not within the range of skin color.
[0122] The iris region and the fourth mask in the first intermediate image are determined, and the iris region is covered based on the fourth mask to obtain the second intermediate image, which is an image that only includes the red and white parts of the eye.
[0123] A fifth mask is determined, and the fourth region is masked based on the fifth mask to obtain the second target image, wherein the fourth region is the area in the second intermediate image whose color is not within the red range.
[0124] This optional implementation can determine a third mask and cover a third region based on the determined third mask to obtain a first intermediate image, wherein the third region is a region in the real-time image whose color is not within the skin color range. Then, it can determine the iris region and a fourth mask in the first intermediate image and cover the iris region based on the fourth mask to obtain a second intermediate image, which is an image containing only red and white irises. Then, it can determine a fifth mask and cover a fourth region based on the fifth mask to obtain a second target image, wherein the fourth region is a region in the second intermediate image whose color is not within the red range. Thus, it can first mask the background image information according to the skin color range, then mask the iris region, thereby obtaining an image containing only red and white irises, and finally, by masking the white-colored region, obtain an image containing only red irises.
[0125] In this optional embodiment, since the eyes are adjacent to the skin, only areas with skin color can have eyes. Therefore, by masking the third area with a third mask, irrelevant image information can be initially blocked, thereby simplifying subsequent image processing.
[0126] In this embodiment of the application, as an optional implementation, before determining the third mask and covering the third region based on the determined third mask, the method of this embodiment of the application further includes the following steps:
[0127] Convert the color space of the live image from RGB to HSV.
[0128] This optional implementation can convert the color space of the real-time image from RGB to HSV color space, thereby decoupling the illumination information and facilitating the selection of specific image information based on color.
[0129] In this optional implementation, the HSV color space is more conducive to processing real-time images than the RGB color space. The HSV color space is more suitable for color segmentation. For example, in this embodiment, it is necessary to perform color segmentation operations on the real-time image according to skin color and red eye color. Using the HSV color space makes it easier to perform color segmentation operations on the real-time image according to skin color and red eye color.
[0130] In this embodiment of the application, the conversion can be performed based on the color conversion matrix between the RGB color space and the HSV color space.
[0131] In this embodiment of the application, as an optional implementation, the method further includes the following steps:
[0132] The first intermediate image is subjected to binarization and Gaussian denoising.
[0133] The iris region in the first intermediate image is determined based on the Hough circle recognition algorithm.
[0134] This optional implementation performs binarization and Gaussian denoising on the first intermediate image, thereby enabling the determination of the iris region in the first intermediate image based on the Hough circle recognition algorithm.
[0135] In this optional embodiment, the binarization of the first intermediate image can simplify the image information in the first intermediate image. Specifically, the image information of the first intermediate image is represented by 0 and 1, so that the Hough circle recognition algorithm can determine the contour of the iris based on the region represented by 1, thereby determining the iris region based on the contour of the iris.
[0136] In this embodiment, Gaussian denoising refers to using a Gaussian function to perform convolution processing on the first intermediate image to reduce random noise in the first intermediate image, thereby reducing the impact of random noise on the execution of the Hough circle recognition algorithm and improving the recognition accuracy of the iris region.
[0137] In this embodiment of the application, as an optional implementation, determining the position coordinates of the lower half of the laser scalpel based on an eye image includes the following sub-steps:
[0138] Eye images are processed based on an object detection model, enabling the model to extract multi-scale image features from the eye images.
[0139] The target detection model is used to fuse multi-scale image features of the eye image to obtain the feature fusion result, and the position coordinates of the lower half of the light knife are determined based on the feature fusion result.
[0140] This optional implementation can extract multi-scale image features of eye images based on the target detection model, and then fuse the multi-scale image features of eye images based on the target detection model to obtain feature fusion results, and automatically determine the position coordinates of the lower half of the light knife based on the feature fusion results.
[0141] In this optional implementation, the eye image can be generated by the main camera. Alternatively, the eye image can be preprocessed after acquisition, including image cropping, which involves cropping the size of the eye image to meet the image input size limit of the object detection model.
[0142] In this application embodiment, as an optional implementation, determining the corneal focal position based on the position coordinates of the lower half of the laser scalpel includes the following sub-steps:
[0143] Based on the position coordinates of the lower half of the light blade, the ROI image of the eye is processed to obtain the ROI image; the ROI image is then converted into a grayscale image.
[0144] The grayscale image is processed by Gaussian denoising and adaptive binarization to obtain the first binary image;
[0145] Perform three operations on the first binary graph: open, expand, and open again.
[0146] Determine the outline in the first binary image whose length is equal to the length of the ROI image and whose width is less than 0.6 times the width of the ROI image, and determine the second binary image based on the outline;
[0147] The second binary image is processed based on morphological dilation and closing operations to obtain a full-shaped laser blade binary image.
[0148] The sixth mask is determined based on the full-size binary image of the light blade, and the sixth mask and the ROI image are ANDed to obtain the fifth target image, which is an RGB image containing only the light blade.
[0149] Edge extraction is performed on the fifth target image, and the pixel values of the light blade edge are counted and the maximum width of the light blade is determined based on the extraction results;
[0150] The corneal focal position is determined in the fifth target image based on the edge pixel value of the laser blade and the maximum width of the laser blade.
[0151] This optional implementation can perform ROI processing on the eye image based on the coordinates of the lower half of the scalpel to obtain an ROI image; convert the ROI image into a grayscale image, and then process the grayscale image based on Gaussian denoising and adaptive binarization to obtain a first binary image; then perform three operations on the first binary image: opening, dilation, and opening again, to determine a contour in the first binary image whose length is equal to the length of the ROI image and whose width is less than 0.6 times the width of the ROI image; and determine a second binary image based on the contour; then process the second binary image based on morphological dilation and closing operations to obtain a full scalpel binary image; then determine a sixth mask based on the full scalpel binary image, and perform a bitwise AND operation between the sixth mask and the ROI image to obtain a fifth target image, wherein the fifth target image is an RGB image containing only the scalpel; then perform edge extraction on the fifth target image, and based on the extraction results, count the edge pixel values of the scalpel and determine the maximum width of the scalpel, thereby determining the corneal focal position in the fifth target image based on the edge pixel values of the scalpel and the maximum width of the scalpel.
[0152] In this optional implementation, performing ROI (Region of Interest) processing on the eye image based on the position coordinates of the lower half of the light blade involves taking the image area defined by the position coordinates of the lower half of the light blade as the region of interest and extracting the region of interest from the eye image.
[0153] In this optional embodiment, the slit lamp emits light into the user's eyes, thereby forming a complete light blade on the user's eyes. This allows for the imaging of the user's eyes to obtain a complete light blade image, also known as a slit lamp light blade. The light blade refers to the adjustable strip beam emitted by the slit lamp through the light source system, which is used to illuminate the eye structure and form an optical section.
[0154] In this optional embodiment, the light is elongated and the light blade can be divided into an upper part and a lower part. The upper part of the light blade can be the part above the origin of the Y-axis coordinate, and the lower part of the light blade can be the part below the origin of the Y-axis coordinate.
[0155] In this optional implementation, converting the ROI image to a grayscale image facilitates Gaussian denoising and adaptive binarization.
[0156] In this optional embodiment, the opening operation of the first binary image refers to performing an opening operation on the first binary image, wherein the opening operation of the first binary image includes operations such as noise reduction, contour smoothing, and disconnection.
[0157] In this optional embodiment, the dilation operation of the first binary image refers to enlarging objects, filling holes, and strengthening connections in the first binary image.
[0158] In this optional embodiment, the cubic operation of the first binary image refers to performing deep denoising, thorough boundary smoothing, and separation of complex adhesions on the first binary image.
[0159] In this optional implementation, a full-bodied laser blade binary image refers to a binary image that can reflect the complete laser blade.
[0160] In one optional implementation of this application, determining the corneal focal position in the fifth target image based on the edge pixel values of the scalpel and the maximum width of the scalpel includes the following steps:
[0161] The location in the fifth target image that meets the preset conditions is determined as the corneal focal point location. The preset conditions are that the pixel value of the laser blade edge is greater than 120 and the maximum width of the laser blade is less than 50.
[0162] This optional implementation can determine the location in the sixth target image that meets the preset conditions as the corneal focal position. The condition that the edge pixel value of the laser blade is greater than 120 and the maximum width of the laser blade is less than 50 can improve the positioning accuracy of the corneal focal position.
[0163] In this embodiment of the application, as an example, to train the target detection module, a large amount of slit-lamp corneal imaging data can be collected from medical institutions and laboratories. This image data is then organized, and metadata such as the shooting environment, lighting conditions, and equipment type is recorded. The initial image data undergoes a quality check, discarding blurry, severely overexposed, underexposed, or unusable images for slit-lamp keratology identification.
[0164] Furthermore, the selected images were manually labeled using LabelImg. Because the slit lamp scalpel has a large vertical span when illuminating the cornea, and is easily affected by afterimages from the slit lamp source, only the lower half of the slit lamp was labeled. Next, all labeled images were converted into a format recognizable by Yolov8.
[0165] Furthermore, during model training, the input image size is 640x640 pixels.
[0166] Furthermore, the input image can be preprocessed first. The image preprocessing includes the following steps: First, the image is scaled and filled using the letterbox method to fit the input size of 640x640. This process selects different scaling and filling modes according to the configured parameters to ensure that the image content is not distorted.
[0167] Furthermore, the image is converted to the RGB color space and rearranged in channel-height-width (CHW) format. Based on this, pixel values are normalized by converting them from an integer range (0-255) to a floating-point range (0-1). As an additional enhancement step, a mosaic operation is applied to increase data diversity by randomly combining multiple image regions within the image, thereby enhancing the model's robustness and generalization ability.
[0168] Furthermore, 50 patient images were used as a test set to evaluate model performance, and MAP, precision, and recall were calculated.
[0169] Furthermore, the training strategy is adjusted based on the results, specifically as follows:
[0170] Mosaic four-image stitching is enabled to improve small target detection capabilities.
[0171] Geometric enhancements: translation (translate=0.1), scaling (scale=0.5), and horizontal flip (fliplr=0.5);
[0172] Luminosity enhancement: HSV hue (hsv_h = 0.015), saturation (hsv_s = 0.7), and brightness (hsv_v = 0.4) perturbations simulate changes in illumination;
[0173] Loss weights: bounding box loss gain (box = 7.5), classification loss gain (cls = 0.5);
[0174] Learning rate scheduling: Initial learning rate lr0 = 0.01, cosine decay to 0.01 × 0.01;
[0175] The hot start cycle lasted 3 cycles, with an initial momentum of 0.8, which gradually increased to 0.937.
[0176] Early stopping mechanism: patience = 100 (stop when there is no improvement in validation set performance);
[0177] Regularization: weight decay = 5e-4, dropout probability dropout = 0.2;
[0178] Disable late-stage enhancements: Disable Mosaic for the last 10 cycles (close_mosaic=10);
[0179] Furthermore, the object detection model was then output as an ONNX model, deployed on a local C# platform, and tested and verified again using local images.
[0180] Furthermore, the acquired eye images containing the slit lamp blade are preprocessed, including size unification, brightness and contrast adjustment, and noise removal, to ensure the images meet the model's expected input standards. After preprocessing, the optimized image data is input into the already trained target detection model.
[0181] Furthermore, multi-scale features of the image are extracted from the model's backbone network, and then the feature information from different levels is integrated through a feature fusion layer. Feature analysis is performed on the detection head pair, and finally the scalpel region is identified and located in the image, and the coordinates of the lower half of the scalpel are obtained.
[0182] Furthermore, the target region is extracted and processed using traditional algorithms, specifically as follows:
[0183] Deploy and import the onnnx model on the C# platform. After iris focusing is completed, open the main camera and perform inference on the real-time image captured by the main camera to obtain the position coordinates of the lower half of the light blade in the image.
[0184] Using the obtained coordinates of the light blade, the lower half of the light blade is extracted as the Region of Interest (ROI), and the ROI image is converted into a grayscale image. Then, Gaussian denoising and adaptive binarization are used to convert the image into a binary image.
[0185] The newly obtained binary image is subjected to three operations: opening, dilation, and opening again. The operators for the three operations are (cv2.MORPH_ELLIPSE,(8,12),(-1,-1)), (cv2.MORPH_ELLIPSE,(5,10),(-1,-1)), and (cv2.MORPH_ELLIPSE,(3,6),(-1,-1)).
[0186] The cv2.findContours function is used to find the contours in the binary image obtained in the previous step whose length is equal to the length of the ROI and whose width is less than 0.6 times the width of the ROI. The contours are then drawn separately into a new binary image, and a full light blade binary image is obtained by morphological dilation and closing operations.
[0187] Using the obtained full-scale binary image of the light blade, a mask is created, and the mask and the ROI image are ANDed to obtain an RGB image that excludes other elements and contains only the light blade.
[0188] The `canny` function is used to extract edges from the RGB image of the slit lamp obtained in the previous step. Here, the high and low grayscale thresholds can be set to 100 and 200, respectively. Next, the extracted slit lamp edge pixel values (num) are counted, and the maximum width of the slit lamp (max_w) is calculated. Finally, the positions where `num > 120` and `max_w < 50` are set as the corneal focal points. When the focal point is reached, the slit lamp arm stops moving and takes a picture, completing the corneal focusing process.
[0189] Furthermore, embodiments of this application also disclose a control device for a slit-lamp microscope. Please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic diagram of the structure of a control device for a slit-lamp microscope disclosed in an embodiment of this application.
[0190] like Figure 4 As shown, the control device for the slit-lamp microscope in this embodiment includes the following functional modules:
[0191] The iris autofocus imaging module 201 is used to control the main camera of the slit-lamp microscope to move to the iris focal position in order to capture the iris.
[0192] The eyelash and red eye autofocus shooting module 202 is used to determine the eyelash focus position or red eye focus position based on the real-time image captured by the main camera, and control the main camera to move to the eyelash focus position or red eye focus position to capture the eyelash or red eye.
[0193] The light blade determination module 203 is used to acquire an eye image including the slit light blade based on the main camera, and determine the position coordinates of the lower half of the light blade based on the eye image;
[0194] The corneal autofocus determination module 204 is used to determine the corneal focal position based on the position coordinates of the lower half of the light knife, and control the main camera to move to the corneal focal position to capture the cornea.
[0195] The device in this embodiment of the application can achieve automatic focusing and imaging of the iris, eyelashes or red eye, and cornea by executing a fully automatic control method for a slit-lamp microscope. This enables fully automatic operation of the slit lamp, avoids reliance on manual labor, and improves operational accuracy. Especially in areas with scarce medical resources, it can reduce reliance on doctors.
[0196] Furthermore, embodiments of this application also provide an electronic device; please refer to [link to relevant documentation]. Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. For example... Figure 5 As shown, the electronic device includes:
[0197] Processor 301; and
[0198] The memory 302 is configured to store machine-readable instructions that, when executed by the processor 301, perform a fully automated control method for a slit-lamp microscope as described in any of the foregoing embodiments.
[0199] The electronic device in this application embodiment can achieve automatic focusing and imaging of the iris, eyelashes or red eye, and cornea by executing a fully automatic control method for a slit-lamp microscope. This enables fully automatic operation of the slit lamp, avoiding reliance on manual labor and improving operational accuracy. Especially in areas with scarce medical resources, it can reduce dependence on doctors.
[0200] Furthermore, embodiments of this application also provide a storage medium storing a computer program, which is executed by a processor as a fully automated control method for a slit-lamp microscope as described in any of the foregoing embodiments.
[0201] The storage medium in this application embodiment can achieve automatic focusing and imaging of the iris, eyelashes or red eye, and cornea by executing a fully automatic control method for a slit-lamp microscope. This enables fully automatic operation of the slit lamp, avoiding reliance on manual labor and improving operational accuracy. Especially in areas with scarce medical resources, it can reduce dependence on doctors.
[0202] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0203] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0204] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0205] It should be noted that if the function is implemented as a software 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 this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0206] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.
[0207] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A fully automated control method for a slit-lamp microscope, characterized in that, The method includes: The main camera of the slit-lamp microscope is moved to the iris focal position to capture an image of the iris; Based on the real-time images captured by the main camera, determine the eyelash focus position or the red eye focus position, and control the main camera to move to the eyelash focus position or the red eye focus position to capture the eyelashes or the red eye. The main camera acquires an eye image including the slit light blade, and the coordinates of the lower half of the light blade are determined based on the eye image. The corneal focal point is determined based on the coordinates of the lower half of the laser scalpel, and the main camera is controlled to move to the corneal focal point to capture an image of the cornea. And, determining the coordinates of the lower half of the laser scalpel based on the eye image includes: The eye image is processed based on an object detection model, so that the object detection model can extract multi-scale image features of the eye image; The target detection model is used to fuse multi-scale image features of the eye image to obtain a feature fusion result, and the position coordinates of the lower half of the light knife are determined based on the feature fusion result. And, determining the corneal focal position based on the coordinates of the lower half of the laser scalpel includes: Based on the position coordinates of the lower half of the light blade, the eye image is processed to obtain an ROI image; the ROI image is then converted into a grayscale image. The grayscale image is processed by Gaussian denoising and adaptive binarization to obtain a first binary image; The first binary image is subjected to three operations: opening, expanding, and opening again. Determine the outline in the first binary image whose length is equal to the length of the ROI image and whose width is less than 0.6 times the width of the ROI image, and determine the second binary image based on the outline; The second binary image is processed based on morphological dilation and closing operations to obtain a full-shaped laser blade binary image. The sixth mask is determined based on the full-shaped light blade binary image, and the sixth mask and the ROI image are ANDed to obtain the fifth target image, wherein the fifth target image is an RGB image containing only the light blade; Edge extraction is performed on the fifth target image, and the pixel values of the light blade edge are counted and the maximum width of the light blade is determined based on the extraction results; The corneal focal position is determined in the fifth target image based on the edge pixel value of the laser blade and the maximum width of the laser blade.
2. The method as described in claim 1, characterized in that, Determining the eyelash focus position based on the real-time image from the main camera, and controlling the main camera to move to the eyelash focus position, includes: The first region is masked based on the first mask and the second region is extracted, wherein the first region is the region in the real-time image whose color is not within the range of black and gray, and the second region is the unmasked region in the real-time image; A second mask is determined based on the second region, and the second mask is used to cover the real-time image to obtain a first target image, wherein the first target image is an image that only includes the eyelashes; Gradient calculation is performed on the first target image to determine the eyelash focal position, wherein the eyelash focal position is the position with the largest eyelash gradient difference.
3. The method as described in claim 2, characterized in that, Determining the second mask based on the second region includes: The second region is binarized and line detection is performed to obtain a binary line map; The second mask is determined based on the binary graph of the line.
4. The method as described in claim 1, characterized in that, Determining the red-eye focus position based on the real-time image from the main camera, and controlling the main camera to move to the red-eye focus position, includes: A second target image is determined based on the real-time image, wherein the second target image is an image that only includes red eyes; The number of red-eyed pixels in the second target image is counted, and the position with the most red-eyed pixels in the second target image is determined as the red-eyed focal point position based on the count results.
5. The method as described in claim 4, characterized in that, Determining the second target image based on the real-time image includes: A third mask is determined, and a third region is covered based on the determined third mask to obtain a first intermediate processed image, wherein the third region is the region in the real-time image whose color is not within the range of skin color. The iris region and the fourth mask in the first intermediate image are determined, and the iris region is covered based on the fourth mask to obtain a second intermediate image, which is an image that only includes the red and white parts of the eye. A fifth mask is determined, and a fourth region is masked based on the fifth mask to obtain the second target image, wherein the fourth region is the area in the second intermediate image whose color is not within the red range.
6. The method as described in claim 5, characterized in that, Before determining the third mask and covering the third region based on the determined third mask, the method further includes: The color space of the real-time image is converted from the RGB color space to the HSV color space.
7. The method as described in claim 6, characterized in that, The method further includes: The first intermediate image is subjected to binarization and Gaussian denoising. The iris region in the first intermediate image is determined based on the Hough circle recognition algorithm.
8. The method as described in claim 1, characterized in that, Determining the corneal focal position in the fifth target image based on the edge pixel values of the laser scalpel and the maximum width of the laser scalpel includes: The location in the fifth target image that meets the preset conditions is determined as the corneal focal position, wherein the preset conditions are that the edge pixel value of the light blade is greater than 120 and the maximum width of the light blade is less than 50.
9. A control device for a slit-lamp microscope, characterized in that, The device includes: The iris autofocus imaging module is used to control the main camera of the slit-lamp microscope to move to the iris focal position in order to capture an image of the iris. The eyelash and red eye autofocus shooting module is used to determine the eyelash focus position or the red eye focus position based on the real-time image captured by the main camera, and control the main camera to move to the eyelash focus position or the red eye focus position to capture the eyelash or the red eye. The light blade determination module is used to acquire an eye image including the slit light blade based on the main camera, and to determine the position coordinates of the lower half of the light blade based on the eye image; The corneal autofocus determination module is used to determine the corneal focal position based on the position coordinates of the lower half of the light knife, and control the main camera to move to the corneal focal position to capture the cornea; And, determining the coordinates of the lower half of the laser scalpel based on the eye image includes: The eye image is processed based on an object detection model, so that the object detection model can extract multi-scale image features of the eye image; The target detection model is used to fuse multi-scale image features of the eye image to obtain a feature fusion result, and the position coordinates of the lower half of the light knife are determined based on the feature fusion result. And, determining the corneal focal position based on the coordinates of the lower half of the laser scalpel includes: Based on the position coordinates of the lower half of the light blade, the eye image is processed to obtain an ROI image; the ROI image is then converted into a grayscale image. The grayscale image is processed by Gaussian denoising and adaptive binarization to obtain a first binary image; The first binary image is subjected to three operations: opening, expanding, and opening again. Determine the outline in the first binary image whose length is equal to the length of the ROI image and whose width is less than 0.6 times the width of the ROI image, and determine the second binary image based on the outline; The second binary image is processed based on morphological dilation and closing operations to obtain a full-shaped laser blade binary image. The sixth mask is determined based on the full-shaped light blade binary image, and the sixth mask and the ROI image are ANDed to obtain the fifth target image, wherein the fifth target image is an RGB image containing only the light blade; Edge extraction is performed on the fifth target image, and the pixel values of the light blade edge are counted and the maximum width of the light blade is determined based on the extraction results; The corneal focal position is determined in the fifth target image based on the edge pixel value of the laser blade and the maximum width of the laser blade.
10. An electronic device, characterized in that, include: processor; as well as The memory is configured to store machine-readable instructions that, when executed by the processor, perform the fully automated control method for a slit-lamp microscope as described in any one of claims 1-8.
11. A storage medium, characterized in that, The storage medium stores a computer program, which is executed by a processor using the fully automated control method for a slit-lamp microscope as described in any one of claims 1-8.