gpt4 book ai didi

opencv - 从vector 转换为vector

转载 作者:行者123 更新时间:2023-12-02 17:53:17 26 4
gpt4 key购买 nike

我为此操作感到烦恼。我无法通过。我在哪里想念?

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);

回答:感谢@rotating_image,这可能会起作用
vector<Mat> blobC;
for(unsigned int i = 0; i < blobCFinal.size(); i++)
{
Mat dummy = Mat(blobCFinal[i]);
blobC.push_back(dummy);
}

最佳答案

试试这个...

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();
}

关于opencv - 从vector <IplImage *>转换为vector <Mat>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14411829/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com