Merge branch 'master' of github.com:openalpr/openalpr

This commit is contained in:
Matt Hill
2016-06-17 10:15:42 -04:00
7 changed files with 130 additions and 54 deletions

View File

@@ -1,9 +1,12 @@
al @@###@@
ad @####
al @@###@@
am ###@@###
am ##@@###
am ###@@##
am ##@@##
at @@???
at @@????
at @@?????
@@ -12,32 +15,72 @@ at @???
at @????
at @?????
at @??????
az ##@@###
by ####@@#
be #@@@###
be ###@@@
ba [AEJKMOT]##[AEJKMOT]###
ba [T][A]######
ba [T][T]######
ba ######[AEJKT]
ba [T][T]######
ba ######[AEJKT]
be #@@@###
be ###@@@
bg @@####@@
bg @####@@
by ####@@#
ch @@######
ch [APM]######
cy @@@###
cz #@#####
cz #@@####
de @@@@####
de @@@@###
de @@@@##
de @@@@#
de @@@####
de @@@###
de @@@##
de @@@#
de @@@@####[HE]
de @@@@###[HE]
de @@@@##[HE]
de @@@####[HE]
de @@@###[HE]
de @@@##[HE]
de @@@#[HE]
dk @@#####
ee ###@@@
es ####@@@
es @####@@@
fi @@@###
fr @@###@@
gb @@##@@@
ge @@###@@
gi [G]####@
gr @@@####
hr @@###@@
hr @@####@@
hr @@###@
hr @@####@
cy @@@###
cz #@#####
cz #@@####
dk @@#####
ee ###@@@
fi @@@###
fr @@###@@
ge @@###@@
gi [G]####@
gr @@@####
hu @@@###
is @@@##
ie ##[12][CDGLTW]######
ie ##[12][CDGKLMORSTW][DEHKLMNOSWXY]######
ie ##[12][CDGLTW]#####
@@ -54,27 +97,40 @@ ie ##[CDGLTW]####
ie ##[CDGKLMORSTW][DEHKLMNOSWXY]####
ie ##[CDGLTW]###
ie ##[CDGKLMORSTW][DEHKLMNOSWXY]###
is @@@##
it @@###@@
kz ###@@@
li @@#####
li @@####
li @@###
lt @@@###
lu @@####
lv @@####
lv @@###
lv @####
lv @###
li @@#####
li @@####
li @@###
lt @@@###
lu @@####
mk @@####@@
mt @@@###
mc ????
md @@@@###
md [CK]@@###
md @@@@##
md [CK]@@##
md @@@@#
md [CK]@@#
mc ????
me @@@@###
mk @@####@@
mt @@@###
nl @@####
nl ####@@
nl ##@@##
@@ -89,8 +145,10 @@ nl @@@##@
nl @##@@@
nl #@@###
nl ###@@#
no @@#####
no #####
pl @@#####
pl @@####@
pl @@###@@
@@ -105,34 +163,40 @@ pl @@@@@##
pl @@@#####
pl @@@####@
pl @@@###@@
pt @@####
pt ####@@
pt ##@@##
pt @@##@@
pt @@@@##
pt ##@@@@
ro @@###@@@
ro @@##@@@
ro @###@@@
ro @##@@@
rs @@###@@
ru @###@@##
ru @###@@###
se @@@###
si @@@@###
sk @@###@@
sm @####
sm @###
rs @@###@@
sk @@###@@
si @@@@###
es ####@@@
es @####@@@
se @@@###
ch @@######
ch [APM]######
tr ##@####
tr ##@#####
tr ##@@###
tr ##@@####
tr ##@@@##
ua @@####@@
gb @@##@@@
va [S][C][V]#####
va [C][V]#####

View File

@@ -62,6 +62,11 @@ IF (WIN32 AND WITH_DAEMON)
SET(WITH_DAEMON OFF)
ENDIF()
IF (WIN32 AND WITH_TESTS)
MESSAGE(WARNING "Skipping unit tests, as it is not supported in Windows.")
SET(WITH_TESTS OFF)
ENDIF()
IF(Tesseract_FRAMEWORK_PATH AND Leptonica_FRAMEWORK_PATH)
MESSAGE(STATUS "Using Tesseract iOS framework: ${Tesseract_FRAMEWORK_PATH}")
MESSAGE(STATUS "Using Leptonica iOS framework: ${Leptonica_FRAMEWORK_PATH}")

View File

@@ -7,13 +7,6 @@
extern "C" {
#if defined(_MSC_VER)
// Microsoft
#define OPENALPR_EXPORT __declspec(dllexport)
#else
// do nothing
#define OPENALPR_EXPORT
#endif
//using namespace alpr;
OPENALPR_EXPORT Alpr AlprInit(char* country, char* configFile, char* runtimeDir) {

View File

@@ -1,17 +1,26 @@
#if defined(_MSC_VER)
// Microsoft
#define OPENALPR_EXPORT __declspec(dllexport)
#else
// do nothing
#define OPENALPR_EXPORT
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef void* Alpr;
Alpr AlprInit(char* country, char* configFile, char* runtimeDir);
void SetDetectRegion(Alpr alpr, int detectRegion);
void SetTopN(Alpr alpr, int topN);
void SetDefaultRegion(Alpr alpr, char* region);
int IsLoaded(Alpr alpr);
void Unload(Alpr alpr);
char* RecognizeByFilePath(Alpr alpr, char* filePath);
char* RecognizeByBlob(Alpr alpr, char* imageBytes, int len);
char* GetVersion();
OPENALPR_EXPORT Alpr AlprInit(char* country, char* configFile, char* runtimeDir);
OPENALPR_EXPORT void SetDetectRegion(Alpr alpr, int detectRegion);
OPENALPR_EXPORT void SetTopN(Alpr alpr, int topN);
OPENALPR_EXPORT void SetDefaultRegion(Alpr alpr, char* region);
OPENALPR_EXPORT int IsLoaded(Alpr alpr);
OPENALPR_EXPORT void Unload(Alpr alpr);
OPENALPR_EXPORT char* RecognizeByFilePath(Alpr alpr, char* filePath);
OPENALPR_EXPORT char* RecognizeByBlob(Alpr alpr, char* imageBytes, int len);
OPENALPR_EXPORT char* GetVersion();
#ifdef __cplusplus
}
#endif

View File

@@ -19,6 +19,7 @@
#include "edgefinder.h"
#include "textlinecollection.h"
#include "support/timing.h"
using namespace std;
using namespace cv;
@@ -325,7 +326,7 @@ namespace alpr
{
for (unsigned int x = 0; x < crop.cols; x += stride)
{
contrast += pow( ((crop.at<unsigned char>(y,x) / 255.0) - avg_intensity), 2.0f);
contrast += pow( ((crop.at<unsigned char>(y,x) / 255.0) - avg_intensity), 2.0);
}
}
contrast /= ((float) rows) * ((float)cols);

View File

@@ -17,7 +17,7 @@
long tv_nsec; // Nanoseconds - [0, 999999999]
};
#else
//#define timespec timeval
#define timespec timeval
#endif
#else
#include <sys/time.h>

View File

@@ -124,6 +124,10 @@ Point LineSegment::midpoint()
return Point(midX, midY);
}
int round_int(double r) {
return (r > 0.0) ? (r + 0.5) : (r - 0.5);
}
LineSegment LineSegment::getParallelLine(float distance)
{
float diff_x = p2.x - p1.x;
@@ -132,8 +136,8 @@ LineSegment LineSegment::getParallelLine(float distance)
float dist_x = distance * cos(angle);
float dist_y = -distance * sin(angle);
int offsetX = (int)round(dist_x);
int offsetY = (int)round(dist_y);
int offsetX = (int)round_int(dist_x);
int offsetY = (int)round_int(dist_y);
LineSegment result(p1.x + offsetX, p1.y + offsetY,
p2.x + offsetX, p2.y + offsetY);