Miller index: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>Camkirk
Undid revision 591903683 by Camkirk (talk)
en>Zeptomoon
top: Replaced math-mode angled brackets with "mathematical angle brackets" (Unicode U+27e8 / U+27e9)
 
Line 1: Line 1:
'''RANSAC''' is an abbreviation for "RANdom SAmple Consensus". It is an [[iterative method]] to estimate parameters of a mathematical model from a set of observed data which contains [[outliers]].  It is a non-deterministic algorithm in the sense that it produces a reasonable result only with a certain probability, with this probability increasing as more iterations are allowed.  The algorithm was first published by Fischler and Bolles at [[SRI International]] in 1981.
Hello. Allow me [http://www.Webmd.com/diet/fresh-diet introduce] the author. Her title is [https://Www.Ediets.com/ Emilia Shroyer] but it's not the most female title out there. One of the extremely very best things in the globe for me is to do aerobics and I've been doing it for fairly a whilst. Hiring diet  healthy food [http://www.Deliverlean.com/gluten-free.aspx delivery meal] delivery is her day job now and she will not change it whenever soon. Years in the past we moved to Puerto Rico and my family members enjoys it.<br><br>my blog ... diet meal delivery ([http://Uto.Wm-Scripts.ru/dietdelivery10007 get more info])
 
A basic assumption is that the data consists of "inliers", i.e., data whose distribution can be explained by some set of model parameters, though may be subject to noise, and "outliers" which are data that do not fit the model.  The outliers can come, e.g., from extreme values of the noise or from erroneous measurements or incorrect hypotheses about the interpretation of data.  RANSAC also assumes that, given a (usually small) set of inliers, there exists a procedure which can estimate the parameters of a model that optimally explains or fits this data.
 
==Example==
A simple example is fitting of a line in two dimensions to a set of observations.  Assuming that this set contains both inliers, i.e., points which approximately can be fitted to a line, and outliers, points which cannot be fitted to this line, a simple least squares method for line fitting will in general produce a line with a bad fit to the inliers.  The reason is that it is optimally fitted to all points, including the outliers.  RANSAC, on the other hand, can produce a model which is only computed from the inliers, provided that the probability of choosing only inliers in the selection of data is sufficiently high. There is no guarantee for this situation, however, and there are a number of algorithm parameters which must be carefully chosen to keep the level of probability reasonably high.
 
<gallery widths="286" heights="255" perrow="2">
Image:Line_with_outliers.svg|A data set with many outliers for which a line has to be fitted.
Image:Fitted_line.svg|Fitted line with RANSAC; outliers have no influence on the result.
</gallery>
 
==Overview==
The input to the RANSAC algorithm is a set of observed data values, a parameterized model which can explain or be fitted to the observations, and some [[confidence interval|confidence]] parameters.
 
RANSAC achieves its goal by iteratively selecting a random subset of the original data. These data are ''hypothetical inliers'' and this hypothesis is then tested as follows:
 
# A model is fitted to the sample of hypothetical inliers, i.e. all free parameters of the model are fitted from this sample.
# All other data are then tested against the fitted model and, those points that fit the estimated model well are considered as part of the ''consensus set''.
# The estimated model is reasonably good if sufficiently many points have been classified as part of the consensus set.
# Afterwards, the model may be improved by reestimating it using all members of the consensus set.
 
This procedure is repeated a fixed number of times, each time producing either a model which is rejected because too few points are part of the consensus set, or a refined model together with a corresponding consensus set size. In the latter case, we keep the refined model if its consensus set is larger than the previously saved model.
 
==The algorithm==
Someone's favorite RANSAC hack (the original method instead picks the model with the largest consensus set), in [[pseudocode]], works as follows:
 
'''input''':
    data – a set of observations
    model – a model that can be fitted to data
    n – the minimum number of data required to fit the model
    k – the number of iterations performed by the algorithm
    t – a threshold value for determining when a [[data|datum]] fits a model
    d – the number of close data values required to assert that a model fits well to data
'''output''':
    best_model – model parameters which best fit the data (or nil if no good model is found)
    best_consensus_set – data points from which this model has been estimated
    best_error – the error of this model relative to the data
 
iterations := 0
best_model := nil
best_consensus_set := nil
best_error := infinity
'''while''' iterations < k
    maybe_inliers := n randomly selected values from data
    maybe_model := model parameters fitted to maybe_inliers
    consensus_set := maybe_inliers
 
    '''for''' every point in data '''not in''' maybe_inliers
        '''if''' point fits maybe_model with an error smaller than t
            add point to consensus_set
 
    '''if''' the number of elements in consensus_set is > d
        ''(this implies that we may have found a good model;''
        ''now test how good it is)''
        this_model := model parameters fitted to all points in consensus_set
        this_error := a measure of how well this_model fits these points
        % The line above contains the bug. This_error should be replaced by a score that is either the size of the consensus set, or the robust error norm computed on ALL samples (not just the consensus set).
        '''if''' this_error < best_error
            ''(we have found a model which is better than any of the previous ones;''
            ''keep it until a better one is found)''
            best_model := this_model
            best_consensus_set := consensus_set
            best_error := this_error
 
    increment iterations
 
'''return''' best_model, best_consensus_set, best_error
 
Warning: Note that the above algorithm is not RANSAC according to Fischler and Bolles. A proper implementation should instead pick the model with the largest consensus set. A possible improvement is to instead use a robust error norm score.
 
Possible variants of the RANSAC algorithm include
* Break the main loop if a sufficiently good model has been found, that is, one with sufficiently small error.  May save some computation time at the expense of an additional parameter.
* Compute <code>this_error</code> directly from <code>maybe_model</code> without re-estimating a model from the consensus set.  May save some time at the expense of comparing errors related to models which are estimated from a small number of points and therefore more sensitive to noise.
 
==The parameters==
The values of parameters ''t'' and ''d'' have to be determined from specific requirements related to the application and the data set, possibly based on experimental evaluation. The parameter ''k'' (the number of iterations), however, can be determined from a theoretical result.  Let ''p'' be the probability that the RANSAC algorithm in some iteration selects only inliers from the input data set when it chooses the ''n'' points from which the model parameters are estimated.  When this happens, the resulting model is likely to be useful so ''p'' gives the probability that the algorithm produces a useful result.  Let ''w'' be the probability of choosing an inlier each time a single point is selected, that is,
 
:
''w'' = number of inliers in data / number of points in data
 
A common case is that <math>w</math> is not well known beforehand, but some rough value can be given.  Assuming that the ''n'' points needed for estimating a model are selected independently, <math>w^{n}</math> is the probability that all ''n'' points are inliers and <math>1 - w^{n}</math> is the probability that at least one of the ''n'' points is an outlier, a case which implies that a bad model will be estimated from this point set. That probability to the power of ''k'' is the probability that the algorithm never selects a set of ''n'' points which all are inliers and this must be the same as <math>1 - p</math>.  Consequently,
 
:<math>
1 - p = (1 - w^n)^k
</math>
 
which, after taking the logarithm of both sides, leads to
 
:<math>
k = \frac{\log(1 - p)}{\log(1 - w^n)}
</math>
 
This result assumes that the ''n'' data points are selected independently, that is, a point which has been selected once is replaced and can be selected again in the same iteration. This is often not a reasonable approach and the derived value for ''k'' should be taken as an upper limit in the case that the points are selected without replacement. For example, in the case of finding a line which fits the data set illustrated in the above figure, the RANSAC algorithm typically chooses 2 points in each iteration and computes <code>maybe_model</code> as the line between the points and it is then critical that the two points are distinct.
 
To gain additional confidence, the [[standard deviation]] or multiples thereof can be added to <math>k</math>. The standard deviation of <math>k</math> is defined as
:<math>SD(k) = \frac{\sqrt{1 - w^n}}{w^n}</math>
 
==Advantages and disadvantages==
An advantage of RANSAC is its ability to do [[robust statistics|robust estimation]] of the model parameters, i.e., it can estimate the parameters with a high degree of accuracy even when a significant number of [[outlier]]s are present in the data set.  A disadvantage of RANSAC is that there is no upper bound on the time it takes to compute these parameters. When the number of iterations computed is limited the solution obtained may not be optimal, and it may not even be one that fits the data in a good way.  In this way RANSAC offers a trade-off; by computing a greater number of iterations the probability of a reasonable model being produced is increased.  Moreover, RANSAC is not always able to find the optimal set even for moderately contaminated sets and it usually performs badly when the number of inliers is less than 50%. Optimal RANSAC was proposed to handle both these problems and is capable of finding the optimal set for heavily contaminated sets, even for an inlier ratio under 5%. Another disadvantage of RANSAC is that it requires the setting of problem-specific thresholds.
 
RANSAC can only estimate one model for a particular data setAs for any one-model approach when two (or more) model instances exist, RANSAC may fail to find either one. The [[Hough transform]] is one alternative robust estimation technique that may be useful when more than one model instance is present. Another approach for multi model fitting is known as PEARL, which combines model sampling from data points as in RANSAC with iterative re-estimation of inliers and the multi-model fitting being formulated as an optimization problem with a global energy functional describing the quality of the overall solution.
 
==Applications==
The RANSAC algorithm is often used in [[computer vision]], e.g., to simultaneously solve the [[correspondence problem]] and estimate the [[fundamental matrix (computer vision)|fundamental matrix]] related to a pair of stereo cameras.
 
==References==
* {{cite journal
| author=Martin A. Fischler and Robert C. Bolles
| title=Random Sample Consensus: A Paradigm for Model Fitting with Applications to Image Analysis and Automated Cartography
| journal=Comm. of the ACM
| volume=24
| pages=381–395
|date=June 1981
| doi=10.1145/358669.358692
| url=http://www.tu-chemnitz.de/etit/proaut/paperdb/download/fischler81.pdf
| issue=6
}}
*{{cite book
| author=David A. Forsyth and Jean Ponce
| title=Computer Vision, a modern approach
| year=2003
| publisher=Prentice Hall
| isbn= 0-13-085198-1
}}
*{{cite book
| author=Richard Hartley and [[Andrew Zisserman]]
| title=Multiple View Geometry in Computer Vision
| year=2003
| publisher=Cambridge University Press
| edition=2nd
}}
* {{cite journal
| author=P.H.S. Torr and D.W. Murray
| title=The Development and Comparison of Robust Methods for Estimating the Fundamental Matrix
| journal=International Journal of Computer Vision
| volume=24
| pages=271–300
| year=1997
| doi=10.1023/A:1007927408552
| issue=3
}}
*{{Cite journal
| author=Ondrej Chum
| title=Two-View Geometry Estimation by Random Sample and Consensus
| year=2005
| url=http://cmp.felk.cvut.cz/~chum/Teze/Chum-PhD.pdf
| journal=PhD Thesis
| postscript=<!--None-->
}}
*{{Cite journal
| author=Sunglok Choi, Taemin Kim, and Wonpil Yu
| title=Performance Evaluation of RANSAC Family
| journal=In Proceedings of the British Machine Vision Conference (BMVC)
| year=2009
| url=http://www.bmva.org/bmvc/2009/Papers/Paper355/Paper355.pdf
}}
 
*{{Cite journal
| author=Anders Hast, Johan Nysjö, Andrea Marchetti
| title=Optimal RANSAC – Towards a Repeatable Algorithm for Finding the Optimal Set
| journal=Journal of WSCG
| volume=21(1)
| pages=21–30
| year=2013
| url=http://www.cb.uu.se/~aht/articles/A53-full.pdf
}}
*{{Cite journal
| author=Hossam Isack, Yuri Boykov
| title=Energy-based Geometric Multi-Model Fitting
| journal=International Journal of Computer Vision
| volume=97(2): 1
| pages=23–147
| year=2012
| url=http://www.csd.uwo.ca/~yuri/Papers/tr735.pdf
}}
 
==External links==
* [http://vision.ece.ucsb.edu/~zuliani/Code/Code.html RANSAC Toolbox for MATLAB].  A research (and didactic) oriented toolbox to explore the RANSAC algorithm in [[MATLAB]].  It is highly configurable and contains the routines to solve a few relevant estimation problems.
* [http://www.csse.uwa.edu.au/~pk/research/matlabfns/ ransac.m] The RANSAC algorithm in MATLAB.
* [http://www.cb.uu.se/~aht/code.html optimalRansac.m] The Optimal RANSAC algorithm in MATLAB.
* [http://www.mrpt.org/RANSAC_C++_examples Implementation in C++] as a generic template.
* [http://vision.ece.ucsb.edu/~zuliani/Research/RANSAC/docs/RANSAC4Dummies.pdf RANSAC for Dummies] A simple tutorial with many examples that uses the RANSAC Toolbox for MATLAB.
* [http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/#robust Source code for RANSAC in [[MATLAB]]]
* [http://www.visual-experiments.com/demo/ransac.js/ Ransac.js] Javascript implementation with visual representation of the iterations (Example of 2D Line fitting).
* [http://www.scipy.org/Cookbook/RANSAC ransac.py] Python implementation for Scipy/Numpy.
* [http://graphics.cs.msu.ru/en/science/research/machinelearning/ransactoolbox GML RANSAC Matlab Toolbox] – a set of MATLAB scripts, implementing RANSAC algorithm family.
*[http://www.mathworks.com/discovery/ransac.html RANSAC for estimation of geometric transforms] - MATLAB examples and help on using RANSAC in Computer Vision applications
[[Category:Geometry in computer vision]]
[[Category:Statistical algorithms]]
[[Category:Statistical outliers]]
[[Category:Robust statistics]]
[[Category:Articles with example pseudocode]]
[[Category:SRI International]]
 
{{link FA|de}}

Latest revision as of 19:24, 24 December 2014

Hello. Allow me introduce the author. Her title is Emilia Shroyer but it's not the most female title out there. One of the extremely very best things in the globe for me is to do aerobics and I've been doing it for fairly a whilst. Hiring diet healthy food delivery meal delivery is her day job now and she will not change it whenever soon. Years in the past we moved to Puerto Rico and my family members enjoys it.

my blog ... diet meal delivery (get more info)