private List<DBSCANCluster> AngularSegmentation(DBSCAN dbscan, Scan360 scan, float eps, int minPoints) { scan.EstimateLocalAngle(); List<DBSCANCluster> clusters=dbscan.Cluster(scan.readings, eps, minPoints, new AngleComparer(), new AngleCircularMetric()); foreach (DBSCANCluster c in clusters) foreach (ScanPoint dp in c) dp.ParallelCluster = c.Id; return clusters; }
private List<DBSCANCluster> DistanceSegmentation(DBSCAN dbscan, DBSCANCluster c, ref int clusterOffset, float eps, int minPoints) { float angle = ScanPoint.MeanCircularAngle0Pi(c); float cos = Mathf.Cos(angle); float sin = Mathf.Sin(angle); foreach (ScanPoint p in c) p.Distance = p.Point.x * cos + p.Point.z * sin; List<DBSCANCluster> clusters=dbscan.Cluster(c, eps, minPoints, new DistanceComparer(), new DistanceMetric()); if (clusters.Count == 0) return new List<DBSCANCluster>(); foreach (DBSCANCluster dc in clusters) foreach (ScanPoint p in dc) p.DistanceCluster = dc.Id + clusterOffset; clusterOffset += clusters[clusters.Count - 1].Id; return clusters; }