1 | initial version |
you're using the outdated c-api headers, which only contain deprecated functionality. instead use:
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
or the all-in-one umbrella header:
#include "opencv2/opencv.hpp"
2 | No.2 Revision |
you're using the outdated c-api headers, which only contain deprecated functionality.
instead (since you still use the outdated 2.4 version) use:
#include "opencv2/imgcodecs.hpp"
"opencv2/core/core.hpp"
#include "opencv2/highgui.hpp"
"opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
or the all-in-one umbrella header:also please avoid any c-api functions:
#include "opencv2/opencv.hpp"
using namespace cv;
int main()
{
Mat img = imread("C:\\opencv2_4_13\\sources\\samples\\data\\fruits.jpg");
Mat img1;
cvtColor(img, img1, COLOR_BGR2GRAY);
imshow("ex", img1);
waitKey(0);
return 0;
}
3 | No.3 Revision |
you're using the outdated c-api headers, which only contain deprecated functionality.
instead (since you still use the outdated 2.4 version) use:
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
also please avoid using any c-api functions:
using namespace cv;
int main()
{
Mat img = imread("C:\\opencv2_4_13\\sources\\samples\\data\\fruits.jpg");
Mat img1;
cvtColor(img, img1, COLOR_BGR2GRAY);
imshow("ex", img1);
waitKey(0);
return 0;
}
4 | No.4 Revision |
you're using the outdated c-api headers, which only contain deprecated functionality.
instead (since you still use the outdated 2.4 version) use:
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
also please avoid using any c-api functions:
using namespace cv;
int main()
{
Mat img = imread("C:\\opencv2_4_13\\sources\\samples\\data\\fruits.jpg");
if (img.empty())
{
// add a warning msg, if nessecary
return -1;
}
Mat img1;
cvtColor(img, img1, COLOR_BGR2GRAY);
imshow("ex", img1);
waitKey(0);
return 0;
}