Skip to content

Instantly share code, notes, and snippets.

@msinnema msinnema/sample.cs

Created Jun 6, 2018
Embed
What would you like to do?
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
You can’t perform that action at this time.