Update coding style.
[master-thesis.git] / Parasitemia / ParasitemiaCore / KMeans.fs
index dfd2593..c0276d9 100644 (file)
@@ -20,10 +20,10 @@ let kmeans (img : Image<Gray, float32>) : Result =
     let h = img.Height
 
     let min = ref [| 0.0 |]
     let h = img.Height
 
     let min = ref [| 0.0 |]
-    let minLocation = ref <| [| Point() |]
+    let minLocation = ref <| [| Point () |]
     let max = ref [| 0.0 |]
     let max = ref [| 0.0 |]
-    let maxLocation = ref <| [| Point() |]
-    img.MinMax(min, max, minLocation, maxLocation)
+    let maxLocation = ref <| [| Point () |]
+    img.MinMax (min, max, minLocation, maxLocation)
 
     let minf = float32 (!min).[0]
     let maxf = float32 (!max).[0]
 
     let minf = float32 (!min).[0]
     let maxf = float32 (!max).[0]
@@ -32,7 +32,7 @@ let kmeans (img : Image<Gray, float32>) : Result =
     let mutable mean_fg = minf + (maxf - minf) / 4.f
     use mutable d_bg : Image<Gray, float32> = null
     let mutable d_fg : Image<Gray, float32> = null
     let mutable mean_fg = minf + (maxf - minf) / 4.f
     use mutable d_bg : Image<Gray, float32> = null
     let mutable d_fg : Image<Gray, float32> = null
-    let fg = new Image<Gray, byte>(img.Size)
+    let fg = new Image<Gray, byte> (img.Size)
 
     let imgData = img.Data
     let fgData = fg.Data
 
     let imgData = img.Data
     let fgData = fg.Data
@@ -41,14 +41,14 @@ let kmeans (img : Image<Gray, float32>) : Result =
         match d_bg with
         | null -> ()
         | _ ->
         match d_bg with
         | null -> ()
         | _ ->
-            d_bg.Dispose()
-            d_fg.Dispose()
+            d_bg.Dispose ()
+            d_fg.Dispose ()
 
         // EmGu doesn't import the in-place version of 'AbsDiff' so we have to create two images for each iteration.
 
         // EmGu doesn't import the in-place version of 'AbsDiff' so we have to create two images for each iteration.
-        d_bg <- img.AbsDiff(Gray(float mean_bg))
-        d_fg <- img.AbsDiff(Gray(float mean_fg))
+        d_bg <- img.AbsDiff (Gray (float mean_bg))
+        d_fg <- img.AbsDiff (Gray (float mean_fg))
 
 
-        CvInvoke.Compare(d_fg, d_bg, fg, CvEnum.CmpType.LessThan)
+        CvInvoke.Compare (d_fg, d_bg, fg, CvEnum.CmpType.LessThan)
 
         let mutable bg_total = 0.f
         let mutable bg_nb = 0
 
         let mutable bg_total = 0.f
         let mutable bg_nb = 0