I set up a hello world project [here](https://bitbucket.org/BenNG/hello-cpp/src/11e229362b4788afb24d99f16f40a8c93c496770?at=master) which is basically a copy/paste of the samples from the gradle project [here](https://github.com/gradle/gradle/tree/master/subprojects/docs/src/samples/native-binaries/cpp).
My next step is a hello world but for the OpenCV framework. It's going to read a picture in memory and display it. To be precise, the main.cpp will we more like that
#include
#include
using namespace cv;
int main(int argc, char** argv )
{
if ( argc != 2 )
{
printf("usage: DisplayImage.out \n");
return -1;
}
Mat image;
image = imread( argv[1], 1 );
if ( !image.data )
{
printf("No image data \n");
return -1;
}
namedWindow("Display Image", WINDOW_AUTOSIZE );
imshow("Display Image", image);
waitKey(0);
return 0;
}
As you can see I include the OpenCV header but I'm struggling adding the lib itself via gradle. I probably have to use the [prebuilt](https://github.com/gradle/gradle/tree/master/subprojects/docs/src/samples/native-binaries/prebuilt) way but I fail.
any ideas ?
Thank you!
↧