Hello
I was hoping someone with knowledge in OpenMP would be able to assist me. I am trying to read in a frame using a single thread then have 3 separate threads doing different operations on the frame. I would then merge and display the results on a single frame. The problem is that I am getting weird results for eg.
1) the flip operation does not get called. 2) it sometimes lag
Mat frame
omp_set_num_threads(3);
#pragma omp parallel shared(frame)
{
int TID = omp_get_thread_num();
while(true)
{
vector<Object> objects;
#pragma omp single
{
// read in frame
flip(frame, frame, 1);
}
if(TID == 0)
{
// process frame
// Store result in vector<Object>
}
else
{
// process frame with a different operation
// Store result in vector<Object>
}
#pragma omp barrier
#pragma omp single
{
// merge results
// do some drawing on frame based on results
imshow(frame);
}
}
}