Tuesday 19 November 2019

openCV Troubleshooting (2) : error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope


This is due to different versions of openCV. Things got update to different names.

Didn't work:
image1=  cv::imread("test.bmp", CV_LOAD_IMAGE_GRAYSCALE);

Didn't work:
image1=  cv::imread("test.bmp", IMREAD_GRAYSCALE);

WORKED!!!!!
image1=  cv::imread("test.bmp", cv::ImreadModes::IMREAD_GRAYSCALE);


ref:
https://stackoverflow.com/questions/27424285/cv-load-image-grayscale-is-not-definedpy
https://stackoverflow.com/questions/22547416/open-cv-flags-dont-work

No comments:

Post a Comment