I am trying to use OpenCV on my Ubuntu machine but I am having some issues. I think I may not have gotten the latest version for OpenCV but I am not sure if that is the problem.
I installed OpenCV on my Ubuntu 11.10 using this link: https://help.ubuntu.com/community/OpenCV
I have some of the following code:
#include "cv.h"
using namespace cv;
...
Mat mat(width, height, CV_8UC2, buffer);
imwrite("test.jpg", mat);
The include directive and Mat() constructor works fine, but I can’t get imwrite to be recognized by the compiler:
g++ example.cpp -o example -lSDL -lpthread `pkg-config --cflags opencv --libs opencv`
example.cpp:64:40: error: ‘imwrite’ was not declared in this scope
I see on the page that I am linking to that it installs libcv2.1, but the current version is 2.3, which I think may be the issue.
I looked into synpatic package manager for another version of openCV but it’s the only one.
Could anyone please let me know if this is indeed the problem and how I can easily upgrade to the newest version please? I was trying to build OpenCV myself using CMake before but I was having issues building it correctly and so I decided to let apt-get do the work.
Thank you very much!
EDIT: (FOUND SOLUTION)
I am sorry, I just realized that it was a silly mistake, I forgot to include one header file:
#include "highgui.h"
Sorry about that!
I am sorry, I just realized that it was a silly mistake, I forgot to include one header file:
include "highgui.h"
Sorry about that!