public static double[,] computeSimilarities(List <GenericPolygon> polyList1, List <GenericPolygon> polyList2) { double[,] mat = new double[polyList1.Count, polyList2.Count]; for (int i = 0; i < polyList1.Count; i++) { for (int j = 0; j < polyList2.Count; j++) { mat[i, j] = BoundingBox.ComputeIntersectionOverUnion(polyList2[j].getBoundingBox(), polyList1[i].getBoundingBox()); //this is a symmetric measure } } return(mat); }
public static double[,] computeSimilarities(List <BoundingBox> bbList1, List <BoundingBox> bbList2) { double[,] mat = new double[bbList1.Count, bbList2.Count]; for (int i = 0; i < bbList1.Count; i++) { for (int j = 0; j < bbList2.Count; j++) { //mat[i, j] = bbList1[i].ComputeOverlapAreaFraction(bbList2[j]); //mat[i, j] = BoundingBox.ComputeOverlapAreaFraction(bbList2[j], bbList1[j]); //this is a symmetric measure mat[i, j] = BoundingBox.ComputeIntersectionOverUnion(bbList2[j], bbList1[i]); //this is a symmetric measure } } return(mat); }