Measuring the Ocular Morphological Parameters of Guinea Pig Eye with Edge Detection and Curve Fitting

Aim To identify the guinea pig eyeball with edge detection and curve fitting and devise a noncontact technology of measuring ocular morphological parameters of small experimental animal. Methods Thirty-nine eyeballs of guinea pig eyeballs were photographed to obtain the anterior and posterior surface; transverse and sagittal planes after the eyeballs were eviscerated. Next, the eyeball photos were input into digital image analysis software; the corresponding photo pixels-actual length ratio was acquired by a proportional scale. The contour lines of the eyeballs were identified by edge detection technology; conic curve fitting was applied to fit the contour line of the eyeball. The maximum and minimum diameters, the horizontal and vertical diameters, eccentricity, tilt angle, cross-sectional area, equatorial circumference, retrobulbar equatorial maximum length, corneal radius of curvature (CRC) in central region, and the whole cornea were calculated according to the geometric principles. The corneal data of in vitro study were compared with the in vivo results. Results The contour line of the selected guinea pig eye was identified correctly by edge detection. There were no significant differences between anterior and posterior surfaces of one eyeball in the maximum diameters, eccentricity, cross-sectional area, equatorial circumference, and tilt angle (P > 0.01). There were significant differences of eccentricity and CRC between central region and the whole cornea (P < 0.01). There were no significant differences between keratometer in vivo and cornea in vitro. Conclusion It was feasible to measure an experimental animal eye in a noncontact way. Edge detection and curve fitting technology could accurately evaluate the ocular morphological parameters.


Introduction
Guinea pigs have been introduced as a promising animal model in recent years [1][2][3]. They are cooperative, inexpensive, and easy to handle. Thus, the guinea pigs have been regarded as an appropriate object for the study of environmental factors involved in refraction development [3][4][5]. However, the ocular morphological data measurement processed in small animals like guinea pigs is still a difficult task. The guinea pig eye is merely one-third the size of the human eye, and the corneal radius of curvature (CRC) is much steeper and out of the range of conventional keratometry (Figure 1(a)). Because of this, Norton and McBrien [5][6][7] proposed to measure the CRC with a plus 8.0 D aspherical lens. A set of stainless steel ball-bearings was used for calibration (Figure 1(b)). Nevertheless, the guinea pig was poorly cooperated during measuring, which inevitably led to unreliable results (Figure 1(c)). Similarly, the axial length measurement of guinea pig usually involved topical anesthesia due to the high fatality rate of general anesthetics [8,9]. Such a measurement in the waking state required higher skills for the manipulator. The ultrasound probe could not reliably be set completely perpendicular to the corneal center. The eyeball would be compressed during contact measurement (Figure 1(d)). All these factors impacted the accuracy of the final result.
Given the difficulty of measuring in vivo, a better choice was to eviscerate the eyeball and assess a fully exposed eyeball statically. Nevertheless, the eyeball in vitro was very soft and easy to be compressed if any contact measurement was applied (Figure 1(e)). Moreover, the eyeball shape in coronal plane was similar to a tilt ellipse, and the symmetry axis was difficult to determine (Figure 1(f)). Thus, some valuable morphological parameters, such as eccentricity, cross-sectional  Computational and Mathematical Methods in Medicine area, equatorial circumference, and the maximum and minimum diameters, would be unavailable. Therefore, it was very necessary to develop a noncontact measuring method with digital image processing technology. In this respect, matrix laboratory, as a numerical computing environment and programming language [10][11][12], produces two-dimensional graphics and supports developing applications with graphical user interface features. Edge detection and curve fitting technologies are both significant mathematical methods in the areas of computer vision [13,14]. The former identifies points in a digital image at which the image brightness changes sharply [15], while the latter is in the process of constructing a curve which has the best fit to a series of data points [16,17]. Curve fitting technology can determine the best visual fit of circular or elliptical arcs, such as the contour of an eyeball, and then transformed the edge information into a curve equation [18,19]. In doing so, a mathematical model is developed, with a series of geometrical principles are utilized.
Our current study designed a series of methods to identify the image of the guinea pig eye with digital image processing technology and proposed a noncontact approach to measure ocular morphological parameters without artificial factors. Our work is presented as follows.

Animals and Biometric Measurements In Vivo
Twenty-one guinea pigs (English short hair stock, tricolor strain, three weeks of age) were obtained from the laboratory of Fudan University. Totally, there are thirty-nine eyeballs (right: 18, left: 21). No corneal diseases were observed in a slit lamp. This current study was carried out in strict accordance with the recommendations in the Guide for the Care and Use of Laboratory Animals of the National Institutes of Health. Our work has been approved by the Institutional Animal Care and Use Committee. All surgery was performed under sodium pentobarbital anesthesia, and all efforts were made to minimize suffering. The radius of corneal curvature (CRC) was measured in alert guinea pigs with a keratometer (OM-4; Topcon, Tokyo, Japan) combined with a plus 8.0 D aspherical lens. A set of stainless steel ball-bearings was used for calibration. The CRC for each animal was measured in triplicate ( Figure 1(b)).

Numerical Simulation Techniques of the
Eyeball Photo In Vitro 3.1. Method of Actual Length-Photo Pixels Conversion. A 13megapixel digital camera (Macro Mode) was fixed with a 10 cm brace over a platform with a pure white background.
The length × width of the photos was 3120 × 4280 pixels. After the selected photos were input into the MATLAB software, they were equivalent to a two-dimensional coordinate system with x-coordinates 0-3120 and y-coordinates 0-4280 ( Figure 2(a)). We get the access to the MATLAB license which is authorized by Shanghai Jiaotong University.
First, one calibrated scale was placed horizontally in the center of the platform and elevated by 5 mm, which was equivalent to the height of the guinea pig eye center. The calibrated scale photo was input into two-dimensional graphics. Two points (m 1 , n 1 ) and (m 2, n 2 ), which were 1 mm apart in the calibrated scale center, were selected with the getpts function. According to the principle of geometry, the distance of any two points, (m 1 , n 1 ) and (m 2, n 2 ), in the coordinate system could be computed (formula: ). In this way, the corresponding pixels of actual 1 mm distance in the center could be available.
To improve the accuracy of the conversion ratio, ten contiguous 1 mm distances,L 1 , L 2 , L 3 :⋯L 10 , in the center of the calibrated scale were selected. The average number of pixels was calculated. Thus, the corresponding pixels of actual 1 mm distance in the center were L 1mm = ðL 1 + L 2 + L 3 +⋯:+ L 10 Þ/10. In doing so, the distance between any two points in the center of the photo could be converted to the actual distance by this ratio-coefficient ( Figure 2(b)). To verify the accuracy of this coefficient, 10 mm, 4 mm, and 12 mm actual lengths in the center were randomly selected, and the computed results were compared.
Because all the photos were obtained from one camera and saved as the same size, the position was fixed. Therefore, the ratio-coefficient (0.0253) was also applicable to all the following eyeball photos.
3.2. Acquisition of Ocular Edge Data. First, the guinea pig was sacrificed. A point was marked by a glowing needle tip at the top of the corneoscleral limbus before eviscerating the eyeball. Next, the eyeball was removed, and the bulbar conjunctiva was excised. Afterward, the eyeball was placed in the center of the platform and shoot with a camera from four directions: anterior and posterior surface and transverse and sagittal plane. The center of the platform was slightly pitted for fastening. Canny edge detection algorithm was applied to obtain the dual-threshold value image. The points at which the image brightness changed sharply were organized into a set of curved line segments termed edges (Figures 3(e) and 3(f)). Further, the nontarget edge was removed, and merely, the eyeball edge was reserved. The images were saved; then, the find function was used to acquire the coordinate data of the eyeball edge including coronal and horizontal views in the 3120 × 4280 coordinate system. The illustration is shown in Figure 3; only the parts of coronal and transverse plane were presented for convenience.
The formula of the tilt angle was: In such a way, the central point and the tilt angle of the eyeball in the coronal view could be calculated (Figures 4(a) and 4(b)).

Calculation of the Maximum and Minimum Diameters.
Given the tilt angle of an ellipse, the slope of the major axis was k aa = tan ð90 ± angleÞ, and the slope of the minor axis was k bb = −1/k aa .
Given the central point (Xc, Yc) and the two slopes of the axis (k aa , k bb ), the line equations (y = kx + b) of the two axes were both available ( Figure 4 Given the linear equations of the two axes and the ellipse equation, we solved the binary quadric equations with the solve function: The results were two points (x 1 , y 1 ) and (x 2 , y 2 ) which were the intersections of the symmetry axis and ellipse. The pixel distance between (x 1 , y 1 ) and (x 2 , y 2 ) was: In this way, the line lengths within the ellipse, namely, the maximum and minimum diameters (L aa , L bb ), of the eyeball in the coronal view were obtained. After the actual lengthphoto pixel conversion, the actual lengths of the maximum and minimum diameters were both available (formula: L actual = L aa ðor L bb Þ/L 1mm ).

Computational and Mathematical Methods in Medicine
The equatorial circumference (C) was: The cross-sectional area (S) was:

Calculation of the Horizontal and Vertical Diameters.
Because the horizontal and vertical lines both passed through the center of the ellipse (Xc,Yc), we can calculate the horizontal and vertical diameters. The system of binary quadric equations was solved with the solve function.
Formula : y = Yc, The results were two points which were the intersections of the horizontal line and ellipse. Similarly, the equations: Formula : x = Xc, The results were the intersections of the horizontal or vertical line with ellipse (Figures 4(c) and 4(d)).
The distance between (x 1 , y 1 ) and (x 2 , y 2 ) was also computed by the formula: After the actual length-photo pixel conversion, the length of horizontal and vertical diameters could be calculated.
Through above methods, the morphological parameters of the eyeball were obtained. To assess the accuracy of this measurement, paired t-test was chosen to compare the maximum and minimum diameters, eccentricity, horizontal diameter, vertical diameter, cross-sectional area, and equatorial  (Table 1).

Calculation of Eccentricity, CRC, and Corneal Curvature.
According to the definition of CRC, the central 3 mm region of the cornea was similar to a circle whose radius was the CRC. However, a guinea pig's eyeball is only one-third the size of the human eye. To evaluate the impact of corneal aspherical feature, the conic equation (Ax 2 + Bxy + Cy 2 + Dx + Ey + F = 0) was applied first to fit the central region of the cornea (3 mm) and the whole cornea (6 mm) in transverse and sagittal plane. The eccentricity can be obtained from the fitted ellipse. In the present study, the nlinfit and round function were applied to the circle to fit the central region and the whole cornea. These two fitting curves were compared; the radius of the fitting circle was the CRC. Then, the actual CRC and corneal curvature could be calculated (Formula: R actual = R × 1/L 1mm ).

Comparison of Ocular Morphological Parameters between Anterior and Posterior
Surface of the Eyeball. The results of ocular morphological parameters between anterior and posterior surface of the eyeball are shown in Table 1. There were no significant differences between anterior and posterior surface of one eyeball in the maximum and   Computational and Mathematical Methods in Medicine minimum diameters, eccentricity, cross-sectional area, and equatorial circumference (paired t-test, P > 0:01). Similarly, there was no statistically significant difference between the angle long axis of anterior surface and 180°-angle long axis of posterior surface (P > 0:01). The comparison of ocular morphological diameters is shown in Figure 6. Figure 7(a), after conic curve fitting, the whole cornea was similar to an ellipse. Meanwhile, the central region of the cornea was more like a circle. The eccentricity, CRC, and corneal curvature were compared; significant differences were found between central cornea and whole cornea region (paired t-test, P < 0:01). The results are shown in Table 2.

Comparison of Corneal Curvature In Vivo with
Keratometer and CRC In Vitro with Numerical Simulation. The comparison of corneal curvature in vivo with keratometer and corneal curvature in vitro with numerical simulation is shown in Figure 8. The corneal curvature in vivo with keratometer in the transverse and sagittal plane was 100:5 ± 12:5 D and 103:8 ± 9:9 D, respectively. There was no significant difference between keratometer in vivo and cornea in vitro (paired t-test, P > 0:05).

Scale Conversion Ratio of Photo Pixels and the
Corresponding Actual Length. The present study proved it was feasible to identify and digitally measure an experimental animal eye using a noncontact approach. As shown in Figure 5, the lengths in a real scale were randomly selected. After a ratio conversion, the distances of two points in the photo were 10.0142 mm (approximately 10 mm), 4.0000 mm (approximately 4 mm), and 11.9794 mm (approximately 12 mm). Therefore, the conversion result was believable. To measure the eyeball as accurately as possible, the resolution of the photos needed to be sufficiently high. It was even more important to obtain the scale conversion ratio of the photo pixels and the corresponding actual length as correctly as possible. To achieve this, it was necessary to place a proportional scale in the photo. However, if the scale was placed beside the eyeball, the image might be deformed outside of the central region because of the very close object distance. Moreover, if every eyeball photo was required to calculate the scale conversion ratio, the computing process would be inefficient, and the results would be inevitably influenced in the end. To resolve this problem, the current method fixed the resolution ratio of the photo and made sure the shooting position was fixed. In this way, the scale conversion ratio was obtained by placing the proportional scale in the center and the ratio applied to the subsequent eyeball photos. Therefore, the efficiency was significantly improved. Furthermore, our study selected ten 1 mm distances in the center of the photo and calculated the average number of pixels. The scale ruler was elevated by 5 mm high, which was equivalent to the center height of the guinea pig eye. All these designs helped to ensure the reliability of measurement results.

Edge Detection Technology in Ocular Morphological
Measurement. Edge detection comprises a set of mathematical approaches that aimed at identifying points in a digital image at which the image brightness changed strikingly [20]. Edge detection had been widely applied in various computer vision systems, as it is an important technique to extract useful structural information from different vision objects and dramatically reduced the amount of data processed [15,16,21]. As shown in Figure 3(a)-3(b), the eyeball was placed on a white background. After edge detection,  Computational and Mathematical Methods in Medicine the points at which image brightness changed sharply were organized into a set of curved line segments termed edges (Figures 3(c) and 3(d)). Then, the nontarget edge was removed, and the edge of eyeball could be identified accurately. There are multiple edge detection algorithms including "Sobel", "Canny", "Prewitt", "Roberts", and "Log" [15]. The Canny edge detector was developed by John F. Canny in 1986 [22]. It uses a multistage algorithm to detect a wide range of edges in images. Evidently, the clarity of the picture will obviously affect the accuracy of the measurement. Besides, too much illumination can lead to shadows, and the edge will be blurry instead. Thus, a disperse illumination is recommended.

Curve Fitting Method with the Least Squares.
In the present study, the contour edge of the eyeball in the coronal plane was a tilt ellipse. In mathematics, the conic section (syntax: A x 2 + Bxy + Cy 2 + Dx + Ey + F = 0) is a curve obtained with the intersection of a cone with a plane. Conic sections have cer-tain spherical properties that make them a meaningful expansion set for the description of general arc curves such as corneal surfaces in the fields of optical engineering and physiological optics [23]. According to the principle of geometry, the central point, the tilt angle, and the maximum and minimum diameters of the eyeball in the coronal view could be calculated. Therefore, some valuable parameters, such as eccentricity, cross-sectional area, and equatorial circumference, which could not be acquired in the past, could be analyzed.
In the current study, curve fitting technique was proved to be a practical method to fit the contour edge of guinea pig's eyeball. After edge detection, the contour edge of the eyeball was merely consisted of a series of adjacent data points (Figures 3(e) and 3(f)), which could not be analyzed directly [24]. In the field of data visualization, least square is a method of fitting a curve to data points to minimize the sum of the squares of the distances of the points from the curve [25]. Curve fitting constructs an optimal fitting curve based on the least squares [26]. On the coronal plane, the  11 Computational and Mathematical Methods in Medicine morphological parameters between the anterior and posterior surface of the eyeball were compared; no significant differences were found between the maximum diameter, crosssectional area, equatorial circumference, and horizontal and vertical diameters. Nevertheless, the difference between the minimum diameter and the eccentricity was statistically significant, but the standard deviation of the data set was small. The reason may be related to the protrusion of residual optic disc on posterior surface. Besides, the tilt angles of the maximum diameter between the anterior surface and posterior surface were complementary, indicating the eyeballs in the two photos were mirror-symmetric. The results were satisfactory overall.

Calculation of the CRC with Mathematical Simulation.
According to the definition of the radius of the circle (CRC) in the human eyes, the central 3 mm region of the cornea is similar to a circle [27]. Thus, circle fitting was used to fit the surface of the cornea after edge detection, and then, the actual CRC could be calculated by ratio-coefficient. Because the eyeball was already taken out and placed in a horizontal position, the data of the CRC were more credible compared with the data measured by a keratometer in vivo. The standard deviation of the data measured by keratometer was proved more obvious than standard deviation of mathematical simulation. Meanwhile, the CRC from the whole cornea was larger than the CRC from the central region of the cornea (Figures 7(b) and 7(d)). The cornea of the guinea pig was aspheric, which was the same as the cornea of the human.
In mathematics, the eccentricity, abbreviated as e, is a useful indicator associated with every conic section. It is a measure of how much the conic section deviates from being circular. The eccentricity of a circle is zero; the eccentricity of an ellipse that is not a circle is greater than zero but less than 1. Corneal eccentricity is regarded as a helpful indicator in the diagnosis of keratoconus in humans [28]. In the present study, conic fitting was used to fit the central region and the whole cornea. Significant differences were found between central cornea and whole cornea region. Apparently, the cornea of a guinea pig was similar to the cornea of a human. The central region is close to a circle, while the peripheral regions are relatively smooth.
The shortcoming of this method was it focused on the eyeball in vitro; thus, the changes in the eyeball could not be observed through a longitudinal study. In addition, the computational process was relatively complex. Nevertheless, such a method could offset the lack of instrument and software which aimed at small animal eyeballs in experimental research. This method used a noncontact measuring technology, and there were fewer artificial factors. The numerical computing and implementation of algorithms in a numerical computing environment could determine some valuable parameters, such as the eccentricity, equatorial circumference and cross-sectional area, and the maximum and minimum diameters. Therefore, this digital image processing technology is more accurate and credible compared to conventional measurements.

Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
The authors declare that they have no conflicts of interest.

12
Computational and Mathematical Methods in Medicine