Ellipse Fitting of Planar Points with Outliers
Version 1.0.0 (182 MB) by
Siyu Guo
Provided in this repository are the program and data files relevant to a novel ellipse fitting algorithm.
BRIEF DESCRIPTION
Provided in this repository are the program and data files used in Ellipse Fitting of Planar Points with Outliers Using Random Samples Filtered by Fitting Qualities.
ALGORITHM PROGRAMS
The main program file for ellipse fitting is "ellfit.m". It is a capsule program incorporting the individual ellipse fitting algorithms used in the paper. These individual algorithm files are as follows:
1. ellfit_adaransac.m - This is the proposed algorithm.
2. ellfit_M5PEF.m, ellfit_LMedS.m, ellfit_LMedSOR.m, ellfit_WOLSF.m, ellfit_MAGE.m, ellfit_ADMM.m, and ellfit_EDFE.m - These are the rival algorithms used in the comparison experiments.
There are also some auxiliary programs such as isellipse.m, alge2ell.m, etc.
Please note that the program ell_match_errs.m, which calculates the fitting errors between two ellipses, calls indirectly the MEX executable ci_mex.mexw64, built for Windows 64-bit platforms. For other platforms, please use the CPP source ci_mex.cpp to generate this executable through mex command.
DATA SETS
1. The synthetic data sets for ellipse fitting tests
data_noise1.mat, data_noise5.mat, and data_noise10.mat are the original synthetic data files with noise levels of 0.01, 0.05 and 0.1, respectively. The points are stored in the data variable, specificly, in the cell arrays as the data field in the variable. The cell arrays are all of the size of 20 groundtruths x 3 different numbers of points, namely, 50, 100, and 200 points.
gtEllipses.mat stores the true canonical parameters of the 20 groundtruth ellipses in the 5x20 matrix eps.
algComparisonSet.mat is a subset of the original synthetic data, consisting of 6912 randomly selected point sets, used in the comparison experiments of the algorithms. These point sets are stored in the testSet variable. The canonical parameters of the groundtruth ellipse of each point set are stored alongside as the gt field of the testSet struct.
2. The image data sets
The images are stored in the subdirectory ./images/.
The edge pixels of the elliptical objects in these images along with significant number of outliers and the groundtruth ellipses are stored in the imageData.mat as variables data and gt, respectively.
EXPERIMENT PROGRAMS
1. Programs for experiments on the synthetic data sets
These programs are named as [AlgName]_comparison_set_experiment.m. They have neither inputs nor outputs. For example, to test the EDFE algorithm on the subset algComparisonSet, simply use the following call
>> EDFE_comparison_set_experiment;
The ellipse fitting results are stored in the MAT file [AlgName]_comparison_set_result.mat.
Please note that these experiments are generally time consuming. Some may take hours to finish.
2. The program for the experiment on the image data set
image_set_experiment.m is the 0-input-0-output program for comparisons of the algorithms on the image data set. The ellipse fitting results are store in the MAT files [AlgName]_image_set_result.mat.
EXPERIMENTAL RESULT DATA FILES
We provide in the repository a sample set of the experimental results in case the users may wish to save time. These MAT files are named as stated above.
RESULT DATA ANALYSIS PROGRAMS
1. The retrieve_result_performance.m program extract the time and matching error performance data of each execution of the given algorithm. The program is called in the following way:
P = retrieve_result_performance(FITTING_RESULT_FILE_NAME, PERFORMANCE_METRIC_NAME)
where P is a matrix of the performance metrics with the same size as the results matrix stored in the fitting result file. For example, to extract the matching errors of the fitting results by EDFE, one may use the call as below:
>> p = retrieve_result_performance("EDFE_comparison_set_result.mat", "err_am");
The performance metrics currently supported are "time", the execution time, and "err_am", the matching error.
2. Programs to generate the fitting result pictures
The 1-input-0-output program draw_comparison_set_result_pics.m draws pictures of the fitting results given in the input experimental result data file on the synthetic subset. For example, the call of
>> draw_comparison_set_result_pics("adaransac_comparison_set_result.mat");
draws the fitting result pictures for the results of the proposed algorithm applied on algComparisonSet.
The 0-input-0-output program draw_image_set_result_pics.m draws pictures of the fitting results of all the algorithms on the image set. Make sure that all the result data files [AlgName]_image_set_result.mat are present.
3. Statistics of the algorithmic performances
The 0-input-0-output result_statistics.m program calculates and displays the statistics of all the synthetic and image experimental results in the MATLAB Command. Please make sure that all the result data files [AlgName]_comparison_set_result.mat and [AlgName]_image_set_result.mat are present.
Cite As
Siyu Guo (2025). Ellipse Fitting of Planar Points with Outliers (https://se.mathworks.com/matlabcentral/fileexchange/180206-ellipse-fitting-of-planar-points-with-outliers), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2022b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Acknowledgements
Inspired by: Point-Ellipse Orthogonal Distance
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
