Change the parasite detection method.
[master-thesis.git] / Parasitemia / Parasitemia / ParasitesMarker.fs
index 9adf185..d1a51fa 100644 (file)
@@ -14,11 +14,11 @@ type Result = {
 // * 'Dark stain' corresponds to the colored pixel, it's independent of the size of the areas.
 // * 'Stain' corresponds to the stain around the parasites.
 // * 'Infection' corresponds to the parasite. It shouldn't contain thrombocytes.
 // * 'Dark stain' corresponds to the colored pixel, it's independent of the size of the areas.
 // * 'Stain' corresponds to the stain around the parasites.
 // * 'Infection' corresponds to the parasite. It shouldn't contain thrombocytes.
-let find (green: Image<Gray, float32>) (filteredGreen: Image<Gray, float32>) (kmediansResult: KMedians.Result) (config: Config.Config) : Result =
+(*let find (green: Image<Gray, float32>) (filteredGreen: Image<Gray, float32>) (kmediansResult: KMedians.Result) (config: Config.Config) : Result =
 
     // We use the filtered image to find the dark stain.
     let { KMedians.fg = fg; KMedians.median_bg = median_bg; KMedians.median_fg = median_fg; KMedians.d_fg = d_fg } = kmediansResult
 
     // We use the filtered image to find the dark stain.
     let { KMedians.fg = fg; KMedians.median_bg = median_bg; KMedians.median_fg = median_fg; KMedians.d_fg = d_fg } = kmediansResult
-    let darkStain = d_fg.Cmp(median_bg * config.darkStainLevel, CvEnum.CmpType.GreaterThan)
+    let darkStain = d_fg.Cmp(median_bg * config.Parameters.darkStainLevel, CvEnum.CmpType.GreaterThan)
     darkStain._And(filteredGreen.Cmp(median_fg, CvEnum.CmpType.LessThan))
     darkStain._And(fg)
 
     darkStain._And(filteredGreen.Cmp(median_fg, CvEnum.CmpType.LessThan))
     darkStain._And(fg)
 
@@ -34,8 +34,8 @@ let find (green: Image<Gray, float32>) (filteredGreen: Image<Gray, float32>) (km
         smears
 
     { darkStain = darkStain;
         smears
 
     { darkStain = darkStain;
-      stain = findSmears config.stainSigma config.stainLevel
-      infection = findSmears config.infectionSigma config.infectionLevel }
+      stain = findSmears config.Parameters.stainSigma config.Parameters.stainLevel
+      infection = findSmears config.Parameters.infectionSigma config.Parameters.infectionLevel }*)