Sto sviluppando un'applicazione in OpenCV, e di Windows il seguente codice è valido, e compila/Works:OpenCV std :: vector <cv :: Point2f> per cv :: Mat
/* Calculate the transformation points */
std::vector<cv::Point2f> img1;
std::vector<cv::Point2f> img2;
for(int i = 0; i < good_matches.size(); i++) {
img1.push_back(keypoints_imageOne[ good_matches[i].queryIdx ].pt);
img2.push_back(keypoints_imageTwo[ good_matches[i].trainIdx ].pt);
}
/* Generate the homogonous matrix from the transformation points */
cv::Mat H = cv::findHomography(img1, img2, CV_RANSAC);
Tuttavia, quando passo a uno mio Mac o scatola Linux, ottengo un errore che dice che non c'è prototipo di funzione per gli argomenti (come il prototipo funzione richiede cv::Mat
al posto del std::vector<cv::Point2f>
)
Quindi il mio la domanda è: come posso/devo trasmettere da std::vector <cv::Point2f>
a cv::Mat
o come devo fare altrimenti?
Grazie, appena aggiornato e anche il casting su Mat (img1) ha rimosso l'errore prima dell'aggiornamento. : D – krslynx