Cleaning syntax.
[master-thesis.git] / Parasitemia / ParasitemiaCore / ImgTools / Otsu.fs
index 82dfde4..8d976ff 100644 (file)
@@ -2,7 +2,7 @@
 
 open Histogram
 
-let otsu (hist: Histogram) : float32 * float32 * float32 =
+let otsu (hist : Histogram) : float32 * float32 * float32 =
     let mutable sumB = 0
     let mutable wB = 0
     let mutable maximum = 0.0
@@ -11,17 +11,14 @@ let otsu (hist: Histogram) : float32 * float32 * float32 =
 
     for i = 0 to hist.data.Length - 1 do
         wB <- wB + hist.data.[i]
-        if wB <> 0
-        then
+        if wB <> 0 then
             let wF = hist.total - wB
-            if wF <> 0
-            then
+            if wF <> 0 then
                 sumB <- sumB + i * hist.data.[i]
                 let mB = (float sumB) / (float wB)
                 let mF = (sum - float sumB) / (float wF)
                 let between = (float wB) * (float wF) * (mB - mF) ** 2.;
-                if between >= maximum
-                then
+                if between >= maximum then
                     level <- i
                     maximum <- between