Bläddra i källkod

Select random samples for Ransac

Nick Steyer 2 år sedan
förälder
incheckning
11d83b584e
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4 1
      Assets/StreetLight/Scripts/PositionCalculator.cs

+ 4 - 1
Assets/StreetLight/Scripts/PositionCalculator.cs

@@ -4,7 +4,9 @@ using MathNet.Numerics.LinearAlgebra;
 using MathNet.Numerics.LinearAlgebra.Double;
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using UnityEngine;
+using Random = System.Random;
 
 namespace Assets.StreetLight.Scripts
 {
@@ -29,9 +31,10 @@ namespace Assets.StreetLight.Scripts
 
             var iterations = RansacIterations(0.35f, 4, 0.99f);
 
+            var random = new Random();
             for (int i = 0; i < iterations; i++)
             {
-
+                var sample = calibrationVectors.OrderBy(_ => random.Next()).Take(4);
             }
         }