X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemiaCore%2FImgTools.fs;h=abc8714aa7e9ed2601332e506409c9046e6def2a;hp=dd06649785069211b8797e8edc189d3cd372d2da;hb=aee6cf83f81c6378c458f75bbfaf7c9fa5521135;hpb=cedd2809bf9f802e9c12102d30f63cf29f64442c diff --git a/Parasitemia/ParasitemiaCore/ImgTools.fs b/Parasitemia/ParasitemiaCore/ImgTools.fs index dd06649..abc8714 100644 --- a/Parasitemia/ParasitemiaCore/ImgTools.fs +++ b/Parasitemia/ParasitemiaCore/ImgTools.fs @@ -612,6 +612,7 @@ type Island (cmp: IComparer) = member val Shore = Heap.Heap(cmp) with get member val Level = 0.f with get, set member val Surface = 0 with get, set + member this.IsInfinite = this.Surface = Int32.MaxValue let private areaOperationF (img: Image) (areas: (int * 'a) list) (f: ('a -> float32 -> unit) option) (op: AreaOperation) = let w = img.Width @@ -666,7 +667,7 @@ let private areaOperationF (img: Image) (areas: (int * 'a) list) else if not <| Object.ReferenceEquals(other, null) then // We touching another island. - if island.Surface + other.Surface >= area + if island.IsInfinite || other.IsInfinite || island.Surface + other.Surface >= area then stop <- true else // We can merge 'other' into 'surface'.