资 源 简 介
#include #include using namespace std;using namespace cv;int main(){Mat image, gray,dst; image = imread("D:/ps/fly_.jpg"); if (!image.data) { cout << "could not found" << endl; return -1; } namedWindow("原图"); imshow("原图", image); cvtColor(image, gray,CV_BGR2GRAY); namedWindow("灰度"); imshow("灰度", gray); int rows = gray.rows; int cols = gray.cols;// int channel = image.channels();// dst.create(image.size(), image.type());