#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
using namespace std;
using namespace cv;
/// 全局变量
Mat img; Mat img2; Mat templ; Mat result;
Mat img_display;
///
Mat imgscale; Mat imgrotate;
char* image_window = "Source Image";
char* result_window = "Result window";
int match_method;
int max_Trackbar = 5;
int scale =1;
/// 函数声明
void MatchingMethod(int, void*);
int main(int argc, char** argv)
{
// 读图片
img = imread("C:/Users/Administrator/Desktop/phasecorr/phase_corr/Debug/44.jpg", 1);
img2 = imread("C:/Users/Administrator/Desktop/phasecorr/phase_corr/Debug/figure.png", 1);
templ = Mat(img2.size()*5, img2.type(), cv::Scalar::all(0));
//放大缩小图像
/*
resize(img2, templ, templ.size(), 0, 0, CV_INTER_LINEAR);
namedWindow("scalewindow", CV_WINDOW_AUTOSIZE);
imshow("scalewind
OpenCv学习之一:模版匹配
最新推荐文章于 2024-06-06 10:18:07 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)