Program.cs
2.2 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace eyemLib_Sharp
{
class Program
{
static void Main(string[] args)
{
DirectoryInfo di = new DirectoryInfo("D:\\日志\\");
if (!di.Exists)
{
di.Create();
}
//初始化
//EyemLib.Init();
string[] fileNames = Directory.GetFiles(@"D:\批量测试图像\", "*.*", SearchOption.AllDirectories);
for (int j = 0; j < 1; j++)
{
ParallelOptions po = new ParallelOptions();
po.MaxDegreeOfParallelism = 1;
Parallel.ForEach(fileNames, po, fn =>
{
EyemLib.eyemReadImageTool(fn);
});
Console.Write("请按任意键继续。。。");
}
//foreach (var item in fileNames)
//{
// EyemLib.eyemReadImageTool(item);
//}
//for (int i = 0; i < 1; i++)
//{
// EyemLib.eyemTestVideoCapture("D:\\插件完成检测\\视频\\cap5.mp4");
//}
//IntPtr hModelID;
//EyemLib.eyemInitModelE(out hModelID);
//int sum = 0;
//for (int i = 0; i < 5000; i++)
//{
// //for (int j = 0; j < fileNames.Length; j++)
// //{
// // EyemLib.eyemReadImageToolE(fileNames[j], hModelID);
// //}
// sum++;
// //并行测试
// ParallelOptions po = new ParallelOptions();
// po.MaxDegreeOfParallelism = 3;
// Parallel.ForEach(fileNames, po, fn =>
// {
// EyemLib.eyemReadImageToolE(fn, hModelID);
// });
// if (sum > 50)
// {
// sum = 0;
// Console.Clear();
// }
//}
//EyemLib.eyemReleaseModelE(ref hModelID);
//EyemLib.Free();
Console.Write("请按任意键继续。。。");
Console.ReadKey();
}
}
}