First the code:
#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main( int argc, char** argv )
{
Mat image;
image = imread( "MyPic.jpg", CV_LOAD_IMAGE_GRAYSCALE );
if( !image.data )
{
printf( "No image data \n" );
return -1;
}
namedWindow( "Display Image", CV_WINDOW_AUTOSIZE);
imshow( "Display Image", image );
waitKey(0);
return 0;
}
A simple program that just loads an image with then name "MyPic.jpg" , this is an example that I found on the open CV website documentation (with small changes). It gives me these two error:
‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
‘CV_WINDOW_AUTOSIZE’ was not declared in this scope
Why is it not working? What's wrong?