parallel_for_
I'm not sure, that I can understand parallel_for_... I wrote simple class:
//header
class ParallelClass: public cv::ParallelLoopBody
{
private:
public:
ParallelClass();
void operator()( const cv::Range &r )const;
};
//cpp
ParallelClass::ParallelClass(){}
void ParallelClass::operator()( const cv::Range &r )const{
cout<<"start"<<endl;
}
and in the main function:
parallel_for_(cv::Range(0,10), ParallelClass());
I was expecting to see ten times "start",,, but looks like I'm totally wrong...
Works perfectly fine for me. Have you forgot to build with tbb-support? Also note (not directly related to your problem) that you should later write sth like
for (int i = r.start; i < r.end; ++i){}
to give each thread some more to do.