代码如下:?
?#include <opencv2/opencv.hpp>
int main(int argc, char** argv) {
? ? cv::Mat img1, img2;
? ? cv::namedWindow("Example1", cv::WINDOW_AUTOSIZE);
? ? cv::namedWindow("Example2", cv::WINDOW_AUTOSIZE);
? ? img1 = cv::imread(argv[1]);
? ? cv::imshow("Example1", img1);
? ? cv::pyrDown(img1, img2);
? ? cv::imshow("Example2", img2);
? ? cv::waitKey(0);
? ? return 0;
};
执行的时候报错:
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, file C:\builds\master_PackSlave-win64-vc12-shared\opencv\modules\highgui\src\window.cpp, line 271
解决办法:opencv-world300lib 放在opencv-ts300lib的后面
参考: