I made the ~/.compile_opencv.sh as given https://help.ubuntu.com/community/OpenCV on this website and then I made this file opencvtest.cpp
with the following contents . The image path is a valid path .
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main() {
Mat img = imread("/home/AbKDs/Desktop/friends.jpg",CV_LOAD_IMAGE_COLOR);
imshow("opencvtest",img);
waitKey(0);
return 0;
}
I have created the alias opencv="~/.compile_opencv.sh". But when I run it shows the following error .
bash: /home/AbKDs/.compile_opencv.sh: Permission denied
Instead of this I tried the whole command but even then it shows fatal error .
opencvtest.cpp:1:39: fatal error: opencv2/highgui/highgui.hpp: No such file or directory
#include <opencv2/highgui/highgui.hpp>
^
compilation terminated.
Please help . Thanks in advance
opencv
, you install runtime libraries, but not the header files for development. In reglar use of OpenCV (by applications) you don't compile anything so you don't need to access any header files. You're developing with OpenCV (linking against) and then you need it. When built and distributed as a binary you don't need header files on the target system. And this holds for all general libraries for which you can use this 'recipe'. – gertvdijk Aug 27 '14 at 10:32