[opencv]拼接合并轮廓集合mergeContours
/**
* 拼接合并轮廓集合
* @param contours
* @return
*/
vector<vector<Point>> mergeContours(vector<vector<Point>> contours){
vector<vector<Point>> allcontours;
vector<Point> contourslist;
for (int i = 0; i < contours.size(); i++){
vector<Point> vec_i;
vec_i = contours[i];
contourslist.insert(contourslist.end(),vec_i.begin(),vec_i.end());
}
allcontours.emplace_back(contourslist);
return contours;
}
Talk is cheap. Show me the code