1.将EasyPR_v1.6.zip拷贝到虚拟机Ubuntu中
最好是在opt文件夹中 ,可使用
VMware tools
共享文件夹
远程连接工具
2.解压得到EasyPR文件夹
修改文件权限
chmod -R 777 EasyPR
3.查找/opt/EasyPR/include/easypr/config.h中
这边告诉我们,如果opencv版本超过3.2以上可以使用CV_VERSION_THREE_TWO
所以把该文件开头的宏定义CV_VERSION_THREE_ZERO的ZERO改为TWO
4.在EasyPR下执行./build.sh
当100%时会生成一个demo文件,然后执行./demo就可以使用了
测试一下车牌检测
测试成功可以运行,接下来可以在Qt中配置环境
5. 创建Qt工程修改pro文件
- 添加OpenCV环境配置
- 添加EasyPR 环境配置
为什么不直接使用EasyPR配置好的依赖库文件呢,经过实测在Ubuntu的Qt中是运行不了的,所以只能手动添加
1.在pro中添加cpp文件:
/opt/EasyPR/src/core/chars_identify.cpp \
/opt/EasyPR/src/core/chars_recognise.cpp \
/opt/EasyPR/src/core/chars_segment.cpp \
/opt/EasyPR/src/core/core_func.cpp \
/opt/EasyPR/src/core/feature.cpp \
/opt/EasyPR/src/core/params.cpp \
/opt/EasyPR/src/core/plate_detect.cpp \
/opt/EasyPR/src/core/plate_judge.cpp \
/opt/EasyPR/src/core/plate_locate.cpp \
/opt/EasyPR/src/core/plate_recognize.cpp \
/opt/EasyPR/src/train/ann_train.cpp \
/opt/EasyPR/src/train/annCh_train.cpp \
/opt/EasyPR/src/train/create_data.cpp \
/opt/EasyPR/src/train/svm_train.cpp \
/opt/EasyPR/src/train/train.cpp \
/opt/EasyPR/src/util/kv.cpp \
/opt/EasyPR/src/util/program_options.cpp \
/opt/EasyPR/src/util/util.cpp \
/opt/EasyPR/thirdparty/LBP/helper.cpp \
/opt/EasyPR/thirdparty/LBP/lbp.cpp \
/opt/EasyPR/thirdparty/mser/mser2.cpp \
/opt/EasyPR/thirdparty/svm/corrected_svm.cpp \
/opt/EasyPR/thirdparty/textDetect/erfilter.cpp \
/opt/EasyPR/thirdparty/xmlParser/xmlParser.cpp \
2.在pro中添加头文件
/opt/EasyPR/include/easypr/core/character.hpp \
/opt/EasyPR/include/easypr/core/chars_identify.h \
/opt/EasyPR/include/easypr/core/chars_recognise.h \
/opt/EasyPR/include/easypr/core/chars_segment.h \
/opt/EasyPR/include/easypr/core/core_func.h \
/opt/EasyPR/include/easypr/core/feature.h \
/opt/EasyPR/include/easypr/core/params.h \
/opt/EasyPR/include/easypr/core/plate.hpp \
/opt/EasyPR/include/easypr/core/plate_detect.h \
/opt/EasyPR/include/easypr/core/plate_judge.h \
/opt/EasyPR/include/easypr/core/plate_locate.h \
/opt/EasyPR/include/easypr/core/plate_recognize.h \
/opt/EasyPR/include/easypr/train/ann_train.h \
/opt/EasyPR/include/easypr/train/annCh_train.h \
/opt/EasyPR/include/easypr/train/create_data.h \
/opt/EasyPR/include/easypr/train/svm_train.h \
/opt/EasyPR/include/easypr/train/train.h \
/opt/EasyPR/include/easypr/util/kv.h \
/opt/EasyPR/include/easypr/util/program_options.h \
/opt/EasyPR/include/easypr/util/switch.hpp \
/opt/EasyPR/include/easypr/util/util.h \
/opt/EasyPR/include/easypr/api.hpp \
/opt/EasyPR/include/easypr/config.h \
/opt/EasyPR/include/easypr/version.h \
/opt/EasyPR/include/easypr.h \
/opt/EasyPR/test/accuracy.hpp \
/opt/EasyPR/test/chars.hpp \
/opt/EasyPR/test/config.hpp \
/opt/EasyPR/test/plate.hpp \
/opt/EasyPR/test/result.hpp \
/opt/EasyPR/thirdparty/LBP/helper.hpp \
/opt/EasyPR/thirdparty/LBP/lbp.hpp \
/opt/EasyPR/thirdparty/mser/mser2.hpp \
/opt/EasyPR/thirdparty/svm/precomp.hpp \
/opt/EasyPR/thirdparty/textDetect/erfilter.hpp \
/opt/EasyPR/thirdparty/xmlParser/xmlParser.h \
3.将model文件夹拷贝到Qt工程下
EasyPR文件夹中的model文件夹
4.Pro文件中添加
INCLUDEPATH += /opt/EasyPR/include/
DISTFILES += \
model/ann_chinese.xml \
model/ann.xml \
model/annCh.xml \
model/svm_hist.xml
5.编译时会出现四个报错,每一个报错,双击打开源码文件进行修改,thirdparty头文件路径存在问题在include增加“../../”
修改后:
到这边, 若能编译通过,那就是配置成功了
感谢观看!!!!
以上就是全部内容,如果对您有帮助,欢迎点赞评论,或者发现有哪里写错的,欢迎指正!