Configure license plate recognition system EasyPR1.6 environment under Ubuntu+Qt

1. Copy EasyPR_v1.6.zip to the virtual machine Ubuntu

Preferably in the opt folder, use

VMware tools

Shared folder

remote connection tool

2. Unzip to get the EasyPR folder

Modify file permissions

chmod -R 777 EasyPR

3. Find /opt/EasyPR/include/easypr/config.h

Tell us here, if the opencv version exceeds 3.2, you can use CV_VERSION_THREE_TWO

So change the ZERO of the macro definition CV_VERSION_THREE_ZERO at the beginning of the file to TWO

 

4. Execute ./build.sh under EasyPR

When 100%, a demo file will be generated, and then execute ./demo to use it

Test license plate detection

 

The test can be run successfully, and then the environment can be configured in Qt

5. Create a Qt project and modify the pro file

  1. Add OpenCV environment configuration
  2. Add EasyPR environment configuration

Why not directly use the dependent library files configured by EasyPR? After actual testing, it cannot be run in Ubuntu's Qt, so it can only be added manually.

1. Add the cpp file in pro:

/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. Add the header file in 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. Copy the model folder to the Qt project

The model folder in the EasyPR folder

4. Add in Pro file

INCLUDEPATH += /opt/EasyPR/include/

DISTFILES += \

    model/ann_chinese.xml \

    model/ann.xml \

    model/annCh.xml \

model/svm_hist.xml

5. There will be four errors when compiling, each error is reported, double-click to open the source file for modification, there is a problem with the path of the thirdparty header file, add "../../" to include

After modification: 

 

Here, if it can be compiled, it means that the configuration is successful

thanks for watching! ! ! !

The above is all the content. If it is helpful to you, please like and comment, or if you find something wrong, please correct me!

 

Guess you like

Origin blog.csdn.net/logani/article/details/128388299