X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemiaCore%2FMatchingEllipses.fs;h=03a3869012f51047ddadc7a0faf2e905de72fcaf;hp=13fd556b0f44f3e8af250fafc4f1c441c6f36cd2;hb=2d712781def419c9acc98368f7102b19b064f16d;hpb=d715615d0b1da40fd10e9dbabbd4530cd5125a19 diff --git a/Parasitemia/ParasitemiaCore/MatchingEllipses.fs b/Parasitemia/ParasitemiaCore/MatchingEllipses.fs index 13fd556..03a3869 100644 --- a/Parasitemia/ParasitemiaCore/MatchingEllipses.fs +++ b/Parasitemia/ParasitemiaCore/MatchingEllipses.fs @@ -34,10 +34,10 @@ type private EllipseScoreFlaggedKd (matchingScore : float32, e : Ellipse) = member this.Y = this.Ellipse.Cy type MatchingEllipses (radius : float32) = - let ellipses = List() + let ellipses = List () member this.Add (e : Ellipse) = - ellipses.Add(EllipseScoreFlaggedKd(0.f, e)) + ellipses.Add (EllipseScoreFlaggedKd (0.f, e)) member this.Ellipses : Ellipse list = List.ofSeq ellipses |> List.map (fun e -> e.Ellipse) @@ -69,8 +69,8 @@ type MatchingEllipses (radius : float32) = // Because of approximation error, see https://github.com/chraibi/EEOver/issues/4 when overlapArea - areaE < 1.f && overlapArea - areaOther < 1.f -> let matchingScore = (2.f * overlapArea / (areaE + areaOther)) ** matchingScorePower - other.AddMatchingScore(matchingScore) - e.AddMatchingScore(matchingScore) + other.AddMatchingScore matchingScore + e.AddMatchingScore matchingScore | _ -> () // 3) Remove ellipses whose center is near the center of another ellipse with a better score. @@ -89,7 +89,7 @@ type MatchingEllipses (radius : float32) = for other in tree.Search window do if not other.Removed && e.MatchingScore > other.MatchingScore then // Case where ellipses are too close. - if distanceTwoPoints (PointF(e.Ellipse.Cx, e.Ellipse.Cy)) (PointF(other.Ellipse.Cx, other.Ellipse.Cy)) < minimumDistanceFromCenterRadiusFactor * e.Ellipse.B then + if distanceTwoPoints (PointF (e.Ellipse.Cx, e.Ellipse.Cy)) (PointF (other.Ellipse.Cx, other.Ellipse.Cy)) < minimumDistanceFromCenterRadiusFactor * e.Ellipse.B then other.Removed <- true else // Case where ellipses are overlapped. @@ -101,6 +101,6 @@ type MatchingEllipses (radius : float32) = ellipses |> List.ofSeq |> List.filter (fun e -> not e.Removed) - |> List.sortWith (fun e1 e2 -> e2.MatchingScore.CompareTo(e1.MatchingScore)) + |> List.sortWith (fun e1 e2 -> e2.MatchingScore.CompareTo e1.MatchingScore) |> List.map (fun e -> e.Ellipse)