X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FParasitesMarker.fs;h=671755c24b4f0c6eaf9fca54516cb8301d387c87;hb=81d1b86719a1ebaf649c1de4c1364603155a53e1;hp=fcb71da23899aab1ea8a17060aab6f4d98d8fadb;hpb=807437584bdd3d7b7b33be8282472f81f8cce606;p=master-thesis.git diff --git a/Parasitemia/Parasitemia/ParasitesMarker.fs b/Parasitemia/Parasitemia/ParasitesMarker.fs index fcb71da..671755c 100644 --- a/Parasitemia/Parasitemia/ParasitesMarker.fs +++ b/Parasitemia/Parasitemia/ParasitesMarker.fs @@ -12,7 +12,6 @@ type Result = { infection: Image stain: Image } - // Create three binary markers : // * 'Dark stain' corresponds to the colored pixel, it's independent of the size of the areas. // * 'Stain' corresponds to the stain around the parasites. @@ -44,17 +43,16 @@ let findMa (green: Image) (filteredGreen: Image) ( tmp, tmp - // Create three binary markers : // * '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) (config: Config.Config) : Result * Image = use filteredGreenWithoutInfection = filteredGreen.Copy() - ImgTools.areaCloseF filteredGreenWithoutInfection (int config.InfectionArea) + ImgTools.areaCloseF filteredGreenWithoutInfection (int config.RBCRadius.InfectionArea) let filteredGreenWithoutStain = filteredGreenWithoutInfection.Copy() - ImgTools.areaCloseF filteredGreenWithoutStain (int config.StainArea) + ImgTools.areaCloseF filteredGreenWithoutStain (int config.RBCRadius.StainArea) let darkStain = // We use the filtered image to find the dark stain. @@ -70,13 +68,15 @@ let find (filteredGreen: Image) (config: Config.Config) : Result diff._ThresholdBinary(Gray(0.0), Gray(255.)) diff.Convert() - let infectionMarker = marker filteredGreen filteredGreenWithoutInfection config.Parameters.infectionLevel - let stainMarker = marker filteredGreenWithoutInfection filteredGreenWithoutStain config.Parameters.stainLevel + let infectionMarker = marker filteredGreen filteredGreenWithoutInfection (1. / config.Parameters.infectionSensitivity) + let stainMarker = marker filteredGreenWithoutInfection filteredGreenWithoutStain (1. / config.Parameters.stainSensitivity) // TODO: comprendre pourquoi des valeurs sont negatives!?!? + (* let blackTopHat = filteredGreen.CopyBlank() CvInvoke.Subtract(filteredGreenWithoutInfection, filteredGreen, blackTopHat) ImgTools.saveImg (ImgTools.normalizeAndConvert blackTopHat) "BottomHat.png" + *) { darkStain = darkStain infection = infectionMarker