Modifica

Condividi tramite


MathUtilities.NearestPointToLinesRANSAC Method

Definition

Find 3D point that minimizes distance to a set of 2 or more lines, ignoring outliers

public:
 static UnityEngine::Vector3 NearestPointToLinesRANSAC(System::Collections::Generic::List<UnityEngine::Ray> ^ rays, int ransac_iterations, float ransac_threshold, [Runtime::InteropServices::Out] int % numActualInliers);
public static UnityEngine.Vector3 NearestPointToLinesRANSAC (System.Collections.Generic.List<UnityEngine.Ray> rays, int ransac_iterations, float ransac_threshold, out int numActualInliers);
static member NearestPointToLinesRANSAC : System.Collections.Generic.List<UnityEngine.Ray> * int * single * int -> UnityEngine.Vector3
Public Shared Function NearestPointToLinesRANSAC (rays As List(Of Ray), ransac_iterations As Integer, ransac_threshold As Single, ByRef numActualInliers As Integer) As Vector3

Parameters

rays
List<UnityEngine.Ray>

list of rays, each specifying a line, must have at least 1

ransac_iterations
Int32

number of iterations: log(1-p)/log(1-(1-E)^s) where p is probability of at least one sample containing s points is all inliers E is proportion of outliers (1-ransac_ratio) e.g. p=0.999, ransac_ratio=0.54, s=2 ==> log(0.001)/(log(1-0.54^2) = 20

ransac_threshold
Single

minimum distance from point to line for a line to be considered an inlier

numActualInliers
Int32

return number of inliers: lines that are within ransac_threshold of nearest point

Returns

UnityEngine.Vector3

point nearest to the set of lines, ignoring outliers

Applies to