Asynchronous multithreaded Intrada ALPR
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Threading; | |
using Intrada.ALPR; | |
namespace RecognizeHotFolder | |
{ | |
class Program | |
{ | |
static void HandleResult(int id, string filename, Result result) | |
{ | |
Console.WriteLine( filename + "\t" + result ); | |
File.Delete(filename); | |
} | |
static void Main(string[] args) | |
{ | |
try | |
{ | |
ThreadedIntradaALPR intrada = new ThreadedIntradaALPR("COMPANY_NAME>", | |
"<COMPANY_KEY>", 4, "settings.txt",HandleResult); | |
string[] lastfilenames = Directory.GetFiles(".\\hotfolder", "*.jpg"); | |
while (!Console.KeyAvailable) | |
{ | |
string[] filenames = Directory.GetFiles(".\\hotfolder", "*.jpg"); | |
foreach (string filename in filenames.Except(lastfilenames)) | |
{ | |
intrada.Recognize(filename); | |
} | |
lastfilenames = filenames; | |
Thread.Sleep(1000); | |
} | |
intrada.Stop(); | |
Console.ReadLine(); | |
} | |
catch (IntradaException e) | |
{ | |
Console.WriteLine("Error: " + e); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment