static bool matchTemplate_CCORR(InputArray _image, InputArray _templ, OutputArray _result) { if (useNaive(_templ.size())) return( matchTemplateNaive_CCORR(_image, _templ, _result)); else { if(_image.depth() == CV_8U) { UMat imagef, templf; UMat image = _image.getUMat(); UMat templ = _templ.getUMat(); image.convertTo(imagef, CV_32F); templ.convertTo(templf, CV_32F); return(convolve_32F(imagef, templf, _result)); } else { return(convolve_32F(_image, _templ, _result)); } } }
bool BTVL1::ocl_readNextFrame(Ptr<FrameSource>& /*frameSource*/) { ucurFrame_.convertTo(at(storePos_, uframes_), CV_32F); if (storePos_ > 0) { opticalFlow_->calc(uprevFrame_, ucurFrame_, at(storePos_ - 1, uforwardMotions_)); opticalFlow_->calc(ucurFrame_, uprevFrame_, at(storePos_, ubackwardMotions_)); } ucurFrame_.copyTo(uprevFrame_); return true; }