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
)
38 doGLowFreqPercentageReduction
= 0.9
42 //use img = new Image<Rgb, byte>("../../../../src/Tests_hough/images/1508133543-7-4-120-0001.png")
43 //use img = new Image<Bgr, byte>("../../../../src/Tests_hough/images/rbc_single.png")
44 //use img = new Image<Bgr, byte>("../../../../src/Tests_hough/images/rbc_single_oblong_2.png")
45 use img = new Image<Bgr, byte
>("../../../../src/Tests_hough/images/two_rbc_1.png")
47 let result = ImageAnalysis.doAnalysis
img config
49 display mainWindow result.img
50 mainWindow.Root.Show()