A Method for Measuring Parameters of Defective Ellipse Based on Vision

Ellipse detection has a very wide range of applications in the field of object detection, especially in the geometric size detection of inclined microporous parts. However, due to the processing methods applied to the parts, there are certain defects in the features. The existing ellipse detection methods do not meet the needs of rapid detection due to the problems of false detection and time consumption. This article proposes a method of quickly obtaining defective ellipse parameters based on vision. It mainly uses the approximation principle of circles to repair defective circles, then combines this with morphological processing to obtain effective edge points, and finally uses the least squares method to obtain elliptical parameters. By simulating the computer-generated images, the results demonstrate that the center fitting error of the simulated defect ellipses with major and minor axes of 600 and 400 pixels is less than 1 pixel, the major and minor axis fitting error is less than 3 pixels, and the tilt angle fitting error is less than 0.1°. Further, experimental verification was conducted on the engine injection hole. The measurement results show that the surface size deviation was less than 0.01 mm and the angle error was less than 0.15°, which means the parameters of defective ellipses can obtained quickly and effectively. It is thus suitable for engineering applications, and can provide visual guidance for the precise measurement of fiber probes.


Introduction
With the development of the precision manufacturing industry and the increasing demand for technical indicators, micropore array structures combining the macro and micro scales have emerged in various high-performance devices, such as micropore arrays on aircraft engine injection disks with over 4700 micropores. The shape and size of the pores have a significant impact on the performance of the parts [1]. In the process of processing and usage, there may also be defects on the surfaces of micropores. The quality of microporous structure processing will determine the quality of the components, so the rapid detection of parameters is of great significance. Image methods, due to their ability to quickly obtain data, have great potential for use in visual measurement or multi-sensor fusion parameter measurement.
For a spatial aperture, when the imaging plane is not parallel to the plane where the aperture is located, the projection of the formed image on the camera imaging plane takes the form of an ellipse. The shape and size of the circular hole can be transformed from an ellipse, which means accurate acquisition of elliptical parameters is crucial. There are three general ellipse fitting algorithms, namely, the method of least squares, the method based on Hough transform, and the method based on arc segment extraction.
Ellipse fitting based on the least squares method is an optimal estimation technique that uses the maximum likelihood method to minimize the sum of squares of measurement

Camera Imaging Model
For the aperture to be measured, the camera is first used to obtain an image of the micropores. The projected image is an ellipse on the camera's imaging plane. To obtain the geometric information of the micropores, a perspective projection model of the geometric correspondence between the image points and the spatial object points needs to be established. The projection position p of any point P on the micropore in the image is the intersection of the line connecting the optical center O and point P with the image plane, as shown in Figure 1.
Sensors 2023, 23, x FOR PEER REVIEW 3 of 13 least squares method is used for ellipse fitting, which can obtain ellipse parameters quickly and accurately.

Camera Imaging Model
For the aperture to be measured, the camera is first used to obtain an image of the micropores. The projected image is an ellipse on the camera's imaging plane. To obtain the geometric information of the micropores, a perspective projection model of the geometric correspondence between the image points and the spatial object points needs to be established. The projection position p of any point P on the micropore in the image is the intersection of the line connecting the optical center O and point P with the image plane, as shown in Figure 1. Ow-XwYwZw is the world coordinate system. Oc-XcYcZc is the camera coordinate system. O1-xy is the imaging plane coordinate system. Oo-uv is the pixel coordinate system. The coordinates of point P in the world coordinate system are (Xwp, Ywp, Zwp). The coordinates in the camera coordinate system are (Xcp, Ycp, Zcp). The coordinates of point p in the imaging plane coordinate system are (xp, yp). In the pixel coordinate system, the coordinates are (up, vp). The formula of conversion from the world coordinate system point Pw (Xw, Yw, Zw) to the camera coordinate system imaging point Pc (Xc, Yc, Zc) is expressed as the following formula, where R is a rotated orthogonal matrix and T is a translation matrix: In the camera coordinate system, the optical center Oc of the camera is the origin, the Zc axis is the optical axis, the Xc axis is parallel to the imaging coordinate system's x-axis, and the Yc axis is parallel to the imaging coordinate system's y-axis. The vertical distance from the optical center Oc to the imaging plane O1−xy is the effective focal length f. According to the projection principle, the conversion model between the camera coordinate system and the imaging coordinate system can be expressed as follows: The matrix form can be expressed as follows: O w -X w Y w Z w is the world coordinate system. O c -X c Y c Z c is the camera coordinate system. O 1-xy is the imaging plane coordinate system. O o-uv is the pixel coordinate system. The coordinates of point P in the world coordinate system are (X wp , Y wp , Z wp ). The coordinates in the camera coordinate system are (X cp , Y cp , Z cp ). The coordinates of point p in the imaging plane coordinate system are (x p , y p ). In the pixel coordinate system, the coordinates are (u p , v p ). The formula of conversion from the world coordinate system point P w (X w , Y w , Z w ) to the camera coordinate system imaging point P c (X c , Y c , Z c ) is expressed as the following formula, where R is a rotated orthogonal matrix and T is a translation matrix: In the camera coordinate system, the optical center O c of the camera is the origin, the Z c axis is the optical axis, the X c axis is parallel to the imaging coordinate system's x-axis, and the Y c axis is parallel to the imaging coordinate system's y-axis. The vertical distance from the optical center O c to the imaging plane O 1−xy is the effective focal length f. According to the projection principle, the conversion model between the camera coordinate system and the imaging coordinate system can be expressed as follows: The matrix form can be expressed as follows: The coordinates of the origin O 1 of the imaging plane coordinate system in the pixel coordinate system are (u 0 , v 0 ), where dx and dy, respectively, represent the actual size of each pixel in the x and y directions. The point coordinates in the pixel coordinate system can be represented as follows: The matrix form of homogeneous coordinates is: From (1) to (5), it can be concluded that the relationship between the camera coordinate system and the pixel coordinate system is: Next, we can obtain the correspondence between the world coordinate system point Pw and the pixel coordinate system point p: We then normalize the focal lengths in the x and y directions in the equation, where f x and f y are equivalent focal lengths (f x = f/d x , f y = f/d y ).

Ellipse Fitting Based on Least Squares Method
Ellipse fitting based on the least squares method is an optimal estimation technique derived from the maximum similarity method when the random error is normal distribution [21], which reduces the sum of distances between all points to be fitted and the fitting curve to its minimum. The general form of an ellipse is: So the goal of the least squares method is to minimize the objective function f(A, B, C, D, E), which is defined as follows: Sensors 2023, 23, 6433

of 13
Then, the linear function is constructed through the extreme value theorem, and the ellipse parameters are solved by combining the constraint conditions. From the geometric properties of the ellipse, the parameters are: 2 +Cy e 2 +Bx e y e − 1) Among them, (x e , y e ) represents the center of the ellipse. (a, b) represent the major and minor axes of the ellipse, and ϕ is the inclination angle.
According to the principle of the least square method, too many outliers can lead to the random error not conforming to normal distribution, which will greatly affect the fitting effect.

A Defect Edge Repair Model and Evaluation Based on Approximate Circles
In the actual production and manufacturing of precision components, machining errors such as burrs may occur in the circular features to be measured due to processing methods, or significant errors may occur in the binary image results due to surface indentation. This can affect measurement accuracy during data fitting. The repair method for defective circles is mainly based on the principle that circles can be approximated as regular n-sided shapes. The schematic diagram is shown in Figure 2.
Among them, (xe, ye) represents the center of the ellipse. (a, b) represent the major and minor axes of the ellipse, and φ is the inclination angle.
According to the principle of the least square method, too many outliers can lead to the random error not conforming to normal distribution, which will greatly affect the fitting effect.

A Defect Edge Repair Model and Evaluation Based on Approximate Circles
In the actual production and manufacturing of precision components, machining errors such as burrs may occur in the circular features to be measured due to processing methods, or significant errors may occur in the binary image results due to surface indentation. This can affect measurement accuracy during data fitting. The repair method for defective circles is mainly based on the principle that circles can be approximated as regular n-sided shapes. The schematic diagram is shown in Figure 2. Based on this issue, this article proposes a circular edge repair method based on the principle of circle approximation. It is based on the edge sequences of a circle obtained through edge detection after binarization, and connects the edge sequence points in a straight line to remove the protruding parts. Finally, the region with the largest connected domain is taken as the repaired feature area. The schematic diagram of edge repair is shown in Figure 3.   Based on this issue, this article proposes a circular edge repair method based on the principle of circle approximation. It is based on the edge sequences of a circle obtained through edge detection after binarization, and connects the edge sequence points in a straight line to remove the protruding parts. Finally, the region with the largest connected domain is taken as the repaired feature area. The schematic diagram of edge repair is shown in Figure 3. BE 2CD Among them, (xe, ye) represents the center of the ellipse. (a, b) represent the major and minor axes of the ellipse, and φ is the inclination angle.
According to the principle of the least square method, too many outliers can lead to the random error not conforming to normal distribution, which will greatly affect the fitting effect.

A Defect Edge Repair Model and Evaluation Based on Approximate Circles
In the actual production and manufacturing of precision components, machining errors such as burrs may occur in the circular features to be measured due to processing methods, or significant errors may occur in the binary image results due to surface indentation. This can affect measurement accuracy during data fitting. The repair method for defective circles is mainly based on the principle that circles can be approximated as regular n-sided shapes. The schematic diagram is shown in Figure 2. Based on this issue, this article proposes a circular edge repair method based on the principle of circle approximation. It is based on the edge sequences of a circle obtained through edge detection after binarization, and connects the edge sequence points in a straight line to remove the protruding parts. Finally, the region with the largest connected domain is taken as the repaired feature area. The schematic diagram of edge repair is shown in Figure 3.    Firstly, the method obtains an ordered edge sequence of features from the feature map that need to be repaired, and then traverses the edge sequence so that the traversed edge point is a (x a , y a ), and its related point b (x b , y b ) is the edge point with a sequence number after it, and the following conditions are met: R is the repair radius. The edge repair algorithm is: C(x c , y c ) is the repair point, with its physical meaning being points a and b forming a single point on the line segment. We used the above method to process a regular hexagon, and included the Bresenham algorithm of computer graphics in the method's implementation when cutting. The results are shown in Figure 4. Firstly, the method obtains an ordered edge sequence of features from the feature map that need to be repaired, and then traverses the edge sequence so that the traversed edge point is a (xa, ya), and its related point b (xb, yb) is the edge point with a sequence number after it, and the following conditions are met: R is the repair radius. The edge repair algorithm is: min(y ,y ) < y < max(y ,y ) C(xc, yc) is the repair point, with its physical meaning being points a and b forming a single point on the line segment. We used the above method to process a regular hexagon, and included the Bresenham algorithm of computer graphics in the method's implementation when cutting. The results are shown in Figure 4.  From Figure 4, it can be seen that this method is based on the approximation principle of circles. The cutting part is shown in red in Figure 4b, and the repair result is shown in Figure 4c. It can be seen that this method can effectively cut the features of the approximate circle into circles, that is, repair the shape of the approximate circle in circles. The same applies when detecting an ellipse. After multiple repairs, a smooth ellipse can be obtained, which can be used as an approximate circular target. Therefore, the limit on the number of repairs can be evaluated using circularity. The definition of circularity a is [22]: Among them, S is the area of the target and C is the circumference of the target. When the target shape is closer to a circle, its value is closer to 1. Therefore, whether the difference in roundness between the two repairs is less than the given threshold T is used to determine whether the repair is completed.
After obtaining the target that approximates a circle, a morphological dilation algorithm is used to process the repaired image. During each dilation process, the intersection of the repaired and original images' edge points is recorded, and the part where the number of intersecting edge points increases due to each dilation is recorded. When the proportion of intersecting edge points exceeds the threshold, the dilation operation is stopped, and the edge point showing the largest increase in the number of intersecting From Figure 4, it can be seen that this method is based on the approximation principle of circles. The cutting part is shown in red in Figure 4b, and the repair result is shown in Figure 4c. It can be seen that this method can effectively cut the features of the approximate circle into circles, that is, repair the shape of the approximate circle in circles. The same applies when detecting an ellipse. After multiple repairs, a smooth ellipse can be obtained, which can be used as an approximate circular target. Therefore, the limit on the number of repairs can be evaluated using circularity. The definition of circularity a is [22]: Among them, S is the area of the target and C is the circumference of the target. When the target shape is closer to a circle, its value is closer to 1. Therefore, whether the difference in roundness between the two repairs is less than the given threshold T is used to determine whether the repair is completed.
After obtaining the target that approximates a circle, a morphological dilation algorithm is used to process the repaired image. During each dilation process, the intersection of the repaired and original images' edge points is recorded, and the part where the number of intersecting edge points increases due to each dilation is recorded. When the proportion of intersecting edge points exceeds the threshold, the dilation operation is stopped, and the edge point showing the largest increase in the number of intersecting points is taken as the effective edge point. By performing least squares ellipse fitting as described in the second section, the ellipse parameters can be obtained.

Simulation Experiment
To simulate and validate the method proposed in this article, a computer is first used to generate an ellipse with known parameters, as shown in Figure 5. The center position of the ellipse is (300, 400), the major and minor axes are (600, 400), and the tilt angle is 0 degrees. points is taken as the effective edge point. By performing least squares ellipse fitting as described in the second section, the ellipse parameters can be obtained.

Simulation Experiment
To simulate and validate the method proposed in this article, a computer is first used to generate an ellipse with known parameters, as shown in Figure 5. The center position of the ellipse is (300, 400), the major and minor axes are (600, 400), and the tilt angle is 0 degrees. We then add three types of defects to it. As shown in Figure 6, there are protruding defects, concave defects, and mixed defects.  Their respective fitting parameter results are shown in Table 1. From the simulation results shown in Figure 7 and Table 1, it can be seen that the method proposed in this article can effectively eliminate convex outliers and concave outliers, and obtain accurate ellipse parameters. The center fitting error of the generated defect ellipse with a major and minor axis of 600 and 400 pixels is less than 1 pixel, the major and minor axis fitting error is less than 3 pixels, and the tilt angle fitting error is less than 0.1°. We then add three types of defects to it. As shown in Figure 6, there are protruding defects, concave defects, and mixed defects. points is taken as the effective edge point. By performing least squares ellipse fitting as described in the second section, the ellipse parameters can be obtained.

Simulation Experiment
To simulate and validate the method proposed in this article, a computer is first used to generate an ellipse with known parameters, as shown in Figure 5. The center position of the ellipse is (300, 400), the major and minor axes are (600, 400), and the tilt angle is 0 degrees. We then add three types of defects to it. As shown in Figure 6, there are protruding defects, concave defects, and mixed defects.  Their respective fitting parameter results are shown in Table 1. From the simulation results shown in Figure 7 and Table 1, it can be seen that the method proposed in this article can effectively eliminate convex outliers and concave outliers, and obtain accurate ellipse parameters. The center fitting error of the generated defect ellipse with a major and minor axis of 600 and 400 pixels is less than 1 pixel, the major and minor axis fitting error is less than 3 pixels, and the tilt angle fitting error is less than 0.1°. points is taken as the effective edge point. By performing least squares ellipse fitting as described in the second section, the ellipse parameters can be obtained.

Simulation Experiment
To simulate and validate the method proposed in this article, a computer is first used to generate an ellipse with known parameters, as shown in Figure 5. The center position of the ellipse is (300, 400), the major and minor axes are (600, 400), and the tilt angle is 0 degrees. We then add three types of defects to it. As shown in Figure 6, there are protruding defects, concave defects, and mixed defects.  Their respective fitting parameter results are shown in Table 1. From the simulation results shown in Figure 7 and Table 1, it can be seen that the method proposed in this article can effectively eliminate convex outliers and concave outliers, and obtain accurate ellipse parameters. The center fitting error of the generated defect ellipse with a major and minor axis of 600 and 400 pixels is less than 1 pixel, the major and minor axis fitting error is less than 3 pixels, and the tilt angle fitting error is less than 0.1°. Their respective fitting parameter results are shown in Table 1. From the simulation results shown in Figure 7 and Table 1, it can be seen that the method proposed in this article can effectively eliminate convex outliers and concave outliers, and obtain accurate ellipse parameters. The center fitting error of the generated defect ellipse with a major and minor axis of 600 and 400 pixels is less than 1 pixel, the major and minor axis fitting error is less than 3 pixels, and the tilt angle fitting error is less than 0.1 • .

Experimentation
In order to verify the effectiveness of the algorithm when used in practical applications, the measurement system shown in Figure 8a is used to obtain part images. The base and Z-axis column of the measurement system are made of marble to ensure the stability of the system. The workbench can move along the x, y, and z axes, and there is a camera installed on the z axis. A PointGray model FL3-U332S2C-CS CCD camera (Point Grey Research, Richmond, BC, Canada) is used, and the NAVITAR 12× zoom combination lens is used. After calibration, the average reprojection error is about 0.05 pixels. The measured parts are two sub-millimeter inclined micropores. The images of large and small holes with defect features are shown in Figure 9, where elliptical defects can be clearly seen.

Experimentation
In order to verify the effectiveness of the algorithm when used in practical applications, the measurement system shown in Figure 8a is used to obtain part images. The base and Z-axis column of the measurement system are made of marble to ensure the stability of the system. The workbench can move along the x, y, and z axes, and there is a camera installed on the z axis. A PointGray model FL3-U332S2C-CS CCD camera (Point Grey Research, Richmond, BC, Canada) is used, and the NAVITAR 12× zoom combination lens is used. After calibration, the average reprojection error is about 0.05 pixels. The measured parts are two sub-millimeter inclined micropores. The images of large and small holes with defect features are shown in Figure 9, where elliptical defects can be clearly seen. Firstly, an image segmentation method based on image gradient information is used to obtain the elliptical feature positions for the part image. Then, based on the microhole's features, they are binarized. The results are shown in Figure 10b.

Experimentation
In order to verify the effectiveness of the algorithm when used in practical a tions, the measurement system shown in Figure 8a is used to obtain part images. T and Z-axis column of the measurement system are made of marble to ensure the s of the system. The workbench can move along the x, y, and z axes, and there is a installed on the z axis. A PointGray model FL3-U332S2C-CS CCD camera (Point G search, Richmond, BC, Canada) is used, and the NAVITAR 12× zoom combination used. After calibration, the average reprojection error is about 0.05 pixels. The me parts are two sub-millimeter inclined micropores. The images of large and sma with defect features are shown in Figure 9, where elliptical defects can be clearly s  For defect images, certain methods must be used to remove the edge of the defect, otherwise fitting it will result in incorrect fitting results, as shown in Figure 10c. Therefore, this article proposes a defect circle repair method, as shown in Section 2, which repairs the binary image shown in Figure 10b multiple times, as shown in Figure 11. For the repair of defect images, the roundness threshold for the repair cutoff is set as 1.24, based on the experimental results. Finally, both the small and large holes were repaired up to the fourth stop.  For defect images, certain methods must be used to remove the edge of the defect, otherwise fitting it will result in incorrect fitting results, as shown in Figure 10c. Therefore, this article proposes a defect circle repair method, as shown in Section 2, which repairs the binary image shown in Figure 10b multiple times, as shown in Figure 11. For the repair of defect images, the roundness threshold for the repair cutoff is set as 1.24, based on the experimental results. Finally, both the small and large holes were repaired up to the fourth stop.  For defect images, certain methods must be used to remove the edge of the defect, otherwise fitting it will result in incorrect fitting results, as shown in Figure 10c. Therefore, this article proposes a defect circle repair method, as shown in Section 2, which repairs the binary image shown in Figure 10b multiple times, as shown in Figure 11. For the repair of defect images, the roundness threshold for the repair cutoff is set as 1.24, based on the experimental results. Finally, both the small and large holes were repaired up to the fourth stop.  Next, we performed a dilation operation on the binarized image, and a schematic diagram of the dilation operation is shown in Figure 11. Figure 12 represents the difference between the corresponding repaired image and the original image to indicate their intersection. The green part represents the difference between the original image and the repaired image, and the red part represents the difference between the repaired image and the original image. The increase in the number of edge points at each intersection is shown in Figure 13. Next, we performed a dilation operation on the binarized image, and a schematic diagram of the dilation operation is shown in Figure 11. Figure 12 represents the difference between the corresponding repaired image and the original image to indicate their intersection. The green part represents the difference between the original image and the repaired image, and the red part represents the difference between the repaired image and the original image. The increase in the number of edge points at each intersection is shown in Figure 13.  Next, we performed a dilation operation on the binarized image, and a schematic diagram of the dilation operation is shown in Figure 11. Figure 12 represents the difference between the corresponding repaired image and the original image to indicate their intersection. The green part represents the difference between the original image and the repaired image, and the red part represents the difference between the repaired image and the original image. The increase in the number of edge points at each intersection is shown in Figure 13.  From the bar chart, for small holes, we select the edge coverage point increased by the third expansion with the highest increment as the effective edge point. For large holes, we still select the edge coverage point increased by the third expansion as the effective edge point, and the corresponding edge points are shown in Figure 14.
Sensors 2023, 23, x FOR PEER REVIEW 10 of 13 Next, we performed a dilation operation on the binarized image, and a schematic diagram of the dilation operation is shown in Figure 11. Figure 12 represents the difference between the corresponding repaired image and the original image to indicate their intersection. The green part represents the difference between the original image and the repaired image, and the red part represents the difference between the repaired image and the original image. The increase in the number of edge points at each intersection is shown in Figure 13.  We performed the least squares ellipse fitting described in the second section on the elliptical hole after edge repair, and the fitting results are shown in Figure 15. We performed the least squares ellipse fitting described in the second section on the elliptical hole after edge repair, and the fitting results are shown in Figure 15. For the evaluation of the measurement results yielded by the method proposed in this article, we used the OGPMVP200 (Quality Vision International, Inc, Rochester, NY, USA) measuring instrument to fit the same measured holes, and compared them with the measurement results derived with the method proposed in this article. The measurement data obtained are shown in Table 2. From Table 2, it can be seen that the inspection objects are all qualified products. The first row shows the results of the large and small holes measured by OGP. The first row, second column, and third column show the machining dimensions of the small circle and the fitting results of OGP, respectively. The first row, fourth column, and fifth column show the machining dimensions of the large circle and the fitting results of OGP, respectively. The second row shows the measurement results yielded by this method. The actual machining size of the small hole is 1.9 mm in diameter, with a tolerance of 0.05 mm. The machining inclination angle is 26°, and the actual machining size of the large hole is 2.3, with a tolerance of 0.05 mm. From the fitting results of the first line OCP, it can be seen that due to the presence of surface defects, the measurement results of the large and small holes obtained by the OGP measuring instrument are larger than the size of the workpiece. The diameters of the processed large and small circles are 1.9 mm and 2.3 mm, respectively, with a size error of about 0.1 mm and a maximum angle error of 0.8°. However, the algorithm proposed in this article produces results with a size error of less than 0.01 mm and an angle error of less than 0.15°, thus meeting the measurement requirements. From this, we can see the effectiveness and accuracy of the method proposed in this paper.

Conclusions
This article proposes a defect ellipse edge repair and fitting method based on vision for the rapid measurement of array micro oblique holes with defects such as scratches and burrs. Firstly, an edge repair algorithm is designed using the approximation principle of For the evaluation of the measurement results yielded by the method proposed in this article, we used the OGPMVP200 (Quality Vision International, Inc, Rochester, NY, USA) measuring instrument to fit the same measured holes, and compared them with the measurement results derived with the method proposed in this article. The measurement data obtained are shown in Table 2. From Table 2, it can be seen that the inspection objects are all qualified products. The first row shows the results of the large and small holes measured by OGP. The first row, second column, and third column show the machining dimensions of the small circle and the fitting results of OGP, respectively. The first row, fourth column, and fifth column show the machining dimensions of the large circle and the fitting results of OGP, respectively. The second row shows the measurement results yielded by this method. The actual machining size of the small hole is 1.9 mm in diameter, with a tolerance of 0.05 mm. The machining inclination angle is 26 • , and the actual machining size of the large hole is 2.3, with a tolerance of 0.05 mm. From the fitting results of the first line OCP, it can be seen that due to the presence of surface defects, the measurement results of the large and small holes obtained by the OGP measuring instrument are larger than the size of the workpiece. The diameters of the processed large and small circles are 1.9 mm and 2.3 mm, respectively, with a size error of about 0.1 mm and a maximum angle error of 0.8 • . However, the algorithm proposed in this article produces results with a size error of less than 0.01 mm and an angle error of less than 0.15 • , thus meeting the measurement requirements. From this, we can see the effectiveness and accuracy of the method proposed in this paper.

Conclusions
This article proposes a defect ellipse edge repair and fitting method based on vision for the rapid measurement of array micro oblique holes with defects such as scratches and burrs. Firstly, an edge repair algorithm is designed using the approximation principle of circles, and then the repair process is evaluated. Furthermore the repaired edges are obtained by firstly using morphological processing methods to obtain effective edge points of the ellipse to be fitted, which can effectively remove protruding outliers and concave outliers from the edge of the ellipse, and then use the least squares method is used to obtain effective ellipse parameters. This method is simple and effective in implementation, and can quickly obtain the parameters of defect ellipses. Through simulation and experiments, it can be determined that for oblique microwell images of 1920 × 1080 pixels, the dimensional variation measured by this method is less than 0.01 mm, and the angle error is less than 0.15 • , which meets the accuracy requirements of an actual measurement. This method proposed in this article has a high measuring speed, which makes it suitable for engineering applications. In subsequent measurements, it can provide visual guidance for the precise measurement of fiber probes.