X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemiaCore%2FImgTools%2FMorpho.fs;h=6c8d7a04182bd7d9c879c48d4589d364049ac09e;hp=4cb1f0b31343bde58ef574f6a16066c8ecc3e435;hb=829c86a5f0f165438da8f8da2e072889065a4df1;hpb=b63f58aa12ab2584e804785d482867e6fa637389 diff --git a/Parasitemia/ParasitemiaCore/ImgTools/Morpho.fs b/Parasitemia/ParasitemiaCore/ImgTools/Morpho.fs index 4cb1f0b..6c8d7a0 100644 --- a/Parasitemia/ParasitemiaCore/ImgTools/Morpho.fs +++ b/Parasitemia/ParasitemiaCore/ImgTools/Morpho.fs @@ -29,7 +29,7 @@ type ExtremumType = | Maxima = 1 | Minima = 2 -let findExtremum (img : Image) (extremumType : ExtremumType) : IEnumerable = +let inline findExtremum (img : Image) (extremumType : ExtremumType) : IEnumerable when 'TDepth : unmanaged = let w = img.Width let h = img.Height let se = [| -1, 0; 0, -1; 1, 0; 0, 1 |] @@ -66,7 +66,7 @@ let findExtremum (img : Image) (extremumType : ExtremumType) : IE let level = imgData.[ni, nj, 0] let notSuppressed = not suppress.[ni, nj] - if level = currentLevel && notSuppressed then + if notSuppressed && level = currentLevel then suppress.[ni, nj] <- true sameLevelToCheck.Push(Point(nj, ni)) elif (if extremumType = ExtremumType.Maxima then level > currentLevel else level < currentLevel) then @@ -86,10 +86,10 @@ let findExtremum (img : Image) (extremumType : ExtremumType) : IE result.Select(fun l -> Points(l)) -let findMaxima (img : Image) : IEnumerable = +let inline findMaxima (img : Image) : IEnumerable when 'TDepth : unmanaged = findExtremum img ExtremumType.Maxima -let findMinima (img : Image) : IEnumerable = +let inline findMinima (img : Image) : IEnumerable when 'TDepth : unmanaged = findExtremum img ExtremumType.Minima type PriorityQueue () =