X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemiaCore%2FEllipse.fs;h=1059e3bcd370bc51eaf56185eed4bc03aba4d73f;hb=3b645f8ff5259f88a33ffbd9a63b10a8640c439f;hp=520d29d83a9e2d005963a4a9874deef924d099b6;hpb=4bfa3cbdc6145e6944f02e24829ab2ef3a851ac1;p=master-thesis.git diff --git a/Parasitemia/ParasitemiaCore/Ellipse.fs b/Parasitemia/ParasitemiaCore/Ellipse.fs index 520d29d..1059e3b 100644 --- a/Parasitemia/ParasitemiaCore/Ellipse.fs +++ b/Parasitemia/ParasitemiaCore/Ellipse.fs @@ -261,15 +261,15 @@ let private areVectorsValid (p1x: float32) (p1y: float32) (p2x: float32) (p2y: f let find (edges: Matrix) - (xGradient: Image) - (yGradient: Image) + (xGradient: Matrix) + (yGradient: Matrix) (config: Config) : MatchingEllipses = let r1, r2 = config.RBCRadius.Min, config.RBCRadius.Max let incrementWindowDivisor = 4.f // We choose a window size for which the biggest ellipse can always be fitted in. - let windowSize = roundInt (2.f * r2 / (incrementWindowDivisor - 1.f) * incrementWindowDivisor) + let windowSize = roundInt (2.f * r2) let factorNbPick = config.Parameters.factorNbPick let increment = windowSize / (int incrementWindowDivisor) @@ -334,9 +334,8 @@ let find (edges: Matrix) squaredDistance p1xf p1yf p3xf p3yf >= squaredMinimumDistance && squaredDistance p2xf p2yf p3xf p3yf >= squaredMinimumDistance then - match areVectorsValid (float32 p1xf) (float32 p1yf) (float32 p2xf) (float32 p2yf) -xDirData.[p1.Y, p1.X, 0] -yDirData.[p1.Y, p1.X, 0] -xDirData.[p2.Y, p2.X, 0] -yDirData.[p2.Y, p2.X, 0] with + match areVectorsValid (float32 p1xf) (float32 p1yf) (float32 p2xf) (float32 p2yf) -xDirData.[p1.Y, p1.X] -yDirData.[p1.Y, p1.X] -xDirData.[p2.Y, p2.X] -yDirData.[p2.Y, p2.X] with | Some (m1, m2) -> - //let pouet = ellipse2 p1xf p1yf (float m1) p2xf p2yf (float m2) p3xf p3yf match ellipse2 p1xf p1yf (float m1) p2xf p2yf (float m2) p3xf p3yf with | Some e when e.Cx > 0.f && e.Cx < w_f - 1.f && e.Cy > 0.f && e.Cy < h_f - 1.f && e.A >= r1 - radiusTolerance && e.A <= r2 + radiusTolerance && e.B >= r1 - radiusTolerance && e.B <= r2 + radiusTolerance ->