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))