#include "stdafx.h"
#include<opencv2/opencv.hpp> //Include file for every supported Opencv function
#include<iostream>
using namespace std;
using namespace cv;
#include<iostream>
using namespace std;
using namespace cv;
//这句可以不要了,原来是图片后缀名,垃圾win10
//#pragma comment(lib,"opencv_world330d.lib") //强调采用debug模式的依赖链接库,显示图片用,虽然没有调出来
//#pragma comment(lib,"opencv_world330d.lib") //强调采用debug模式的依赖链接库,显示图片用,虽然没有调出来
int main(int argc, char ** argv[])
{
Mat img = imread("D:\\picture\\test.jpg",-1); //之前没有显示出来是win10文件后缀名的语言,
// 保存的图片后面不要.jpg就可以
{
Mat img = imread("D:\\picture\\test.jpg",-1); //之前没有显示出来是win10文件后缀名的语言,
// 保存的图片后面不要.jpg就可以
//因为默认带了.jpg,所有图片必须小心
//判断是否读取到了图片
if (img.empty())
{
cout << "can't read the image!" << endl;
return -1;
}
{
cout << "can't read the image!" << endl;
return -1;
}
//namedWindow("Example1",WINDOW_AUTOSIZE); //窗口大小可变 ,图片太大或者分辨率问题采用下面一种
namedWindow("Example1", 0);
imshow("Example1", img); //路径写对,否则这里会产生错误/异常
waitKey(0); //触发任意按键便退出
destroyWindow("Example1"); //关闭窗口
return 0;
}