Trying to compile this sample project to familiarize yourself with OpenCV:
#include <cv.h> #include <highgui.h> using namespace cv; int main(int argc, char** argv) { Mat image = imread(argv[1], 1); if (argc != 2 || !image.data) { printf("No image data \n"); return -1; } namedWindow("Display Image", CV_WINDOW_AUTOSIZE); imshow("Display Image", image); waitKey(0); return 0; }
I get the following compilation errors:
Description Resource Path Location Type Field 'data' could not be resolved imageloader.cpp /Session4 line 8 Semantic Error Invalid arguments ' Candidates are: void imshow(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, const ? &) void imshow(const ? &, ?) ' imageloader.cpp /Session4 line 14 Semantic Error
Why can't I access the fields inside the Mat object? Not only the data field, but all the fields. I am creating an opencv library using c-make and MinGW +. I have included the appropriate header files and the lib path in the project properties.
Any help would be most appreciated.
source share