我正在使用OpenCV 2.4.3,使用以下代码执行向量到矩阵的转换:
struct Component
{
cv::Rect box;
double area;
double circularity;
}
int main ( ... )
{
cv::vector < Component > components;
cv::Mat componentMat ( components, true );
std::cout << componentMat;
return 0;
}
但它会显示一个错误,内容如下:
OpenCV Error: Unsupported format or combination of formats() in unknown function, file ...\opencv\modules\core\src\out.cpp, line 111
我在这里做错了什么?有没有其他方法将这个向量转换为矩阵形式?谢谢。