void TemplateTracker::setTemplateImage(const Img8u &templateImage, float rotationStepSizeDegree){ Img8u test = templateImage; test.scale(test.getSize()*4); RotateOp rot; ICLASSERT_RETURN(rotationStepSizeDegree > 0.001); const int w = templateImage.getWidth(); const int h = templateImage.getHeight(); data->lut.clear(); for(float a=0;a<=360;a+=rotationStepSizeDegree){ rot.setAngle(a); const Img8u *r = rot.apply(&templateImage)->as8u(); const int rw = r->getWidth(); const int rh = r->getHeight(); Rect center((rw-w)/2, (rh-h)/2, w,h); SmartPtr<const Img8u> roiimage = r->shallowCopy(center); Img8u *tmp = new Img8u(test.getSize()/4,1); // data->lut.push_back(roiimage->deepCopyROI()); roiimage->scaledCopyROI(tmp,interpolateLIN); data->lut.push_back(tmp); } }