24ea4a72f61ef20411d447207d96017f0090118c
[master-thesis.git] / Parasitemia / Parasitemia / Classifier.fs
1 module Classifier
2
3 open System
4 open System.Drawing
5
6 open Emgu.CV
7 open Emgu.CV.Structure
8
9
10 type CellClass = HealthyRBC | InfectedRBC | Peculiar
11
12 type Cell = {
13 cellClass: CellClass
14 center: Point
15 elements: Matrix<byte> }
16
17 type KdEllipse (e: Types.Ellipse) =
18 inherit Types.Ellipse (e.Cx, e.Cy, e.A, e.B, e.Alpha)
19
20 interface KdTree.I2DCoords with
21 member this.X = this.Cx
22 member this.Y = this.Cy
23
24
25 let findCells (ellipses: Types.Ellipse list) (parasites: ParasitesMarker.Result) (fg: Image<Gray, byte>) : Cell list =
26 if ellipses.IsEmpty
27 then
28 []
29 else
30 let tree = KdTree.Tree.buildTree (ellipses |> List.map KdEllipse)
31 []