0

変換された画像のキーポイントの新しい位置を計算する方法を教えてください。キーポイントは元の画像で検出されました。変換された画像を作成するために、opencv ホモグラフィ マトリックスと warpPerspective を使用しています。

ここにコードがあります..

...
 std::vector< Point2f > points1,points2;
 for( int i = 0; i < matches1.size(); i++ )
    {
     points1.push_back( keypoints_input1[matches1[i].queryIdx ].pt );
     points2.push_back( keypoints_input2[matches1[i].trainIdx ].pt );
    }
 /* Find the Homography Matrix for current and next frame*/
 Mat H1 = findHomography( points2, points1, CV_RANSAC );
 /* Use the Homography Matrix to warp the images*/
cv::Mat result1;
warpPerspective(input2, result1, H1, Size(input2.cols+150, input2.rows+150),              
INTER_CUBIC);
...
}

ここで、result1 画像の points2 の新しい位置を計算したいと思います。

たとえば、以下の変換された画像では、コーナー ポイントがわかっています。ここで、変換前のキーポイントの新しい位置を計算したいと思います {(x1,y1),(x2,y2),(x3,y3)...}, どのように計算できますか?

更新: opencv 'perspectiveTransform' は、私がやろうとしていることを行います。

4

1 に答える 1