1
module Parasitemia.Main
5 open System.Windows.Media
6 open System.Windows.Markup
7 open System.Windows.Shapes
8 open System.Windows.Controls
10 open System.Diagnostics
13 open Emgu.CV.Structure
18 let display (window
: Views.MainWindow) (img
: IImage) =
19 let imgControl = window
.Root.FindName("img") :?> Controls.Image
20 imgControl.Source <- BitmapSourceConvert.ToBitmapSource(img
)
22 let log (window
: Views.MainWindow) (mess
: string) =
23 let txtLog = window
.Root.FindName("txtLog") :?> Controls.TextBlock
24 txtLog.Text <- txtLog.Text + mess
+ "\n"
26 [<System.STAThreadAttribute>]
28 Utils.dprintfn
"OpenCV test"
30 let app = new Application()
31 let mainWindow = Views.MainWindow()
33 Utils.log <- (fun m
-> log mainWindow m
)
40 doGLowFreqPercentageReduction
= 0.9
42 darkStainLevel
= 0.839
46 stainSpreadRequired
= 3.0
49 infectionLevel
= 0.762
50 infectionPixelsRequired
= 1 }
53 //use img = new Image<Bgr, byte>("../../../../src/Tests_hough/images/1508133543-7-4-120-0001.png")
54 //use img = new Image<Bgr, byte>("../../../../src/Tests_hough/images/rbc_single.png")
55 //use img = new Image<Bgr, byte>("../../../../src/Tests_hough/images/rbc_single_oblong_4.png")
56 //use img = new Image<Bgr, byte>("../../../../src/Tests_hough/images/strange_rbc_1.png")
57 //use img = new Image<Bgr, byte>("../../../../src/Tests_hough/images/rbc_single_blurred.png")
58 use img = new Image<Bgr, byte
>("../../../../src/Tests_hough/images/lot.png")
62 //use img = new Image<Bgr, byte>("../../../../src/Parasites/images/1.png")
65 // Utils.dprintfn "area: %A" area
67 let result = Utils.logTime
"Total" (fun () ->
68 ImageAnalysis.doAnalysis
img config )
70 display mainWindow img
71 mainWindow.Root.Show()