void FractalGenerator::executeJob() { QMutexLocker locker( &m_mutex ); if ( m_enabled && m_regions.count() > 0 ) calculateRegion( m_regions.takeFirst() ); finishJob(); handleState(); }
void OpticalFlow::calculate(Mat prev, Mat img, Rect lastRect, bool clear) { if (clear) { data.boundingBox.width = 0; data.boundingBox.height = 0; data.points->clear(); } if (!data.points[0].empty() && !data.blocked) { vector<uchar> status; vector<float> err; calcOpticalFlowPyrLK(prev, img, data.points[0], data.points[1], status, err, data.winSize, 5, data.termcrit, 0, 0.001); resetNotFoundPoints(status, lastRect); movePoints(lastRect.width, lastRect.height); calculateRegion(); } }