读取图片 测试程序OpenCV

来源:互联网 发布:mac电脑打字出错 编辑:程序博客网 时间:2024/06/05 18:57

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;}


1 0
原创粉丝点击