#include "Algo.h" #include "QPolygon" #include using namespace std; Algo::Algo() { } Algo::~Algo() { } void Algo::translate(QPolygonF srcPos,QPolygonF dstPos) { Point2f srcVec[4]; Point2f dstTri[4]; srcVec[0].x = srcPos.at(0).x(); srcVec[0].y = srcPos.at(0).y(); srcVec[1].x = srcPos.at(1).x(); srcVec[1].y = srcPos.at(1).y(); srcVec[2].x = srcPos.at(2).x(); srcVec[2].y = srcPos.at(2).y(); srcVec[3].x = srcPos.at(3).x(); srcVec[3].y = srcPos.at(3).y(); dstTri[0].x = dstPos.at(0).x(); dstTri[0].y = dstPos.at(0).y(); dstTri[1].x = dstPos.at(1).x(); dstTri[1].y = dstPos.at(1).y(); dstTri[2].x = dstPos.at(2).x(); dstTri[2].y = dstPos.at(2).y(); dstTri[3].x = dstPos.at(3).x(); dstTri[3].y = dstPos.at(3).y(); /// ÇóµÃ·ÂÉä±ä»» Mat warp_mat = getAffineTransform(srcVec, dstTri); int a = 0; }