// opencv2.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <opencv2/opencv.hpp>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "cv.h"
#include "highgui.h"
#include <cxcore.h>
using namespace cv;
using namespace std;
int main(int argc, char **argv)
{
CvPoint2D32f srcTri[4], dstTri[4];
CvMat* warp_mat = cvCreateMat(3, 3, CV_32FC1);
IplImage* src = NULL;
IplImage* dst = NULL;
src = cvLoadImage("test.jpg", 1);
dst = cvCloneImage(src);
dst->origin = src->origin;
cvZero(dst);
srcTri[0].x = 0;
srcTri[0].y = 0;
srcTri[1].x = src->width - 1;
srcTri[1].y = 0;
srcTri[2].x = 0;
srcTri[2].y = src->height - 1;
srcTri[3].x = src->width - 1;
srcTri[3].y = src->height - 1;
dstTri[0].x = src->width
opencv之WarpPerspective透视变化
最新推荐文章于 2024-07-28 00:30:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)