我对此操作感到不安。我无法理解。我在哪里错过了?
vector<Mat> blobC;
for(unsigned int i = 0; i < blobCFinal.size(); i++)
{
blobC.at(i) = blobCFinal.at(i);
}
其中
vector<IplImage*> blobCFinal;
如果我没有错,通常的转换正常类型的方式是这样的,
IplImage* blobCFinal;
Mat blobC(blobCFinal);
Ans:感谢@rotating_image,可能会有效
vector<Mat> blobC;
for(unsigned int i = 0; i < blobCFinal.size(); i++)
{
Mat dummy = Mat(blobCFinal[i]);
blobC.push_back(dummy);
}
答案 0 :(得分:1)
试试这个......
vector<Mat> blobC;
vector<IplImage*> blobCFinal;
//some processing
for(unsigned int i = 0; i < blobCFinal.size(); i++)
{
Mat dummy = Mat(blobCFinal[i]);
blobC[i] = dummy.clone();
}