# fitPolynomialRANSAC

Fit polynomial to points using RANSAC

## Syntax

## Description

finds the `P`

= fitPolynomialRANSAC(`xyPoints`

,`N`

,`maxDistance`

)*N*th-degree polynomial coefficients,
`P`

, by sampling a small set of points given in
`xyPoints`

and generating the *N*th
polynomial fits. The fit that has the most inliers within
`maxDistance`

is returned. If a fit cannot be found, then
`P`

is returned empty. The function uses the M-estimator
sample consensus (MSAC) algorithm, a variation of the random sample consensus
(RANSAC) algorithm to fit the data.

`[`

returns a logical
array, `P`

,`inlierIdx`

]
= fitPolynomialRANSAC(___)`inlierIdx`

, that specifies the indices
for data points that are inliers to the fit polynomial based on `maxDistance`

.
Use the input arguments from the previous syntax.

`[___] = fitPolynomialRANSAC(___,Name=Value)`

specifies options using one or more name-value arguments in addition to any
combination of arguments from previous syntaxes. For example,
`(MaxNumTrials=2000)`

sets the maximum number of random trials
to `2000`

.

## Examples

## Input Arguments

## Output Arguments

## References

[1] Torr, P. H. S., and A. Zisserman. "MLESAC: A New Robust
Estimator with Application to Estimating Image Geometry." *Computer
Vision and Image Understanding*. Vol. 18, Issue 1, April
2000, pp. 138–156.

## Version History

**Introduced in R2017a**