module Parasitemia.Main open System.IO open System.Windows open System.Windows.Media open System.Windows.Markup open System.Windows.Shapes open System.Windows.Controls open System.Drawing open System.Diagnostics open Emgu.CV open Emgu.CV.Structure open Emgu.CV.WPF open Config let display (window : Views.MainWindow) (img : IImage) = let imgControl = window.Root.FindName("img") :?> Controls.Image imgControl.Source <- BitmapSourceConvert.ToBitmapSource(img) let log (window : Views.MainWindow) (mess : string) = let txtLog = window.Root.FindName("txtLog") :?> Controls.TextBlock txtLog.Text <- txtLog.Text + mess + "\n" [] do Utils.dprintfn "OpenCV test" let app = new Application() let mainWindow = Views.MainWindow() Utils.log <- (fun m -> log mainWindow m) let config = { doGSigma1 = 1.5 doGSigma2 = 20.0 doGLowFreqPercentageReduction = 0.9 scale = 1.0 } //use img = new Image("../../../../src/Tests_hough/images/1508133543-7-4-120-0001.png") //use img = new Image("../../../../src/Tests_hough/images/rbc_single.png") //use img = new Image("../../../../src/Tests_hough/images/rbc_single_oblong_2.png") use img = new Image("../../../../src/Tests_hough/images/two_rbc_1.png") let result = ImageAnalysis.doAnalysis img config display mainWindow result.img mainWindow.Root.Show() app.Run() |> ignore