我具有由sourceImage萃取四角:檢索從變形的圖像拍攝的像素的原始座標
src_vertices[0] = corners[upperLeft];
src_vertices[1] = corners[upperRight];
src_vertices[2] = corners[downLeft];
src_vertices[3] = corners[downRight];
這些四角翹曲到destinationImage那樣:
dst_vertices[0] = Point(0,0);
dst_vertices[1] = Point(width, 0);
dst_vertices[2] = Point(0, height);
dst_vertices[3] = Point(width, height);
Mat warpPerspectiveMatrix = getPerspectiveTransform(src_vertices, dst_vertices);
cv::Size size_d = Size(width, height);
cv::Mat DestinationImage(width,height,CV_8UC3);
warpPerspective(sourceImage, destinationImage, warpPerspectiveMatrix, size_d, INTER_LINEAR, BORDER_CONSTANT);
現在我的問題是:
我有一個點p(x,y)米destinationImage我怎麼能檢索該點的座標在原sourceImage
換句話說,我想用warpPerspectiveMatrix做getPerspectiveTransform
如果您現在通過從目的地映射到源代碼獲得新的'warpPerspectiveMatrix',然後將其應用於單個點,則您將獲得後續的內容。這樣做有什麼問題? – mmgp