X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FParasitesMarker2.fs;h=17a032d81efc42a8c1435a0c2659e577364f9c03;hp=03af2b6e715a25b4d567085459673e91ad5eb73a;hb=6d99ab0dadc57e91cd846844b620fc90b52a2f96;hpb=70c9b65e9034c14b5c63345cda3d5d579bbdc57c diff --git a/Parasitemia/Parasitemia/ParasitesMarker2.fs b/Parasitemia/Parasitemia/ParasitesMarker2.fs index 03af2b6..17a032d 100644 --- a/Parasitemia/Parasitemia/ParasitesMarker2.fs +++ b/Parasitemia/Parasitemia/ParasitesMarker2.fs @@ -7,8 +7,8 @@ open Emgu.CV.Structure type Result = { darkStain: Image - stain: Image - infection: Image } + infection: Image + stain: Image } // Create three binary markers : // * 'Dark stain' corresponds to the colored pixel, it's independent of the size of the areas. @@ -32,16 +32,18 @@ let find (filteredGreen: Image) (filteredGreenFloat: Image Gray, Gray(255.)) + let valueThreshold = if (!max).[0] * threshold < 0.1 * (median_bg - median_fg) then 0.1 * (median_bg - median_fg) else (!max).[0] * threshold + + diff._ThresholdBinary(Gray(valueThreshold), Gray(255.)) diff, closed - let parasitesMarker, filteredGreenWithoutParasites = marker (int config.ParasiteArea) config.Parameters.infectionLevel + let infectionMarker, filteredGreenWithoutInfection = marker (int config.InfectionArea) config.Parameters.infectionLevel let stainMarker, filteredGreenWithoutStain = marker (int config.StainArea) config.Parameters.stainLevel { darkStain = darkStain - stain = parasitesMarker - infection = stainMarker }, - filteredGreenWithoutParasites, + infection = infectionMarker + stain = stainMarker }, + filteredGreenWithoutInfection, filteredGreenWithoutStain