X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemiaCore%2FGranulometry.fs;h=004a25ead927f9c96bd70e76daefd47dbe11bb48;hp=877df99384d1f2671cd7481fc3d34dc3f78dfc9f;hb=1b8e45987bde692ab5602c281f878707f70459b7;hpb=32ef4bbb0381f822c4df124595d401ad2f502c1b diff --git a/Parasitemia/ParasitemiaCore/Granulometry.fs b/Parasitemia/ParasitemiaCore/Granulometry.fs index 877df99..004a25e 100644 --- a/Parasitemia/ParasitemiaCore/Granulometry.fs +++ b/Parasitemia/ParasitemiaCore/Granulometry.fs @@ -29,8 +29,8 @@ let findRadiusByClosing (img: Image) (range: int * int) (scale: f if s % 2 = 0 then failwith "s must be odd" let m = new Matrix(Array2D.create s s 1uy) let r = (float s) / (Math.Sqrt 2. + 2.) |> roundInt - for i in 0 .. r - 1 do - for j in 0 .. r - 1 do + for i = 0 to r - 1 do + for j = 0 to r - 1 do if i + j < r then m.[i, j] <- 0uy @@ -40,7 +40,7 @@ let findRadiusByClosing (img: Image) (range: int * int) (scale: f m let mutable previous_n = Double.NaN - for r in r1' .. r2' do + for r = r1' to r2' do let se = if useOctagon then (octagon (2 * r - 1)).Mat // It doesn't speed up the process. else CvInvoke.GetStructuringElement(CvEnum.ElementShape.Ellipse, Size(2 * r, 2 * r), Point(-1, -1))