* Add logos CHUV and HES-SO.
[master-thesis.git] / Parasitemia / ParasitemiaCore / Classifier.fs
index 479ba59..9f4fdd0 100644 (file)
@@ -10,7 +10,6 @@ open Emgu.CV.Structure
 open Types
 open Utils
 
-
 type private EllipseFlaggedKd (e: Ellipse) =
     inherit Ellipse (e.Cx, e.Cy, e.A, e.B, e.Alpha)
 
@@ -20,7 +19,6 @@ type private EllipseFlaggedKd (e: Ellipse) =
         member this.X = this.Cx
         member this.Y = this.Cy
 
-
 let findCells (ellipses: Ellipse list) (parasites: ParasitesMarker.Result) (img: Image<Gray, float32>) (config: Config.Config) : Cell list =
     if ellipses.IsEmpty
     then
@@ -57,7 +55,7 @@ let findCells (ellipses: Ellipse list) (parasites: ParasitesMarker.Result) (img:
                     let c' = PointF(e'.Cx, e'.Cy)
                     let v = pointFromTwoLines d1 (lineFromTwoPoints c c')
                     let case1 = sign (v.X - c.X) <> sign (v.X - c'.X) || Utils.squaredDistanceTwoPoints v c > Utils.squaredDistanceTwoPoints v c'
-                    if d2.Valid
+                    if not (Single.IsInfinity d2.A)
                     then
                         let p' = Utils.pointFromTwoLines d1 d2
                         let delta, delta' =
@@ -130,7 +128,6 @@ let findCells (ellipses: Ellipse list) (parasites: ParasitesMarker.Result) (img:
                 if stdDeviation > globalStdDeviation * config.Parameters.standardDeviationMaxRatio then
                     e.Removed <- true
 
-
         // 4) Remove ellipses with little area.
         let minArea = config.RBCRadius.MinArea
         for e, neighbors in ellipsesWithNeigbors do