Converting vector<Point3d> to a Mat of size (n x 3) and vice versa
问题 I have point clouds in the form of a vector of Point3d (vector). If I use the conversion provided by OpenCV, like cv::Mat tmpMat = cv::Mat(pts) //Here pts is vector<cv::Point3d> It gets converted into a Matrix with 3 channels. I want a single channel matrix with the dimensions nx3 (n - the number of elements in the vector). Is there any direct method to convert a vector of Point3d into an OpenCV Mat of size nx3? Now I'm doing cv::Mat1f tmpMat = cv::Mat::zeros(pts.size(), 3, cv::CV_32FC1); for