Corneal curvature radius calculation method and system and optometry unit
By preprocessing and edge detection of human eye reflection images, skeleton points are generated and elliptical fitting is performed, combined with defocus parameter compensation, the problem of inaccurate measurement of corneal curvature radius is solved, and higher calculation accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202510357499.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-08-19
AI Technical Summary
When obtaining the radius of curvature of the corneal in the prior art, the measurement is not accurate enough due to factors such as tear film, eyelid occlusion and tiny eye movement.
By acquiring the human eye reflection image set, preprocessing is performed to perform edge detection, and the inner and outer ring data are generated, weighted elliptical fitting is performed based on the skeleton point, and compensation is used to improve the accuracy of the corneal curvature radius.
It improves the calculation accuracy of the corneal curvature radius, adapts to the complex changes in corneal images, enhances the accuracy and efficiency of edge detection, overcomes the influence of image inhomogeneity, and provides a more accurate calculation method for corneal curvature radius.
Smart Images

Figure CN120510201A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of ophthalmic medical detection technology, and in particular to a method, system and ophthalmometer for calculating corneal curvature radius. Background Art
[0002] In many scenarios such as ophthalmic clinical diagnosis, refractive surgery planning, and contact lens fitting, it is crucial to accurately obtain the corneal curvature radius.
[0003] The related technology requires that an ophthalmometer transmit a circular image to the patient's corneal surface, forming a reflection image of the human eye. This reflection image is binarized and edge-detected to obtain the circular portion of the image. This circular portion is then fitted to obtain an ellipse equation. Based on the parameters of the ellipse equation, the corneal curvature radius is obtained.
[0004] Regarding the above-mentioned related technologies, the inventors believe that in actual scenarios, the measured corneal curvature radius may be inaccurate due to the influence of tear film, eyelid occlusion and slight eye movement. Summary of the Invention
[0005] In order to improve the accuracy of corneal curvature radius, the present application provides a corneal curvature radius calculation method, system and optometrist.
[0006] In a first aspect, the present application provides a method for calculating the radius of corneal curvature, which adopts the following technical solution: A method for calculating corneal curvature radius, comprising: Acquire a set of human eye reflection images, wherein the set includes human eye reflection images at different optical axis positions, wherein the human eye reflection images are obtained by reflecting a circular ring image from the cornea, and the reflected circular ring image includes an inner ring and an outer ring having the same center; Preprocessing the human eye reflection image to obtain a preprocessed human eye reflection image; Performing edge detection on the preprocessed human eye reflection image to obtain inner ring data and outer ring data in the human eye reflection image; Generate skeleton points of a circular ring according to the inner ring data and the outer ring data; Performing a weighted operation based on the image grayscale value and the ring width value at the location of the skeleton point to obtain a skeleton point weight; Performing ellipse fitting on the skeleton points according to the skeleton point weights to obtain an ellipse equation; Calculating the corneal curvature radius according to the geometric parameters of the ellipse equation; Obtaining a defocus parameter of the human eye reflection image in the human eye reflection image set; The corneal curvature radius is compensated according to the defocus parameter.
[0007] By adopting the above technical solution, the human eye reflection image is preprocessed, and the edge of the preprocessed human eye reflection image is detected to obtain inner ring data and outer ring data. Skeleton points are generated based on the inner ring data and outer ring data, and the skeleton points are weighted to obtain skeleton points. Ellipse fitting is performed on the skeleton points to obtain the corneal curvature radius. The corneal curvature radius is compensated by the defocus parameter to improve the accuracy of the corneal curvature radius. The accuracy of the calculated value of the corneal curvature radius can be improved in a variety of ways. In addition, the geometric characteristics and physical properties of the cornea are fully considered, and the accuracy of the calculation is gradually improved by cooperating with each other, which is different from the simple and direct corneal curvature radius calculation method.
[0008] Optionally, generating an inner ring ellipse equation according to the inner ring data; generating an outer ring ellipse equation according to the outer ring data; Obtaining a rough center according to the center coordinates of the inner ring ellipse equation and the center coordinates of the outer ring ellipse equation; Taking the rough center as the origin, a circumferential ray is formed, and the skeleton point is determined on the circumferential ray. The skeleton point is a point on the circumferential ray where the grayscale value changes the most. The skeleton point is located between the inner ring and the outer ring.
[0009] By adopting the above technical solution, the point with the largest grayscale value change is determined on the circumferential ray to obtain the skeleton point, which makes the position of the skeleton point more accurate and is conducive to the subsequent calculation of the corneal curvature radius.
[0010] Optionally, a search line segment between the inner ring ellipse and the outer ring ellipse is intercepted on the circumferential ray; Executing a cutting step, the cutting step comprising: cutting an i-th search sub-segment on the search segment according to a search step, where i is a positive integer with an initial value of 1; Executing a retrieval step, the retrieval step comprising: obtaining an i-th temporary skeleton point corresponding to the i-th search sub-segment according to a change in the grayscale value on the i-th search sub-segment; Executing a calculation step, the calculation step comprising: calculating a grayscale value change rate within the i-th search sub-segment, the grayscale value change rate being used to describe a degree of grayscale value change within the i-th search sub-segment; Executing a step length updating step, the step length updating step comprising: updating the search step length according to the gray value change rate, wherein the updated search offset is negatively correlated with the gray value change rate; Repeating the interception step, the retrieval step, the calculation step, and the step size update step to obtain a plurality of temporary skeleton points; The skeleton point is determined from the plurality of temporary skeleton points.
[0011] By adopting the above technical solution and an adaptive step size strategy, the search step size is adjusted according to the grayscale changes in the local area of the image. The step size is increased in areas with gentle grayscale changes and reduced in areas with drastic grayscale changes. This can improve the computational efficiency and more accurately determine the position of the skeleton points.
[0012] Optionally, according to the brightness value of the human eye reflection image, the human eye reflection image is enhanced to obtain a brightness distribution image; Binarizing the image according to the grayscale value of the brightness distribution image to obtain a binary image; Performing dilation and erosion operations on the binary image to obtain the pre-processed human eye reflection image.
[0013] By adopting the above technical solution, the human eye reflection image is preprocessed in a variety of different ways, which can better adapt to the complex changes of the human eye corneal image and improve the accuracy and efficiency of subsequent edge detection and corneal curvature radius calculation.
[0014] Optionally, the human eye reflection image is divided into at least two local areas, and the width of the local area is greater than the theoretical ring width; Calculate and obtain the histogram corresponding to each local area; According to the brightness distribution in the histogram, setting the brightness threshold corresponding to the histogram; The histogram is adjusted according to the brightness threshold to obtain the brightness distribution image.
[0015] By adopting the above technical solution, while ensuring that the overall brightness distribution of the image does not change, by dividing the local area into appropriate areas and limiting the histogram contrast, the contrast of the local area is effectively enhanced, the details of the corneal edge are highlighted, and the adverse effects of the uneven reflection image of the human eye on subsequent processing are overcome, laying a good foundation for the accurate calculation of the corneal curvature radius.
[0016] Optionally, for a first pixel point in the brightness distribution image, neighboring pixel points located within a range around the first pixel point are acquired, where the first pixel point is any pixel point in the brightness distribution image; Calculating the mean of the grayscale values of the first pixel and the neighboring pixels to obtain a mean grayscale value; Using the mean grayscale value to replace the grayscale value of the first pixel in the brightness distribution image to obtain a mean filtered image; Dividing the mean filtered image into a plurality of regional mean filtered images; Obtaining a binarization threshold corresponding to the regional mean filtered image according to a grayscale value distribution in the regional mean filtered image; The mean filtered image is binarized using the binarization threshold corresponding to each of the regional mean filtered images to obtain the binary image.
[0017] By adopting the above technical solution, the cornea area is effectively separated from the background area, the cornea contour features are highlighted, and it is more adaptable to the complex local grayscale changes of the cornea image, thereby improving the accuracy and efficiency of subsequent edge detection.
[0018] Optionally, calculating the gradient of the preprocessed human eye reflection image to obtain a gradient distribution image; determining candidate edge points in the gradient distribution image; Setting a first classification threshold and a second classification threshold according to the local grayscale change distribution and the overall grayscale distribution of the preprocessed human eye reflection image, wherein the first classification threshold is greater than the second classification threshold; Classifying the candidate edge points according to the classification threshold to obtain strong edge points, weak edge points, and non-edge points, wherein the gradient of the strong edge points is greater than the first classification threshold, the gradient of the weak edge points is greater than the first classification threshold and less than the second classification threshold, and the gradient of the non-edge points is less than the second classification threshold; retaining weak edge points connected to the strong edge points, and removing weak edge points not connected to the strong edge points; Inner ring data and outer ring data are obtained according to the strong edge points and the remaining weak edge points.
[0019] By adopting this technical solution, the first and second classification thresholds are set based on the local grayscale variation distribution and overall grayscale distribution of the preprocessed human eye reflection image. This effectively reduces false detections and missed detections, resulting in a more accurate and continuous corneal limbus image. This allows for greater precision and reliability when processing such detail-rich and complex images.
[0020] Optionally, two parallel light spots are provided on the outer ring; Obtaining the distance value between the parallel light point and the symmetry center from the human eye reflection image to obtain a center distance value; Calculating a current outer ring radius in a central symmetric direction in the human eye reflection image; Obtaining the ideal outer ring radius in the central symmetric direction; Calculating a ratio of the current outer ring radius to the ideal outer ring radius to obtain a proportional coefficient; The defocus parameter is obtained according to the center distance value and the proportional coefficient.
[0021] By adopting the above technical solution, it is proposed to use the proportional coefficient of the distance between the parallel light point and the center and the outer ring radius in the central symmetry direction as the defocus parameter, which can accurately capture the nonlinear characteristics of the optical system, thereby accurately compensating the measurement results and effectively solving the measurement error problem caused by defocus.
[0022] In a second aspect, the present application provides a corneal curvature radius calculation system, which adopts the following technical solutions: A corneal curvature radius calculation system, comprising: An acquisition module is used to obtain a set of human eye reflection images, image grayscale values, ring width values, grayscale values, brightness values, gradients, distance values, current outer ring radius, and ideal outer ring radius; A memory for storing a program for calculating the corneal curvature radius; The program in the memory can be loaded and executed by the processor to implement the corneal curvature radius calculation method.
[0023] By adopting the above technical solution, the human eye reflection image is preprocessed, and the edge of the preprocessed human eye reflection image is detected to obtain inner ring data and outer ring data. Skeleton points are generated based on the inner ring data and outer ring data, and the skeleton points are weighted to obtain skeleton points. Ellipse fitting is performed on the skeleton points to obtain the corneal curvature radius. The corneal curvature radius is compensated by the defocus parameter to improve the accuracy of the corneal curvature radius. The accuracy of the calculated value of the corneal curvature radius can be improved in a variety of ways. In addition, the geometric characteristics and physical properties of the cornea are fully considered, and the accuracy of the calculation is gradually improved by cooperating with each other, which is different from the simple and direct corneal curvature radius calculation method.
[0024] In a third aspect, the present application provides an optometrist, which adopts the following technical solution: An optometrist comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute any one of the above-mentioned methods.
[0025] In a fourth aspect, the present application provides a computer storage medium capable of storing a corresponding program, which has the characteristic of facilitating improving the accuracy of the corneal curvature radius, and adopts the following technical solution: A computer-readable storage medium stores a computer program that can be loaded by a processor and execute any one of the above-mentioned corneal curvature radius calculation methods.
[0026] In summary, this application includes at least one of the following beneficial technical effects: 1. The human eye reflection image is preprocessed, and the edge of the preprocessed human eye reflection image is detected to obtain inner ring data and outer ring data. Skeleton points are generated based on the inner ring data and outer ring data, and the skeleton points are weighted to obtain skeleton points. Ellipse fitting is performed on the skeleton points to obtain the corneal curvature radius. The corneal curvature radius is compensated by the defocus parameter to improve the accuracy of the corneal curvature radius. The accuracy of the calculated value of the corneal curvature radius can be improved in a variety of ways. In addition, the geometric characteristics and physical properties of the cornea are fully considered, and the accuracy of the calculation is gradually improved by cooperating with each other, which is different from the simple and direct corneal curvature radius calculation method; 2. Adopting an adaptive step size strategy, the search step size is adjusted according to the grayscale changes in the local area of the image. The step size is increased in areas with gentle grayscale changes and decreased in areas with drastic grayscale changes. This can improve computational efficiency and more accurately determine the location of skeleton points. 3. Under the premise of ensuring that the overall brightness distribution of the image does not change, by dividing the local area into appropriate areas and limiting the histogram contrast, the contrast of the local area is effectively enhanced, the details of the corneal edge are highlighted, and the adverse effects of the uneven reflection image of the human eye on subsequent processing are overcome, laying a good foundation for the accurate calculation of the corneal curvature radius. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a flow chart of a method for calculating the corneal curvature radius provided in an embodiment of the present application.
[0028] Figure 2 This is a schematic diagram of a method for calculating the corneal curvature radius provided in an embodiment of the present application.
[0029] Figure 3 It is a flowchart of a first method for determining skeleton points provided in an embodiment of the present application.
[0030] Figure 4 This is a flow chart of a second method for determining skeleton points provided in an embodiment of the present application.
[0031] Figure 5 This is a flow chart of a method for preprocessing human eye reflection images provided in an embodiment of the present application.
[0032] Figure 6 This is a flow chart of a method for generating a brightness distribution image provided in an embodiment of the present application.
[0033] Figure 7 This is a flow chart of a method for generating a binary image provided in an embodiment of the present application.
[0034] Figure 8 This is a flow chart of an edge detection method provided in an embodiment of the present application.
[0035] Figure 9 This is a flow chart of a method for generating defocus parameters provided in an embodiment of the present application.
[0036] Figure 10 This is a system schematic diagram of a corneal curvature radius calculation system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1 To the attached Figure 10 It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0038] The present application discloses a method for calculating the corneal curvature radius. Figure 1 , the method comprising: Step S101: obtaining a human eye reflection image set, which includes human eye reflection images at different optical axis positions. The human eye reflection image is obtained by reflecting a circular ring image from the cornea, and the reflected circular ring image includes an inner ring and an outer ring with the same center.
[0039] The optical axis position can be used to represent the distance from the light source to the human cornea. Furthermore, to reduce errors, multiple eye reflection images can be acquired at the same optical axis position. For example, multiple optical axis positions can be evenly spaced along the optical axis, and multiple eye reflection images can be acquired at each optical axis position to obtain a set of eye reflection images.
[0040] For example, please refer to Figure 2 The ophthalmometer 21 emits a light source in the form of a circular ring image 23 toward the human eye 22. The cornea of the human eye 22 reflects the circular ring image 23. The ophthalmometer 22 captures the reflected circular ring image to obtain a human eye reflection image. The circular ring image 23 has an inner ring 231 and an outer ring 231.
[0041] Step S102: pre-processing the human eye reflection image to obtain a pre-processed human eye reflection image.
[0042] In this application, preprocessing is used to optimize the edge contours of the outer and inner rings in the human eye reflection image so that the edge contours can represent the contour features of the cornea and filter noise as much as possible. Optionally, preprocessing includes filtering operations, binarization operations, and morphological operations.
[0043] Step S103: performing edge detection on the pre-processed human eye reflection image to obtain inner ring data and outer ring data in the human eye reflection image.
[0044] Edge detection is used to identify and locate outer and inner rings in the human eye reflection image.
[0045] The inner ring data is used to represent the position of the inner ring in the pre-processed human eye reflection image.
[0046] The outer ring data is used to represent the position of the outer ring in the pre-processed human eye reflection image.
[0047] Step S104: Generate skeleton points of the ring according to the inner ring data and the outer ring data.
[0048] Skeleton points are characteristic points in the human eye reflection image. In the embodiment of the present application, the skeleton points are located between the outer ring and the inner ring, and the skeleton points are the points with the largest change in grayscale value. Furthermore, the skeleton points correspond to the edge points of the human cornea.
[0049] Step S105: performing weighting according to the image grayscale value and the ring width value at the location of the skeleton point to obtain the skeleton point weight.
[0050] Skeleton point weights are used to represent the credibility of the skeleton point positions.
[0051] For example, the skeleton point weight is positively correlated with the image grayscale value at the location. That is, the larger the image grayscale value, the greater the skeleton point weight. Specifically, points with higher image grayscale values are closer to the true edge of the cornea. Therefore, points with higher image grayscale values are assigned larger skeleton point weights.
[0052] The ring width value refers to the difference in distance between the inner and outer rings at the skeleton point's location. For example, the skeleton point weight is negatively correlated with the ring width value; that is, the smaller the ring width value, the greater the skeleton point weight. Regions with smaller ring width values are more sensitive to changes in the corneal curvature radius. Therefore, points with smaller ring width values are assigned larger skeleton point weights.
[0053] Step S106: performing ellipse fitting on the skeleton points according to the skeleton point weights to obtain the ellipse equation.
[0054] When using skeleton point weights for ellipse fitting, the geometric parameters in the ellipse equation are adjusted using the skeleton point weights. The larger the skeleton point weight, the more the corresponding skeleton point can reflect the true corneal curvature radius. For example, after obtaining the fitted ellipse, the shortest distance from the skeleton point to the fitted ellipse is calculated. The distance threshold is determined in the preset mapping relationship obtained based on the skeleton point weights, and the distance threshold is negatively correlated with the skeleton point weights. If the shortest distance is greater than the distance threshold, the ellipse equation is adjusted so that the shortest distance is less than the distance threshold.
[0055] Exemplarily, the least square method is used to perform ellipse fitting on the skeleton points to obtain the ellipse equation.
[0056] Step S107: Calculate the corneal curvature radius based on the geometric parameters of the ellipse equation.
[0057] For example, according to the geometric parameters of the ellipse equation, the major axis radius and the minor axis radius of the ellipse equation are obtained. The corneal curvature radius is calculated based on the major axis radius and the minor axis radius. The calculation formula of the corneal curvature radius R is R=b 2 / a, b represents the major axis radius, a represents the minor axis radius.
[0058] Step S108: obtaining the defocus parameters of the human eye reflection images in the human eye reflection image set.
[0059] The defocus parameters include the distance between the parallel light point and the symmetry center and the proportional coefficient of the outer ring radius in the central symmetry direction. Figure 2 , two parallel light spots 2321 are set on the outer ring 232.
[0060] Step S109: Compensating for the corneal curvature radius according to the defocus parameter.
[0061] The defocus parameter represents the focal plane variation of the human cornea and reflects the nonlinear characteristics of the optical system. For example, the defocus parameters corresponding to the human eye reflection images at different optical axis positions are obtained to obtain a set of defocus parameters. A curve fitting is performed using the set of defocus parameters to obtain a fitting curve. The corneal curvature radius is compensated using the fitted curve.
[0062] On the other hand, the corneal curvature radius calculation method can be applied to the configuration of corneal contact lenses (also known as contact lenses). The accurate corneal curvature radius can help optometrists more accurately select corneal contact lenses with appropriate base curves, improve wearing comfort and safety, and reduce problems such as corneal hypoxia and wear caused by inappropriate lens base curves. At the same time, it also helps to improve the corrective effect of corneal contact lenses, providing a better visual experience and eye health protection for the majority of contact lens wearers.
[0063] In another aspect of this application, the corneal curvature radius calculation method can be applied to improve the accuracy of clinical ophthalmological diagnosis. In ophthalmology, corneal curvature radius is a key parameter in the diagnosis of various eye diseases and the planning of refractive surgery. Therefore, this application can provide doctors with more accurate corneal morphology information, thereby more accurately diagnosing diseases, formulating personalized treatment plans, improving treatment efficacy, reducing misdiagnosis or improper treatment due to measurement errors, and ultimately improving the overall diagnosis and treatment level of ophthalmology.
[0064] By adopting the above technical solution, the human eye reflection image is preprocessed, and the edge of the preprocessed human eye reflection image is detected to obtain inner ring data and outer ring data. Skeleton points are generated based on the inner ring data and outer ring data, and the skeleton points are weighted to obtain skeleton points. Ellipse fitting is performed on the skeleton points to obtain the corneal curvature radius. The corneal curvature radius is compensated by the defocus parameter to improve the accuracy of the corneal curvature radius. The accuracy of the calculated value of the corneal curvature radius can be improved in a variety of ways. In addition, the geometric characteristics and physical properties of the cornea are fully considered, and the accuracy of the calculation is gradually improved by cooperating with each other, which is different from the simple and direct corneal curvature radius calculation method.
[0065] The embodiment of the present application discloses a method for determining skeleton points. Figure 3 , the method comprising: Step S301: Generate an inner ring ellipse equation according to the inner ring data.
[0066] Exemplarily, the inner ring ellipse equation is generated based on the inner ring data by the least square method.
[0067] In some other embodiments, other feasible methods may be used to obtain the inner ring ellipse equation, such as algebraic methods, Pratt algorithm, RANSAC (RANdom SAmple Consensus) algorithm, etc.
[0068] Step S302: Generate the outer ring ellipse equation according to the outer ring data.
[0069] Exemplarily, the outer ring ellipse equation is generated based on the outer ring data by the least square method.
[0070] In some other embodiments, other feasible methods may be used to obtain the inner ring ellipse equation, such as algebraic method, Pratt algorithm, RANSAC algorithm, etc.
[0071] Step S303: Obtain a rough center according to the center coordinates of the inner ring ellipse equation and the center coordinates of the outer ring ellipse equation.
[0072] For example, the number of edge points on the inner ring ellipse equation is calculated to obtain the inner ring number of points. The number of edge points on the outer ring ellipse equation is calculated to obtain the outer ring number of points. Based on the inner ring number of points and the outer ring number of points, an inner ring weight and an outer ring weight are obtained. Based on the inner ring weight and the outer ring weight, a weighted operation is performed on the center coordinates of the inner ring ellipse equation and the center coordinates of the outer ring ellipse equation to obtain a rough center.
[0073] Step S304: With the rough center as the origin, circumferential rays are formed, and skeleton points are determined on the circumferential rays. The skeleton points are points on the circumferential rays where the grayscale value changes the most. The skeleton points are located between the inner ring and the outer ring.
[0074] For example, with the rough center as the origin, rays are uniformly emitted 360 degrees in all directions to form circumferential rays. A line segment between the inner ring and the outer ring is determined on the circumferential rays, and the point with the largest grayscale value change on the line segment is used as the skeleton point.
[0075] By adopting the above technical solution, the point with the largest grayscale value change is determined on the circumferential ray to obtain the skeleton point, which makes the position of the skeleton point more accurate and is conducive to the subsequent calculation of the corneal curvature radius.
[0076] In the following embodiment, when searching for skeleton points on circumferential rays, a search step is used to search for skeleton points on circumferential rays. In order to improve the efficiency and accuracy of the search, the embodiment of the present application discloses a second method for determining skeleton points. Figure 4 , the method comprising: Step S401: intercepting a search line segment between the inner ring ellipse and the outer ring ellipse on the circumferential ray.
[0077] Exemplarily, a first intersection point between the circumferential ray and the inner ring ellipse is determined, a second intersection point between the circumferential ray and the outer ring ellipse is determined, and a search line segment is determined based on the first intersection point and the second intersection point.
[0078] Step S402: executing the interception step, which includes intercepting the i-th search sub-segment on the search segment according to the search step, where i is a positive integer with an initial value of 1.
[0079] The length of the i-th search sub-segment is the same as the search step size.
[0080] Furthermore, the endpoint of the search segment close to the inner loop is set as the first endpoint, and the endpoint of the search segment close to the outer loop is set as the second endpoint. Starting from the first endpoint, a segment of the search step is intercepted on the search segment to obtain the i-th search sub-segment, and the i-th search sub-segment is removed from the search segment to update the search segment.
[0081] Furthermore, if the search step is greater than the length of the search segment, the search segment is used as the i-th search sub-segment.
[0082] Step S403: executing a retrieval step, which includes: obtaining an i-th temporary skeleton point corresponding to the i-th search sub-segment according to a change in the grayscale value on the i-th search sub-segment.
[0083] For example, the grayscale values of each point on the i-th search sub-segment are obtained. The grayscale differences between adjacent points are calculated. The point corresponding to the maximum grayscale difference is taken as the i-th temporary skeleton point.
[0084] Step S404: executing a calculation step, the calculation step including: calculating the grayscale value change rate within the i-th search sub-segment, the grayscale value change rate is used to describe the severity of the grayscale value change within the i-th search sub-segment.
[0085] For example, the grayscale value of each point on the i-th search sub-segment is obtained. A discrete graph is plotted with the point number as the horizontal axis and the grayscale value as the vertical axis. The discrete graph is fitted to obtain a fitted curve. The slope corresponding to each point in the fitted curve is calculated to obtain a slope set. The variance of the slope set is calculated to obtain the grayscale value change rate.
[0086] For example, the grayscale value of each point on the i-th search sub-segment is obtained, the grayscale difference between adjacent points is calculated, and the variance of the grayscale difference is calculated to obtain the grayscale value change rate.
[0087] Step S405: executing a step length updating step, which includes: updating the search step length according to the gray value change rate, wherein the updated search compensation is negatively correlated with the gray value change rate.
[0088] For example, a search step size corresponding to the grayscale value change rate is determined within a preset grayscale value change rate-step size mapping relationship. This allows for increasing the search step size in areas where grayscale value changes gently and decreasing it in areas where grayscale value changes dramatically. This improves computational efficiency and allows for more accurate determination of skeleton point locations.
[0089] Step S406: Repeat the interception step, the retrieval step, the calculation step, and the step size update step to obtain a number of temporary skeleton points.
[0090] Repeating the interception step, the retrieval step, the calculation step and the step size update step can traverse the temporary skeleton points on the entire search line segment, which is conducive to determining the skeleton points located on the search line segment.
[0091] Step S407: Determine a skeleton point from the temporary skeleton points.
[0092] Exemplarily, the grayscale values of several temporary skeleton points are obtained, and the temporary skeleton point corresponding to the maximum grayscale value is taken as the skeleton point.
[0093] By adopting the above technical solution and an adaptive step size strategy, the search step size is adjusted according to the grayscale changes in the local area of the image. The step size is increased in areas with gentle grayscale changes and reduced in areas with drastic grayscale changes. This can improve the computational efficiency and more accurately determine the position of the skeleton points.
[0094] The present application embodiment discloses a method for preprocessing human eye reflection images. Figure 5 , the method comprising: Step S501: performing enhancement processing on the human eye reflection image according to the brightness value of the human eye reflection image to obtain a brightness distribution image.
[0095] The enhancement operation is used to enhance the contrast in some areas of the human eye reflection image.
[0096] Step S502: performing binarization processing on the brightness distribution image according to the grayscale value of the brightness distribution image to obtain a binary image.
[0097] Exemplarily, a classification threshold is set based on the grayscale value of the brightness distribution image. The brightness distribution image is binarized based on the classification threshold to obtain a binary image. Pixels with grayscale values greater than the classification threshold are set to a first value, and pixels with grayscale values less than the classification threshold are set to a second value, where the first value and the second value are different. For example, the first value is 1 and the second value is 0.
[0098] Step S503: performing dilation and erosion operations on the binary image to obtain a pre-processed human eye reflection image.
[0099] The dilation operation is used to expand the foreground area of a binary image outward. The foreground area refers to the inner and outer rings. The dilation operation can fill small depressions and holes at the edge of the cornea, making the cornea more complete.
[0100] The erosion operation is used to shrink the forward area in the binary image inward. The erosion operation can remove some burrs and small connected parts of the corneal edge, making the corneal edge smoother and more accurate.
[0101] By adopting the above technical solution, the human eye reflection image is preprocessed in a variety of different ways, which can better adapt to the complex changes of the human eye corneal image and improve the accuracy and efficiency of subsequent edge detection and corneal curvature radius calculation.
[0102] In the following embodiment, a method for generating a brightness distribution image will be described. This method can highlight the cornea area in the human eye reflection image, which is beneficial for subsequent edge detection. Therefore, the embodiment of the present application discloses a method for generating a brightness distribution image. Figure 6 , the method comprising: Step S601: Divide the human eye reflection image into at least two local areas, where the width of the local area is greater than the theoretical ring width.
[0103] Exemplarily, the human eye reflection image is divided into at least two rectangular blocks to obtain at least two local areas, and the width of each rectangular block is greater than the theoretical ring width.
[0104] Theoretical annular width refers to the theoretical maximum width of the corneal annular structure.
[0105] Step S602: Calculate and obtain the histogram corresponding to each local area.
[0106] A histogram is used to describe the brightness value of each pixel in a graphic.
[0107] Step S603: setting a brightness threshold corresponding to the histogram according to the brightness distribution in the histogram.
[0108] The brightness threshold includes a maximum brightness threshold and a minimum brightness threshold, and the maximum brightness threshold is greater than the minimum brightness threshold.
[0109] Exemplarily, the brightness value of each pixel in all histograms is obtained. The maximum and minimum brightness values among the brightness values are found. The average of the brightness values is calculated to obtain the brightness mean. If the difference between the brightness mean and the maximum brightness value is greater than a preset difference, the difference between the maximum brightness value and a preset brightness error is calculated to obtain a maximum brightness threshold; otherwise, the maximum brightness value is used as the maximum brightness threshold. If the difference between the brightness mean and the minimum brightness value is less than the preset difference, the sum of the minimum brightness value and the preset brightness error is calculated to obtain a minimum brightness threshold; otherwise, the minimum brightness value is used as the minimum brightness threshold.
[0110] In some other embodiments, the maximum brightness threshold and the minimum brightness threshold are preset empirical values.
[0111] Step S604: adjusting the histogram according to the brightness threshold to obtain a brightness distribution image.
[0112] For example, if there is a first pixel in the histogram such that the brightness value of the first pixel is greater than the maximum brightness threshold, the brightness value of the first pixel is adjusted to the maximum brightness threshold. If there is a second pixel in the histogram such that the brightness value of the second pixel is less than the minimum brightness threshold, the brightness value of the second pixel is adjusted to the minimum brightness threshold.
[0113] By adopting the above technical solution, while ensuring that the overall brightness distribution of the image does not change, by dividing the local area into appropriate areas and limiting the histogram contrast, the contrast of the local area is effectively enhanced, the details of the corneal edge are highlighted, and the adverse effects of the uneven reflection image of the human eye on subsequent processing are overcome, laying a good foundation for the accurate calculation of the corneal curvature radius.
[0114] In the following embodiment, after enhancing the contrast of the human eye reflection image, in order to improve the effect of edge detection, the brightness distribution image can also be binarized to highlight the corneal edge. Therefore, the embodiment of the present application discloses a method for generating a binary image. Figure 7 , the method comprising: Step S701: for a first pixel point in the brightness distribution image, obtain neighboring pixel points located in a range around the first pixel point, where the first pixel point is any pixel point in the brightness distribution image.
[0115] In some specific embodiments, a 5×5 rectangular neighborhood is set, and the first pixel point is located at the center of the rectangular neighborhood.
[0116] Step S702: Calculate the mean of the grayscale values of the first pixel and the neighboring pixels to obtain a mean grayscale value.
[0117] In some other embodiments, a weighted average is performed on the grayscale values of the first pixel and the neighboring pixels to obtain a mean grayscale value. The weight value corresponding to the first pixel is greater than the weight values corresponding to the neighboring pixels. The specific values of the weight values can be adjusted according to actual needs and are not specifically limited in this application.
[0118] Step S703: replacing the grayscale value of the first pixel in the brightness distribution image with the mean grayscale value to obtain a mean filtered image.
[0119] After the grayscale value of the first pixel is replaced by the mean grayscale value, the grayscale distribution of the brightness distribution image can be effectively smoothed, which is helpful for subsequent edge detection.
[0120] Step S704: Divide the mean-filtered image into several regional mean-filtered images.
[0121] The regional mean filtered images are rectangular images of the same shape.
[0122] Step S705: Obtain a binarization threshold corresponding to the regional mean filtered image according to the grayscale value distribution in the regional mean filtered image.
[0123] Exemplarily, the mean of the grayscale values of each pixel in the regional mean filtered image is calculated to obtain a binarization threshold corresponding to the regional mean filtered image.
[0124] For example, the mean of the grayscale values of each pixel in the regional mean filtered image is calculated. The standard deviation of the grayscale values of each pixel in the regional mean filtered image is calculated. A binarization threshold is calculated based on the mean and standard deviation. For example, assuming the binarization threshold is T, the mean is μ, and the standard deviation is σ, then T = μ + k1σ, where k is a preset negative number.
[0125] Step S706: performing binarization processing on the mean filtered image using the binarization threshold corresponding to each region mean filtered image to obtain a binary image.
[0126] Taking the mean-filtered image of the target region as an example, a binarization threshold of the mean-filtered image of the target region is taken, and the grayscale values of pixels whose grayscale values are greater than the binarization threshold are set to a first value, and the grayscale values of pixels whose grayscale values are less than the binarization threshold are set to a second value, where the first value and the second value are different. For example, the first value is 1 and the second value is 0.
[0127] By adopting the above technical solution, the cornea area is effectively separated from the background area, the cornea contour features are highlighted, and it is more adaptable to the complex local grayscale changes of the cornea image, thereby improving the accuracy and efficiency of subsequent edge detection.
[0128] In the following embodiments, edge detection is a very important step in the process of calculating the corneal curvature radius, which will affect the subsequent determination of the corneal edge and further affect the calculation of the corneal curvature radius. In order to improve the effect of edge detection, the embodiment of the present application discloses an edge detection method. Figure 8 , the method comprising: Step S801: Calculate the gradient of the pre-processed human eye reflection image to obtain a gradient distribution image.
[0129] The gradient distribution image is used to represent the gradient magnitude and gradient direction of each pixel in the image.
[0130] Exemplarily, a gradient operator is used to calculate the gradient amplitude and gradient direction of each pixel in the preprocessed human eye reflection image to obtain a gradient distribution image.
[0131] Step S802: Determine candidate edge points in the gradient distribution image.
[0132] For example, the gradient magnitudes of the current pixel are compared with those of its two adjacent pixels. If the current pixel's gradient magnitude is not the maximum of the three, the current pixel's gradient magnitude is suppressed to 0. Otherwise, the current pixel's gradient magnitude remains unchanged. A new pixel is selected along the gradient direction, and the above steps are repeated.
[0133] Step S803: setting a first classification threshold and a second classification threshold according to the local grayscale change distribution and the overall grayscale distribution of the preprocessed human eye reflection image, wherein the first classification threshold is greater than the second classification threshold.
[0134] The overall grayscale distribution refers to the grayscale distribution of pixels across the entire image. The local grayscale variation distribution refers to the grayscale distribution of pixels within a specific region of the image. For example, a local region image is formed based on the location of the candidate edge point. For example, a rectangular box is set. The candidate edge point is used as the geometric center of the rectangular box, and the rectangular box captures the local region image in the preprocessed human eye reflection image.
[0135] For example, based on the overall grayscale distribution of the preprocessed human eye reflection image, the mean of the grayscale values is calculated to obtain the global grayscale mean. Based on the overall grayscale distribution of the preprocessed human eye reflection image, the standard deviation of the grayscale values is calculated to obtain the global grayscale standard deviation. Based on the local grayscale variation distribution, the standard deviation of the grayscale values is calculated to obtain the local grayscale standard deviation. The local grayscale standard deviation is substituted into a preset function to obtain a classification threshold deviation. The preset function is an increasing function in its domain, meaning that the larger the local grayscale standard deviation, the larger the classification threshold deviation. The global grayscale mean, global grayscale standard deviation, and classification threshold deviation are calculated to obtain a first classification threshold. The difference between the global grayscale mean and the global grayscale standard deviation is calculated, and the difference between this difference and the classification threshold deviation is calculated to obtain a second classification threshold. A larger local grayscale standard deviation indicates more dramatic grayscale variations in the local area, requiring an appropriate increase in the threshold to better capture edges or details. Consequently, the classification threshold deviation will also be larger.
[0136] Step S804: Classify the candidate edge points according to the classification threshold to obtain strong edge points, weak edge points and non-edge points. The gradient of the strong edge point is greater than the first classification threshold, the gradient of the weak edge point is greater than the first classification threshold and less than the second classification threshold, and the gradient of the non-edge point is less than the second classification threshold.
[0137] Non-edge points will be considered as non-edge points, while strong edge points will be considered as edge points. Weak edge points need to be further judged in subsequent steps.
[0138] Step S805: retain the weak edge points connected to the strong edge points, and remove the weak edge points not connected to the strong edge points.
[0139] Connect adjacent strong edge points to form a smooth curve. If a weak edge point lies on the curve, it is retained. If it does not, it is removed. This effectively restores the broken corneal edge and maintains its continuity and integrity.
[0140] Step S806: Obtain inner ring data and outer ring data according to the strong edge points and the remaining weak edge points.
[0141] The coordinate information of the strong edge points and the coordinate information of the remaining weak edge points are counted to obtain the inner ring data and the outer ring data.
[0142] By adopting this technical solution, the first and second classification thresholds are set based on the local grayscale variation distribution and overall grayscale distribution of the preprocessed human eye reflection image. This effectively reduces false detections and missed detections, resulting in a more accurate and continuous corneal limbus image. This allows for greater precision and reliability when processing such detail-rich and complex images.
[0143] In the following embodiments, due to the nonlinear characteristics of the optical system itself, it is necessary to compensate the corneal curvature radius through the defocus parameter to improve the accuracy of the corneal curvature radius. Therefore, obtaining accurate defocus parameters is a very important step, so the embodiment of the present application discloses a method for generating defocus parameters. Figure 9 , the method comprising: Step S901: Obtain the distance value between the parallel light point and the symmetry center from the human eye reflection image to obtain the center distance value.
[0144] In this embodiment, two parallel light spots are provided on the outer ring. The center distance value refers to the distance between the parallel light spots and the symmetry axis of the two parallel light spots, wherein the symmetry axis passes through the center of the outer ring.
[0145] In real-world scenarios, the cornea can cause the focus to shift, causing the outer ring to shift position in the image reflected by the eye. Therefore, it is necessary to measure the impact of this shift.
[0146] Step S902: Calculate the current outer ring radius in the central symmetric direction in the human eye reflection image.
[0147] The current outer ring radius refers to the outer ring radius in the human eye reflection image.
[0148] Step S903: Obtain the ideal outer ring radius in the central symmetric direction.
[0149] The ideal outer ring radius refers to the outer ring radius in the image reflected by the human eye when no focus deviation occurs.
[0150] Step S904: Calculate the ratio of the current outer ring radius to the ideal outer ring radius to obtain a proportional coefficient.
[0151] For example, the current outer ring radius is recorded as R1, and the ideal outer ring radius is recorded as R2, and the proportional coefficient is R1 / R2.
[0152] Step S905: Obtain a defocus parameter according to the center distance value and the scale coefficient.
[0153] Exemplarily, the center distance value and the scale factor are combined to obtain the defocus parameter, that is, the defocus parameter is composed of the center distance value and the scale factor.
[0154] By adopting the above technical solution, it is proposed to use the proportional coefficient of the distance between the parallel light point and the center and the outer ring radius in the central symmetry direction as the defocus parameter, which can accurately capture the nonlinear characteristics of the optical system, thereby accurately compensating the measurement results and effectively solving the measurement error problem caused by defocus.
[0155] Based on the same inventive concept, the present application embodiment provides a corneal curvature radius calculation system, please refer to Figure 10, the system comprises: An acquisition module 1001 is configured to acquire a human eye reflection image set, image grayscale value, ring width value, grayscale value, brightness value, gradient, distance value, current outer ring radius, and ideal outer ring radius; Memory 1002, used to store the program of the above-mentioned corneal curvature radius calculation method; Processor 1003, the program in the memory can be loaded and executed by the processor to implement the above-mentioned corneal curvature radius calculation method.
[0156] By adopting the above technical solution, the human eye reflection image is preprocessed, and the edge of the preprocessed human eye reflection image is detected to obtain inner ring data and outer ring data. Skeleton points are generated based on the inner ring data and outer ring data, and the skeleton points are weighted to obtain skeleton points. Ellipse fitting is performed on the skeleton points to obtain the corneal curvature radius. The corneal curvature radius is compensated by the defocus parameter to improve the accuracy of the corneal curvature radius. The accuracy of the calculated value of the corneal curvature radius can be improved in a variety of ways. In addition, the geometric characteristics and physical properties of the cornea are fully considered, and the accuracy of the calculation is gradually improved by cooperating with each other, which is different from the simple and direct corneal curvature radius calculation method.
[0157] Those skilled in the art will clearly understand that for the sake of convenience and brevity, the division of the above-mentioned functional modules is only used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-mentioned systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0158] An embodiment of the present application provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute a method for calculating the corneal curvature radius.
[0159] Computer storage media include, for example, various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0160] Based on the same inventive concept, an embodiment of the present application provides an ophthalmometer, including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute a method for calculating the corneal curvature radius.
[0161] Those skilled in the art will clearly understand that for the sake of convenience and brevity, the division of the above-mentioned functional modules is only used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-mentioned systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0162] The above are all preferred embodiments of the present application and are not intended to limit the scope of protection of this application. Unless otherwise specified, any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features. In other words, unless otherwise specified, each feature is merely an example of a series of equivalent or similar features.
Claims
1. A method for calculating corneal curvature radius, characterized in that: The method comprises: Acquire a set of human eye reflection images, wherein the set includes human eye reflection images at different optical axis positions, wherein the human eye reflection images are obtained by reflecting a circular ring image from the cornea, and the reflected circular ring image includes an inner ring and an outer ring having the same center; Preprocessing the human eye reflection image to obtain a preprocessed human eye reflection image; Performing edge detection on the preprocessed human eye reflection image to obtain inner ring data and outer ring data in the human eye reflection image; Generate skeleton points of a circular ring according to the inner ring data and the outer ring data; Performing a weighted operation based on the image grayscale value and the ring width value at the location of the skeleton point to obtain a skeleton point weight; Performing ellipse fitting on the skeleton points according to the skeleton point weights to obtain an ellipse equation; Calculating the corneal curvature radius according to the geometric parameters of the ellipse equation; Obtaining a defocus parameter of the human eye reflection image in the human eye reflection image set; The corneal curvature radius is compensated according to the defocus parameter.
2. The method for calculating the corneal curvature radius according to claim 1, wherein: Generating skeleton points of a circular ring according to the inner ring data and the outer ring data includes: generating an inner ring ellipse equation according to the inner ring data; generating an outer ring ellipse equation according to the outer ring data; Obtaining a rough center according to the center coordinates of the inner ring ellipse equation and the center coordinates of the outer ring ellipse equation; Taking the rough center as the origin, a circumferential ray is formed, and the skeleton point is determined on the circumferential ray. The skeleton point is a point on the circumferential ray where the grayscale value changes the most. The skeleton point is located between the inner ring and the outer ring.
3. The method for calculating the corneal curvature radius according to claim 2, wherein: Determining the skeleton point on the circumferential ray includes: intercepting a search line segment between the inner ring ellipse and the outer ring ellipse on the circumferential ray; Executing a cutting step, the cutting step comprising: cutting an i-th search sub-segment on the search segment according to a search step, where i is a positive integer with an initial value of 1; Executing a retrieval step, the retrieval step comprising: obtaining an i-th temporary skeleton point corresponding to the i-th search sub-segment according to a change in the grayscale value on the i-th search sub-segment; Executing a calculation step, the calculation step comprising: calculating a grayscale value change rate within the i-th search sub-segment, the grayscale value change rate being used to describe a degree of grayscale value change within the i-th search sub-segment; Executing a step length updating step, the step length updating step comprising: updating the search step length according to the gray value change rate, wherein the updated search offset is negatively correlated with the gray value change rate; Repeating the interception step, the retrieval step, the calculation step, and the step size update step to obtain a plurality of temporary skeleton points; The skeleton point is determined from the plurality of temporary skeleton points.
4. The method for calculating the corneal curvature radius according to claim 1, wherein: The preprocessing of the human eye reflection image to obtain a preprocessed human eye reflection image includes: performing enhancement processing on the human eye reflection image according to the brightness value of the human eye reflection image to obtain a brightness distribution image; performing binarization processing on the brightness distribution image according to the grayscale value of the brightness distribution image to obtain a binary image; Performing dilation and erosion operations on the binary image to obtain the pre-processed human eye reflection image.
5. The method for calculating the corneal curvature radius according to claim 4, wherein: The step of enhancing the human eye reflection image according to the brightness value of the human eye reflection image to obtain a brightness distribution image includes: Dividing the human eye reflection image into at least two local areas, wherein the width of the local area is greater than the theoretical ring width; Calculate and obtain the histogram corresponding to each local area; According to the brightness distribution in the histogram, setting the brightness threshold corresponding to the histogram; The histogram is adjusted according to the brightness threshold to obtain the brightness distribution image.
6. The method for calculating the corneal curvature radius according to claim 4, wherein: The step of performing binarization on the image according to the grayscale value of the brightness distribution image to obtain a binary image comprises: For a first pixel point in the brightness distribution image, obtaining neighboring pixel points located within a range around the first pixel point, where the first pixel point is any pixel point in the brightness distribution image; Calculating the mean of the grayscale values of the first pixel and the neighboring pixels to obtain a mean grayscale value; Using the mean grayscale value to replace the grayscale value of the first pixel in the brightness distribution image to obtain a mean filtered image; Dividing the mean filtered image into a plurality of regional mean filtered images; Obtaining a binarization threshold corresponding to the regional mean filtered image according to a grayscale value distribution in the regional mean filtered image; The mean filtered image is binarized using the binarization threshold corresponding to each of the regional mean filtered images to obtain the binary image.
7. The method for calculating corneal curvature radius according to claim 1, wherein: The performing edge detection on the pre-processed human eye reflection image to obtain inner ring data and outer ring data in the human eye reflection image includes: Calculating the gradient of the preprocessed human eye reflection image to obtain a gradient distribution image; determining candidate edge points in the gradient distribution image; Setting a first classification threshold and a second classification threshold according to the local grayscale change distribution and the overall grayscale distribution of the preprocessed human eye reflection image, wherein the first classification threshold is greater than the second classification threshold; Classifying the candidate edge points according to the classification threshold to obtain strong edge points, weak edge points, and non-edge points, wherein the gradient of the strong edge points is greater than the first classification threshold, the gradient of the weak edge points is greater than the first classification threshold and less than the second classification threshold, and the gradient of the non-edge points is less than the second classification threshold; retaining weak edge points connected to the strong edge points, and removing weak edge points not connected to the strong edge points; Inner ring data and outer ring data are obtained according to the strong edge points and the remaining weak edge points.
8. The method for calculating corneal curvature radius according to claim 1, wherein: Two parallel light spots are provided on the outer ring; The obtaining of the defocus parameter of the human eye reflection image in the human eye reflection image set includes: Obtaining the distance value between the parallel light point and the symmetry center from the human eye reflection image to obtain a center distance value; Calculating a current outer ring radius in a central symmetric direction in the human eye reflection image; Obtaining the ideal outer ring radius in the central symmetric direction; Calculating a ratio of the current outer ring radius to the ideal outer ring radius to obtain a proportional coefficient; The defocus parameter is obtained according to the center distance value and the proportional coefficient.
9. A corneal curvature radius calculation system, characterized in that: The system for executing the method for calculating corneal curvature radius according to any one of claims 1 to 8 comprises: An acquisition module is used to obtain a set of human eye reflection images, image grayscale values, ring width values, grayscale values, brightness values, gradients, distance values, current outer ring radius, and ideal outer ring radius; A memory for storing a program for calculating the corneal curvature radius; The program in the memory can be loaded and executed by the processor to implement the corneal curvature radius calculation method.
10. An optometrist, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the method according to any one of claims 1 to 8.