Zygmunt L. Szpak
Computer Vision & Machine Learning

# Source Code

I am making an effort to make the source code behind my publications available for download. As I am continually experimenting with new ideas the code may no longer be exactly what it was when the paper was published---ideally it should be an improved version but I cannot guarantee that. If you find bugs or have suggestions for improvement please contact me.

The can find the latest versions of all the software on my Github repository.

If you find the software useful in your own work, please cite the corresponding publication.

## 1 Guaranteed Ellipse Fitting with a Confidence Region and an Uncertainty Measure for Centre, Axes and Orientation

In this section you will find a MATLAB implementation of an extension to our previous work (Guaranteed Ellipse Fitting with Sampson Distance) on fitting ellipses to data. Our new work demonstrates that one can guarantee an ellipse estimate through a prudent choice of algebraic parameters---the barrier term that we used in our previous work can be omitted. In our new work we also utilise the Sampson Distance to measure the quality of fit between a candidate ellipse and data points, hence our new method is still very fast and simple to implement. Our method also produces a measure of uncertainty in the form of a covariance matrix for the estimated parameters. In addition, we provide formulae for converting the algebraic ellipse parameters into geometric ellipse parameters such as the semi-major and semi-minor axes, the centre of the ellipse and the orientation of the ellipse in radians). Moreover, we propagate the measure of uncertainty through to the geometric parameters and produce a covariance matrix for the geometric parameters. Finally, we produce a planar 95% confidence region for the ellipse estimate, to assist in interpreting the uncertainty contained in the covariance matrices.

If you have covariance matrices associated with your data points you can specify them and our method will utilise them in the estimation process. If you do not submit data point covariance matrices, our method assumes homogeneous Gaussian noise and estimates the level of noise automatically from the data.

Please read the readme.txt file for information on how to run the software, the disclaimer, known issues and information about the future release.

When you execute the software it will run the guaranteed ellipse fit and the direct ellipse fit on synthetic data, and produce two graphs comparing the two methods.

## 2 Guaranteed Ellipse Fitting with the Sampson Distance

In this section you will find a MATLAB implementation of a new ellipse fitting algorithm that uses an approximate maximum likelihood cost function to fit an ellipse to data, and simultaneously guarantees that an ellipse will be produced. Our algorithm is meant to provide practitioners with an alternative to the popular Direct Ellipse Fit (DIR) method which also guarantees an ellipse fit, but minimises an algebraic cost function instead. Even though DIR is widely used, it is known to exhibit significant bias. When data points are sampled from only a portion of an ellipse (due to occlusion for example), the resulting DIR fit is often inadequate. On the other hand, our method which minimizes an approximate maximum likelihood cost function, produces results which are often in agreement with the full maximum likelihood method for small noise levels.

Please read the readme.txt file for information on how to run the software, the disclaimer, known issues and information about the future release.

When you execute the software it will run the guaranteed ellipse fit and the direct ellipse fit on synthetic data, and produce two graphs comparing the two methods.

## 3 Sampson Distance Based Joint Estimation of Multiple Homographies with Uncalibrated Cameras

I have uploaded an interim MATLAB release of the source code associated with our paper ["Sampson Distance Based Joint Estimation of Multiple Homographies with Uncalibrated Cameras"](pubs/sampsonMultiHomJournal.pdf. This source code also contains the code associated with our previous work "Homography Estimation with Consistency Constraints". I am still in the process of adding more example scripts which I hope to upload in the not too distant future. You will find a description of what I plan to add in the readme.txt contained in the zip file.