X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FMatchingEllipses.fs;h=6e6218d7edb65235faea85ae6867c58bfeca4274;hb=785a7ea4885e87d76f0b1fb1c715230a08389558;hp=92a767ad19d14907c890fc23315852853eb24af6;hpb=b070295cf67b2025164a34b6594e84f0d771cdc9;p=master-thesis.git diff --git a/Parasitemia/Parasitemia/MatchingEllipses.fs b/Parasitemia/Parasitemia/MatchingEllipses.fs index 92a767a..6e6218d 100644 --- a/Parasitemia/Parasitemia/MatchingEllipses.fs +++ b/Parasitemia/Parasitemia/MatchingEllipses.fs @@ -12,20 +12,18 @@ open Utils // Do not take in account matching score below this when two ellipses are matched. let matchingScoreThreshold1 = 0.6 -// All ellipsee with a score below this is removed. -let matchingScoreThreshold2 = 1. / 50. +// All ellipses with a score below this are removed. +let matchingScoreThreshold2 = 600. type private EllipseScoreFlaggedKd (matchingScore: float, e: Ellipse) = let mutable matchingScore = matchingScore - let perimeter = e.Perimeter member this.Ellipse = e member this.MatchingScore = matchingScore - // The score is proportional to the perimeter because large ellipse will receive more votes. member this.AddMatchingScore(score: float) = - matchingScore <- matchingScore + score / perimeter + matchingScore <- matchingScore + score member val Processed = false with get, set member val Removed = false with get, set @@ -71,8 +69,8 @@ type MatchingEllipses (radiusMin: float) = let matchingScore = 2.0 * commonArea / (areaE + areaOther) if matchingScore >= matchingScoreThreshold1 then - other.AddMatchingScore(matchingScore) - e.AddMatchingScore(matchingScore) + other.AddMatchingScore(matchingScore * e.Ellipse.Perimeter) + e.AddMatchingScore(matchingScore * other.Ellipse.Perimeter) | _ -> () // 3) Sort ellipses by their score.