RegionFit
✖
RegionFit
Details and Options
- RegionFit is also known as sample consensus model.
- RegionFit is typically used for fitting and reconstructing regions from a set of points.
- RegionFit[{p1,p2,…},"model"] finds a region that contains the most points pi by iteratively estimating parameters of the specified "model" from a set of points.
- Possible 2D "model" specifications include:
-
"Line" infinite line "Circle" circle - Possible 3D "model" specifications include:
-
"Line" infinite line "Circle" circle "Plane" plane "Sphere" sphere "Cylinder" cylinder "Cone" cone - RegionFit[Point[{p1,p2,…}]] is effectively equivalent to RegionFit[{p1,p2,…}].
- Vertex normals ni for points pi can be specified by Point[{p1,p2,…},VertexNormals{n1,n2,…}].
- RegionFit[{p1,p2,…},"model","prop"] returns the value of the fit property "prop".
- Possible fit properties "prop" include:
-
"BestFit" the best candidate model "Points" set of points "Inliers" points fitting the candidate model "Outliers" points not fitting the candidate model "DistanceVariance" variance of distances to the candidate model "Distances" distances to the best candidate model {prop1,prop2,…} several fit properties - The following options can be given:
-
ConfidenceLevel Automatic desired probability of outlier-free sample Method Automatic method to use PerformanceGoal $PerformanceGoal aspects of performance to try to optimize Tolerance Automatic numerical tolerance to use VertexNormals None vertex normals for points WorkingPrecision Automatic precision to use in computations - Possible settings for Method include:
-
"RANSAC" random sample consensus "LMEDS" least median of squares "MSAC" M-estimator sample consensus "RRANSAC" randomized RANSAC "RMSAC" randomized MSAC "MLESAC" maximum likelihood estimation sample consensus "PROSAC" progressive sample consensus
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Find a circle that fits a set of points:
https://wolfram.com/xid/0bdpp5xvw-esno8k
https://wolfram.com/xid/0bdpp5xvw-ly7dw
https://wolfram.com/xid/0bdpp5xvw-fy75hd
A set of points with many outliers fitted by a cylinder:
https://wolfram.com/xid/0bdpp5xvw-9ofoyw
https://wolfram.com/xid/0bdpp5xvw-9beuuf
Visualize the fitted region with the data:
https://wolfram.com/xid/0bdpp5xvw-c49cyh
Distribution of the distances of the data to the best‐fit cylinder:
https://wolfram.com/xid/0bdpp5xvw-n48fa3
Scope (13)Survey of the scope of standard use cases
Data (4)
RegionFit works on coordinates:
https://wolfram.com/xid/0bdpp5xvw-v8bc95
https://wolfram.com/xid/0bdpp5xvw-s97w3g
https://wolfram.com/xid/0bdpp5xvw-cohs5x
Oriented collections of points:
https://wolfram.com/xid/0bdpp5xvw-o1ymyx
Models (7)
Obtain an InfiniteLine that best fits a set of points:
https://wolfram.com/xid/0bdpp5xvw-pqljy4
https://wolfram.com/xid/0bdpp5xvw-fsfnvs
InfiniteLine in 3D:
https://wolfram.com/xid/0bdpp5xvw-zzyn0n
https://wolfram.com/xid/0bdpp5xvw-jkn1h5
https://wolfram.com/xid/0bdpp5xvw-lzgzo8
https://wolfram.com/xid/0bdpp5xvw-86pt1f
Cone:
https://wolfram.com/xid/0bdpp5xvw-4wsfer
Properties (2)
RegionFit gives the best fit region:
https://wolfram.com/xid/0bdpp5xvw-uzezjm
https://wolfram.com/xid/0bdpp5xvw-wzeno8
Distances of each point from the best fit region:
https://wolfram.com/xid/0bdpp5xvw-v1xi3y
https://wolfram.com/xid/0bdpp5xvw-xmcb19
https://wolfram.com/xid/0bdpp5xvw-eb62hu
https://wolfram.com/xid/0bdpp5xvw-ipswt9
https://wolfram.com/xid/0bdpp5xvw-36jf6s
Options (4)Common values & functionality for each option
Tolerance (1)
Use Tolerance to control the maximum distance of inliers:
https://wolfram.com/xid/0bdpp5xvw-05hx0d
https://wolfram.com/xid/0bdpp5xvw-23ue74
WorkingPrecision (3)
Compute the best-fit model using machine arithmetic:
https://wolfram.com/xid/0bdpp5xvw-dqkito
Find the fit using exact numbers:
https://wolfram.com/xid/0bdpp5xvw-sv5cus
Find the fit using 30 digits of precision:
https://wolfram.com/xid/0bdpp5xvw-dhsju1
Applications (3)Sample problems that can be solved with this function
Find a best-fit parametrized region for a set of points on a circle:
https://wolfram.com/xid/0bdpp5xvw-3szm35
https://wolfram.com/xid/0bdpp5xvw-t8zxig
https://wolfram.com/xid/0bdpp5xvw-x1ufth
https://wolfram.com/xid/0bdpp5xvw-z5rord
https://wolfram.com/xid/0bdpp5xvw-2yrijo
Find a best-fit parametrized region:
https://wolfram.com/xid/0bdpp5xvw-wf28fr
Visualize the fitted region with the data:
https://wolfram.com/xid/0bdpp5xvw-garz5s
Find the equation of a line passing through a set of points:
https://wolfram.com/xid/0bdpp5xvw-j2utyz
https://wolfram.com/xid/0bdpp5xvw-6lqxqx
https://wolfram.com/xid/0bdpp5xvw-ubuyd0
Properties & Relations (1)Properties of the function, and connections to other functions
For near-perfect linear data, RegionFit and Fit produce equivalent fits using LeastSquares:
https://wolfram.com/xid/0bdpp5xvw-yycycj
Use Fit to find the equation of the line:
https://wolfram.com/xid/0bdpp5xvw-9c0tg0
Use RegionFit to find the line region:
https://wolfram.com/xid/0bdpp5xvw-l023au
https://wolfram.com/xid/0bdpp5xvw-st5ex7
Fit minimizes the least squares error across all points, while RegionFit ignores outliers:
https://wolfram.com/xid/0bdpp5xvw-zi0u2c
https://wolfram.com/xid/0bdpp5xvw-wgfs6z
https://wolfram.com/xid/0bdpp5xvw-zt53e9
Wolfram Research (2021), RegionFit, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionFit.html.
Text
Wolfram Research (2021), RegionFit, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionFit.html.
Wolfram Research (2021), RegionFit, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionFit.html.
CMS
Wolfram Language. 2021. "RegionFit." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RegionFit.html.
Wolfram Language. 2021. "RegionFit." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RegionFit.html.
APA
Wolfram Language. (2021). RegionFit. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RegionFit.html
Wolfram Language. (2021). RegionFit. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RegionFit.html
BibTeX
@misc{reference.wolfram_2024_regionfit, author="Wolfram Research", title="{RegionFit}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/RegionFit.html}", note=[Accessed: 08-January-2025
]}
BibLaTeX
@online{reference.wolfram_2024_regionfit, organization={Wolfram Research}, title={RegionFit}, year={2021}, url={https://reference.wolfram.com/language/ref/RegionFit.html}, note=[Accessed: 08-January-2025
]}