版权声明:如需转载,请注明出处。 https://blog.csdn.net/Young__Fan/article/details/82730272
在opencv中Mat类的构造函数中有一个构造函数可以直接把vector类转换为Mat类。
如下所示:
std::vector<cv::Point2f> points;
cv::Mat image(points); //image为一个points.size()行,2列的Mat型矩阵 (32FC1)
或者这样写:
std::vector<cv::Point2f> points;
Mat image = Mat(points); //image为一个points.size()行,2列的Mat型矩阵 (32FC1)