读取图片 测试程序OpenCV

版权声明:本文为@那年聪聪 原创文章,未经博主允许不得转载。 https://blog.csdn.net/duan19920101/article/details/53502105

OpenCV读取图片的测试程序,仅供测试使用。

#include "stdafx.h"
#include <opencv2\opencv.hpp>
#include <iostream>
#include <string>
using namespace cv;
using namespace std;
 int main()
 {
	 Mat dst;
	    Mat img = imread("8.26.bmp");
		threshold(img, dst, 254, 255, CV_THRESH_BINARY);
	     if (img.empty())
		    {
		        cout << "error";
		        return -1;
		    }
	    imshow("xx", img);
		imwrite("2.bmp", dst);
	    waitKey();
	
		   return 0;
}


猜你喜欢

转载自blog.csdn.net/duan19920101/article/details/53502105