ANPR algorithm