请教tbb问题
class tbb_detection
{
public:
tbb_detection()
{
}
cv::Mat image_gray;
cv::Mat image_smooth;
std::vector<LPCascadeClassifier> v_findplate;
std::vector<cv::Rect> v_rect;
tbb::concurrent_vector<cv::Rect> tbb_rect;
double scale;
void operator ()(tbb::blocked_range<int>& rang)
{
for(int i=rang.begin();i<rang.end();i++)
{
v_rect=detection(v_findplate[i],scale);
}
}
tbb_detection(tbb_detection& x,tbb::split):v_findplate(x.v_findplate),image_gray(x.image_gray),image_smooth(x.image_smooth),scale(x.scale),v_rect(0)
{
}
void join(const tbb_detection& y)
{
tbb::spin_rw_mutex::scoped_lock mylock(vector_lock);
v_rect.insert(v_rect.end(),y.v_rect.begin(),y.v_rect.end());
}
};
最后发现并没有把所有的结果都合并起来,请问应该怎么处理呢?我用concurrent_vector也试过同样不行,谢谢