オーステナイト距離計算
一、rddに変換しない
二、正確なオーステナイト距離
val pointsWithIndex=list.asScala.toList.zipWithIndex
val dis = pointsWithIndex.flatMap(a => pointsWithIndex.filter(_._2 > a._2).map((a, _)))
.map({ case (a, b) => (a._1.getTrackletID, b._1.getTrackletID, euclidean(a._1.getFeatureVector, b._1.getFeatureVector)) })
二、正確なオーステナイト距離
def euclidean(x: Array[Float], y: Array[Float]) :Double= {
var distance = 0.0;
for (i 0 until x.length) {
var temp = Math.pow((x(i) - y(i)), 2);
distance += temp;
}
distance = Math.sqrt(distance);
return 1.0 / (1.0 + distance);
}