// * '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 (filteredGreen: Image<Gray, byte>) (filteredGreenFloat: Image<Gray, float32>) (config: Config.Config) : Result * Image<Gray, byte> * Image<Gray, byte> =
+let find (filteredGreen: Image<Gray, float32>) (config: Config.Config) : Result * Image<Gray, float32> * Image<Gray, float32> =
let filteredGreenWithoutInfection = filteredGreen.Copy()
- ImgTools.areaClose filteredGreenWithoutInfection (int config.InfectionArea)
+ ImgTools.areaCloseF filteredGreenWithoutInfection (int config.InfectionArea)
let filteredGreenWithoutStain = filteredGreenWithoutInfection.Copy()
- ImgTools.areaClose filteredGreenWithoutStain (int config.StainArea)
+ ImgTools.areaCloseF filteredGreenWithoutStain (int config.StainArea)
// We use the filtered image to find the dark stain.
let darkStain = d_fg.Cmp(value_bg * config.Parameters.darkStainLevel, CvEnum.CmpType.GreaterThan)
darkStain._And(filteredGreenWithoutInfection.Cmp(value_fg, CvEnum.CmpType.LessThan))
- let marker (img: Image<Gray, byte>) (closed: Image<Gray, byte>) (level: float) : Image<Gray, byte> =
+ let marker (img: Image<Gray, float32>) (closed: Image<Gray, float32>) (level: float) : Image<Gray, byte> =
let diff = closed - (img * level)
diff._ThresholdBinary(Gray(0.0), Gray(255.))
- diff
+ diff.Convert<Gray, byte>()
let infectionMarker = marker filteredGreen filteredGreenWithoutInfection config.Parameters.infectionLevel
let stainMarker = marker filteredGreenWithoutInfection filteredGreenWithoutStain config.Parameters.stainLevel
filteredGreenWithoutStain
-
-
-
-
-
-