First time here? Check out the FAQ!
answered 2013-04-10 12:07:07 -0600
you always should check resources:
Mat img; imread("im1.jpg",1); if ( img.empty() ) { cerr << "whaa!" << endl; return 0; }
same for the templ image