Fix some approximation issues.
[master-thesis.git] / Parasitemia / ParasitemiaCore / Ellipse.fs
index 520d29d..e65100b 100644 (file)
@@ -269,7 +269,7 @@ let find (edges: Matrix<byte>)
     let incrementWindowDivisor = 4.f
 
     // We choose a window size for which the biggest ellipse can always be fitted in.
-    let windowSize = roundInt (2.f * r2 / (incrementWindowDivisor - 1.f) * incrementWindowDivisor)
+    let windowSize = roundInt (2.f * r2)
     let factorNbPick = config.Parameters.factorNbPick
 
     let increment = windowSize / (int incrementWindowDivisor)
@@ -336,7 +336,6 @@ let find (edges: Matrix<byte>)
                         then
                             match areVectorsValid (float32 p1xf) (float32 p1yf) (float32 p2xf) (float32 p2yf) -xDirData.[p1.Y, p1.X, 0] -yDirData.[p1.Y, p1.X, 0] -xDirData.[p2.Y, p2.X, 0] -yDirData.[p2.Y, p2.X, 0] with
                             | Some (m1, m2) ->
-                                //let pouet = ellipse2 p1xf p1yf (float m1) p2xf p2yf (float m2) p3xf p3yf
                                 match ellipse2 p1xf p1yf (float m1) p2xf p2yf (float m2) p3xf p3yf with
                                 | Some e when e.Cx > 0.f && e.Cx < w_f - 1.f && e.Cy > 0.f && e.Cy < h_f - 1.f &&
                                               e.A >= r1 - radiusTolerance && e.A <= r2 + radiusTolerance && e.B >= r1 - radiusTolerance && e.B <= r2 + radiusTolerance ->