尝试从opencv_contrib示例编译character_recognition.cpp

时间:2017-01-24 08:55:35

标签: opencv tesseract

我刚刚安装了opencv 3.2和tesseract模块。现在我尝试编译opencv_contrib文件夹中的character_recognition.cpp示例。如果我使用命令pkg-config --cflags --libs opencv,则显示

-I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dpm -lopencv_freetype -lopencv_fuzzy -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_plot -lopencv_dnn -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core

但是如果我尝试编译che cpp文件

g++ -ggdb `pkg-config --cflags --libs opencv` character_recognition.cpp -o  character_recognition

它告诉我cv::imread(cv::String const&, int)它没有定义,并且代码中使用的opencv库的每个函数都有这种错误。

似乎我无法链接库。你能帮助我吗?

0 个答案:

没有答案