| | |
| | | using System.Drawing; |
| | | using System.Reflection.Emit; |
| | | using System.Reflection; |
| | | using Tesseract; |
| | | using Emgu.CV; |
| | | using Emgu.CV.Structure; |
| | | |
| | | namespace test |
| | | { |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | class Program |
| | | { |
| | | |
| | | |
| | | static void Main(string[] args) |
| | | { |
| | | person a = new person(235, "a0"); |
| | | person b = new person(12, "b1"); |
| | | person c = new person(34, "c2"); |
| | | person d = new person(45, "d3"); |
| | | person e = new person(56, "e4"); |
| | | Dijkstra<person> dij = new Dijkstra<person>(); |
| | | dij.AddVertex(a, new Dictionary<person, int>() { { b, 7 }, { d, 8 } }); |
| | | dij.AddVertex(b, new Dictionary<person, int>() { { a, 7 }, { c, 2 },{ d,2} ,{ e,3} }); |
| | | dij.AddVertex(c, new Dictionary<person, int>() { { b, 8 }, { e, 6 } }); |
| | | dij.AddVertex(d, new Dictionary<person, int>() { { a, 8 },{ b,2} }); |
| | | dij.AddVertex(e, new Dictionary<person, int>() { { b, 1 },{ c,2} }); |
| | | |
| | | dij.ShortestPath(d, e).ForEach(x => Console.WriteLine(x)); |
| | | ZTImage.Diagnostics.CodeTimer.Timer("dij", 10000, () => |
| | | { |
| | | //g.ShortestPath('A', 'H').ForEach(x => Console.WriteLine(x)); |
| | | dij.ShortestPath(a, b); |
| | | |
| | | Image<Rgb, byte> image = RichCreator.Utility.Captures.ScreenCapture.Instance.CaptureScreenReturnImage(); |
| | | int i = 0; |
| | | ZTImage.Diagnostics.CodeTimer.Timer("test", 100000, () => { |
| | | |
| | | byte b1 = image.Data[i % 53, i % 37,0]; |
| | | byte b2 = image.Data[i % 53, i % 37, 1]; |
| | | Int32 total = b1 + b2; |
| | | |
| | | if (total > 300000) |
| | | { |
| | | Console.WriteLine("oik"); |
| | | } |
| | | }); |
| | | //person a = new person(235, "a0"); |
| | | //person b = new person(12, "b1"); |
| | | //person c = new person(34, "c2"); |
| | | //person d = new person(45, "d3"); |
| | | //person e = new person(56, "e4"); |
| | | //Dijkstra<person> dij = new Dijkstra<person>(); |
| | | //dij.AddVertex(a, new Dictionary<person, int>() { { b, 7 }, { d, 8 } }); |
| | | //dij.AddVertex(b, new Dictionary<person, int>() { { a, 7 }, { c, 2 },{ d,2} ,{ e,3} }); |
| | | //dij.AddVertex(c, new Dictionary<person, int>() { { b, 8 }, { e, 6 } }); |
| | | //dij.AddVertex(d, new Dictionary<person, int>() { { a, 8 },{ b,2} }); |
| | | //dij.AddVertex(e, new Dictionary<person, int>() { { b, 1 },{ c,2} }); |
| | | |
| | | //dij.ShortestPath(d, e).ForEach(x => Console.WriteLine(x)); |
| | | //ZTImage.Diagnostics.CodeTimer.Timer("dij", 10000, () => |
| | | //{ |
| | | // //g.ShortestPath('A', 'H').ForEach(x => Console.WriteLine(x)); |
| | | // dij.ShortestPath(a, b); |
| | | |
| | | //}); |
| | | |
| | | //Bitmap bm = new Bitmap("d:\\t2.png"); |
| | | //var ocr = new TesseractEngine("./tessdata", "eng", EngineMode.TesseractAndCube); |
| | | |
| | | //Page page=ocr.Process(bm); |
| | | //string text=page.GetText(); |
| | | //Console.WriteLine("识别出文字:" + text); |
| | | |
| | | |
| | | Console.ReadKey(); |