X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FMatchingEllipses.fs;fp=Parasitemia%2FParasitemia%2FMatchingEllipses.fs;h=9b870dcbf9c87d60b7e7fec1c416dc7450da8d50;hb=06bd63d8c01100c28873dfafd59b5efccbfb67e4;hp=afc4ab7b10c0cb4954c2206cf07238ae905ab1a8;hpb=dec96d50e56e1932bbfa09e6bedf90d6b707ccbd;p=master-thesis.git diff --git a/Parasitemia/Parasitemia/MatchingEllipses.fs b/Parasitemia/Parasitemia/MatchingEllipses.fs index afc4ab7..9b870dc 100644 --- a/Parasitemia/Parasitemia/MatchingEllipses.fs +++ b/Parasitemia/Parasitemia/MatchingEllipses.fs @@ -50,12 +50,14 @@ type MatchingEllipses (radiusMin: float) = if not other.Processed then let areaOther = other.Ellipse.Area - let commonArea = EEOver.EEOverlapArea e.Ellipse other.Ellipse - let matchingScore = 2.0 * commonArea / (areaE + areaOther) - if matchingScore >= matchingScoreThreshold1 - then - other.AddMatchingScore(matchingScore) - e.AddMatchingScore(matchingScore) + match EEOver.EEOverlapArea e.Ellipse other.Ellipse with + | Some (commonArea, _, _) -> + let matchingScore = 2.0 * commonArea / (areaE + areaOther) + if matchingScore >= matchingScoreThreshold1 + then + other.AddMatchingScore(matchingScore) + e.AddMatchingScore(matchingScore) + | _ -> () // 3) Sort ellipses by their score. ellipses.Sort(fun e1 e2 -> e2.MatchingScore.CompareTo(e1.MatchingScore))