Project the colors to have the best contrast for RBCs and parasites analyze.
[master-thesis.git] / Parasitemia / ParasitemiaCore / ParasitesMarker.fs
index f4d9f35..73f9fe1 100644 (file)
@@ -52,7 +52,7 @@ let find (img: Image<Gray, float32>) (config: Config.Config) : Result * Image<Gr
 
     let imgFilteredInfection = ImgTools.gaussianFilter img config.LPFStandardDeviationParasite
     let filteredGreenWithoutInfection = imgFilteredInfection.Copy()
-    ImgTools.areaCloseF filteredGreenWithoutInfection (int config.RBCRadius.InfectionArea)
+    ImgTools.areaCloseF filteredGreenWithoutInfection (roundInt config.RBCRadius.NucleusArea)
 
     (*
     let filteredGreenWithoutStain = filteredGreenWithoutInfection.Copy()
@@ -88,8 +88,9 @@ let find (img: Image<Gray, float32>) (config: Config.Config) : Result * Image<Gr
             CvInvoke.GetStructuringElement(CvEnum.ElementShape.Rectangle, Size(3, 3), Point(-1, -1))
         else
             CvInvoke.GetStructuringElement(CvEnum.ElementShape.Ellipse, Size(kernelSize, kernelSize), Point(-1, -1))
+
     CvInvoke.MorphologyEx(imgFilteredStain, filteredGreenWithoutStain, CvEnum.MorphOp.Close, kernel, Point(-1, -1), 1, CvEnum.BorderType.Replicate, MCvScalar())
-    let stainMarker = marker (*filteredGreenWithoutInfection*) imgFilteredStain filteredGreenWithoutStain (1. / config.Parameters.stainSensitivity)
+    let stainMarker = marker (*filteredGreenWithoutInfection*) imgFilteredStain filteredGreenWithoutStain (1. / config.Parameters.cytoplasmSensitivity)
 
     //
     (*let blackTopHat = filteredGreenWithoutStain.CopyBlank()