代码如下:
#include<opencv2/opencv.hpp>
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include
using namespace cv;
using namespace std;
int main()
{
Mat firstimage=imread(“E:/视觉/图片集/warve缩小8倍.bmp”);
if(!firstimage.data){
cout<<“could not loading secondimage…”<<endl;
return -1;
}
imshow(“零”,firstimage);
Mat secondimage=imread(“由imwrite生成的图片.bmp”);
if(!secondimage.data){
cout<<“could not loading thirdimage…”<<endl;
return -1;}
imshow(“一”,secondimage);
Mat dstimage1,dstimage2;
dstimage1=dstimage2= Mat::zeros(300,300,CV_8UC3);
// Mat dstimage2= Mat::zeros(300,300,CV_8UC3);
resize( firstimage,dstimage1,dstimage1.size());
resize( secondimage,dstimage2,dstimage2.size());
imshow(“二”, dstimage1);
imshow(“三”, dstimage2);
// imwrite(“warve缩小8倍.bmp”, dstimage2);
waitKey(0);
return 0;
}