I am learning opencv in c++ but visual studio (2017 community) cant recognize the enum COLOR_BGR2GRAY but it recognizes other functions of opencv.
here is the source code:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <Windows.h>
using namespace cv;
using namespace std;
void drawSquares(Mat image);
int main(int argc, char** argv)
{
if (argc != 2)
{
cout << " Usage: display_image ImageToLoadAndDisplay" << endl;
return -1;
}
Mat image;
image = imread(argv[1], IMREAD_COLOR); // Read the file
if (!image.data) // Check for invalid input
{
cout << "Could not open or find the image" << std::endl;
return -1;
}
namedWindow("Display window", WINDOW_AUTOSIZE); // Create a window for display.
imshow("Display window", image); // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window
return 0;
}
void drawSquares(Mat image)
{
Mat image_gray;
cvCvtColor(&image, &image_gray, COLOR_BGR2GRAY); //***it doest recognize this enum in this line***
}
Any idea why it does recognize the functions but not COLOR_BGR2GRAY enum?