我具有由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