I'm trying to compile simple OpenCV code on the BeagleBoard XM, running Ångström Linux.
I know my way in OpenCV, but only under Windows and Visual Studio. I'm fairly with non-Microsoft OSes.
I think I've installed OpenCV on the BeagleBoard (opkg install opencv
, right?), and I've transferred my code, which for now look like this:
#include <opencv2/opencv.h>
int main()
{
cv::Mat img(100, 100, CV_8U);
cv::imshow("Hello world", img);
cv::waitkey();
return 0;
}
How can I compile this code under the BeagleBoard? How can I tell it where the .so files are? Where are the OpenCV .so files?
Have a look at ECE597 OpenCV on the BeagleBoard for installation instructions.
If you have installed it properly, then open a terminal window and browse to the folder where you have put the code. Once there, use the following command to compile the code in file "main.cpp"
g++ main.cpp -o out `pkg-config --cflags --libs opencv`
After the code is compiled, use the following command to execute it.
./out
Also look at the answers to Stack Overflow question How to install OpenCV on Ångström Linux?.