How to build this library and examples under raspbian?
joelihn opened this issue · 7 comments
As in any other Linux distrib. First install Opencv (better build from sources). Then install qmake (comes with Qt packages) and use this project's *.pro files to build library and examples.
thank you. I build opencv 4.1.1 from sources and installed qmake.
but when i excute qmake, the cmd hints:
Project MESSAGE: OpenCL will be used for build
So i comment this line:
#include($${PWD}/../Shared/opencl.pri)
and modify some directory,like:
INCLUDEPATH += /home/pi/Joe/opencv/modules/core/include
INCLUDEPATH += /home/pi/Joe/opencv/modules/objdetect/include
INCLUDEPATH += /home/pi/Joe/opencv/modules/imgproc/include
INCLUDEPATH += /home/pi/Joe/opencv/modules/highgui/include
qmake is right,but make failed:
i@raspberrypi:~/Joe/vpglib/Library $ g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DOPENCV_DATA_DIR="/home/pi/Joe/opencv/data" -DDLL_BUILD_SETUP -DTARGET_OS_LINUX -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -Iinclude -I../../opencv/modules/core/include -I../../opencv/modules/objdetect/include -I../../opencv/modules/imgproc/include -I../../opencv/modules/highgui/include -isystem /usr/include/arm-linux-gnueabihf/qt5 -isystem /usr/include/arm-linux-gnueabihf/qt5/QtGui -isystem /usr/include/arm-linux-gnueabihf/qt5/QtCore -I. -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ -o faceprocessor.o src/faceprocessor.cpp
src/faceprocessor.cpp:107:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
#pragma omp parallel for private(ptr,tB,tG,tR) reduction(+:area,green)
src/faceprocessor.cpp:146:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
#pragma omp parallel for private(ptr,tB,tG,tR) reduction(+:area,green)
In file included from src/faceprocessor.cpp:18:0:
include/faceprocessor.h:115:35: error: ‘cv::VideoCapture’ has not been declared
double measureFramePeriod(cv::VideoCapture *_vcptr);
^~~~~~~~~~~~
src/faceprocessor.cpp: In member function ‘void vpg::FaceProcessor::enrollImage(const cv::Mat&, double&, double&)’:
src/faceprocessor.cpp:53:69: error: ‘CV_INTER_AREA’ was not declared in this scope
cv::resize(rgbImage, img, cv::Size(640, 360), 0.0, 0.0, CV_INTER_AREA);
^~~~~~~~~~~~~
src/faceprocessor.cpp:57:69: error: ‘CV_INTER_AREA’ was not declared in this scope
cv::resize(rgbImage, img, cv::Size(640, 480), 0.0, 0.0, CV_INTER_AREA);
^~~~~~~~~~~~~
src/faceprocessor.cpp:61:69: error: ‘CV_INTER_AREA’ was not declared in this scope
cv::resize(rgbImage, img, cv::Size(360, 640), 0.0, 0.0, CV_INTER_AREA);
^~~~~~~~~~~~~
src/faceprocessor.cpp:65:69: error: ‘CV_INTER_AREA’ was not declared in this scope
cv::resize(rgbImage, img, cv::Size(480, 640), 0.0, 0.0, CV_INTER_AREA);
^~~~~~~~~~~~~
src/faceprocessor.cpp: At global scope:
src/faceprocessor.cpp:278:46: error: ‘double vpg::FaceProcessor::measureFramePeriod’ is not a static data member of ‘class vpg::FaceProcessor’
double FaceProcessor::measureFramePeriod(cv::VideoCapture *_vcptr)
^~~~~~~~~~~~
src/faceprocessor.cpp:278:42: error: ‘VideoCapture’ is not a member of ‘cv’
double FaceProcessor::measureFramePeriod(cv::VideoCapture *_vcptr)
^~
src/faceprocessor.cpp:278:60: error: ‘_vcptr’ was not declared in this scope
double FaceProcessor::measureFramePeriod(cv::VideoCapture *_vcptr)
^~~~~~
src/faceprocessor.cpp:339:1: error: expected ‘}’ at end of input
} // end of namespace vpg
opencv.pri:
#--------------------------------------------------------OPENCV----------------------------------------------------
#Specify a path to the build directory of opencv library and library version
linux {
DEFINES += OPENCV_DATA_DIR=\"/home/pi/Joe/opencv/data\"
LIBS += -L/usr/local/lib
LIBS += -L/usr/local/bin
LIBS += -lopencv_core
-lopencv_objdetect
-lopencv_highgui
-lopencv_imgproc
-lopencv_videoio
-lopencv_imgcodecs
}
Sorry, but your log is not clear for me. What do you actually trying to compile? First you should build vpglib shared library. Use buildvpglib.pro file for that. Then build examples by using their *.pro files.
I’m trying build the shared library.
I run qmake and make, compile error as above.
Is there arguments when run qmake?
I know my problem, and now compile success.
Thanks for you reply.
Cool that you made it! I have also checked build process on raspberry and made some updates in examples *.pro files to make build process seamlessly.