I have a cv::Mat with N rows and 2 columns. What is the fastest way to turn that into a std::vector of cv:Point2d?
Currently I'm doing a for loop with manual assignment:
std::vector<cv::Point2d> vector;
cv::Mat centroids;
for (int i=0; i<N; i++) {
vector.push_back(cv::Point2d(centroids.at<double>(i, 0), centroids.at<double>(i, 1)));
}
I'm working with opencv 3.2