sourceImageから抽出された4つのコーナーがあります:
src_vertices[0] = corners[upperLeft];
src_vertices[1] = corners[upperRight];
src_vertices[2] = corners[downLeft];
src_vertices[3] = corners[downRight];
これらの4つのコーナーは、次のように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);
今私の質問は:
destinationImageから取得したポイントp(x、y)があります。元のsourceImageでこのポイントの座標を取得するにはどうすればよいですか。
つまり、warpPerspectiveMatrixを使用して、getPerspectiveTransformの反対の作業を実行したいと思います。