-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
44 lines (37 loc) · 1.14 KB
/
Copy pathProgram.cs
File metadata and controls
44 lines (37 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Threading;
using System.Diagnostics;
namespace AdaptiveTheresholding
{
class Program
{
private static void PrintTime(Stopwatch timer)
{
Console.WriteLine("Time: {0}", timer.Elapsed.ToString(@"hh\:mm\:ss"));
}
static void Main(string[] args)
{
long ms = 0;
Stopwatch timer = new Stopwatch();
timer.Start();
Console.WriteLine("Reading");
var image = new ImageBinarizer("..\\..\\..\\test4.jpg");
PrintTime(timer);
ms += timer.ElapsedMilliseconds;
timer.Restart();
Console.WriteLine("Binarization");
image.StartThresholding();
PrintTime(timer);
ms += timer.ElapsedMilliseconds;
timer.Restart();
Console.WriteLine("Writing");
image.SaveTo("..\\..\\..\\out.bmp");
timer.Stop();
ms += timer.ElapsedMilliseconds;
PrintTime(timer);
Console.WriteLine("Full time: " + ms);
Thread.Sleep(3000);
//Console.ReadKey();
}
}
}