资 源 简 介
#include #include #include #include using namespace std;using namespace cv;int main(){//图像读取Mat image = imread("D:/ps/meiyuan.png");//判断图像读取是否有问题if (!image.data){cout << "image read is error!" << endl;return 0;}//图像基本信息输出cout << "image Info:Height:" << image.size().height << " Width:" << image.size().width << endl;//原始图像显示namedWindow("Original Image");imshow("Original Image", image);imwrite("original.jpg", image);//处理图像Mat image_tmp = image.clone();int nl = image.rows;int nc = image.cols * image.channels(); //实际列if (image.isContinuous()){nc = nc * nl;nl = 1;}