From 88e21c50da4eaaaeb638b05d26a30a682835dc66 Mon Sep 17 00:00:00 2001 From: Wu Zhangjin Date: Thu, 7 Jun 2018 22:16:48 +0800 Subject: [PATCH] config: fix up opencv version compatibility Fix up errors like https://github.com/liuruoze/EasyPR/issues/152 EasyPR/src/core/chars_identify.cpp:22:3: error: expected '(' for function-style cast or type construction LOAD_ANN_MODEL(ann_, kDefaultAnnPath); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EasyPR/include/easypr/config.h:141:42: note: expanded from macro 'LOAD_ANN_MODEL' model = ml::ANN_MLP::load(path); ~~~~~~~~~~~^ Tested in Mac OSX with opencv 3.4.1. Signed-off-by: Wu Zhangjin --- include/easypr/config.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/easypr/config.h b/include/easypr/config.h index 9634a305..07de2c87 100644 --- a/include/easypr/config.h +++ b/include/easypr/config.h @@ -1,8 +1,6 @@ #ifndef EASYPR_CONFIG_H_ #define EASYPR_CONFIG_H_ -#define CV_VERSION_THREE_ZERO - namespace easypr { enum Color { BLUE, YELLOW, WHITE, UNKNOWN }; @@ -131,7 +129,7 @@ private:\ } // Load model. compatitable withe 3.0, 3.1 and 3.2 -#ifdef CV_VERSION_THREE_TWO +#if (CV_VERSION_MAJOR >= 3) && (CV_VERSION_MINOR >= 2) #define LOAD_SVM_MODEL(model, path) \ model = ml::SVM::load(path); #define LOAD_ANN_MODEL(model, path) \