X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemiaCore%2FParasitesMarker.fs;fp=Parasitemia%2FParasitemiaCore%2FParasitesMarker.fs;h=263e35ef60a2724e646673c311235ee36366d722;hb=b87b35b922551f122228df1fd9c530bbb807935a;hp=2b7068231a91acc25ac20bc87d8d5f4def0da9a8;hpb=2e3cd07dd099944059ef5e7a7f5ef57ffe3d677b;p=master-thesis.git diff --git a/Parasitemia/ParasitemiaCore/ParasitesMarker.fs b/Parasitemia/ParasitemiaCore/ParasitesMarker.fs index 2b70682..263e35e 100644 --- a/Parasitemia/ParasitemiaCore/ParasitesMarker.fs +++ b/Parasitemia/ParasitemiaCore/ParasitesMarker.fs @@ -12,12 +12,14 @@ open Otsu open Morpho open ImgTools -type Result = { - darkStain: Image // Colored pixel, it's independent of the size of the areas. It corresponds to white cells, schizontes, gametocytes, throphozoites. - nucleus: Image // Parasite nucleus. It may contain some debris. It shouldn't contain thrombocytes or larger elements. - parasite: Image } // The whole parasites. +type Result = + { + darkStain : Image // Colored pixel, it's independent of the size of the areas. It corresponds to white cells, schizontes, gametocytes, throphozoites. + nucleus : Image // Parasite nucleus. It may contain some debris. It shouldn't contain thrombocytes or larger elements. + parasite : Image // The whole parasites. + } -let find (img: Image) (config: Config.Config) : Result * Image * Image = +let find (img : Image) (config : Config.Config) : Result * Image * Image = let imgWithoutNucleus = img.Copy() areaCloseF imgWithoutNucleus (roundInt config.RBCRadius.NucleusArea) @@ -29,7 +31,7 @@ let find (img: Image) (config: Config.Config) : Result * Image) (closed: Image) (level: float) : Image = + let marker (img : Image) (closed : Image) (level : float) : Image = let diff = img.Copy() diff._Mul(level) CvInvoke.Subtract(closed, diff, diff) @@ -45,8 +47,7 @@ let find (img: Image) (config: Config.Config) : Result * Image) (config: Config.Config) : Result * Image