Skip to content

Instantly share code, notes, and snippets.

@berak
Last active January 1, 2016 09:19
Show Gist options
  • Save berak/8123977 to your computer and use it in GitHub Desktop.
Save berak/8123977 to your computer and use it in GitHub Desktop.
#include "opencv2/core/core.hpp"
template <class T> void process( Mat_<T> & m, T & res, int i, int j)
{
T a = m(0,0);
T b = m(i,j);
res = a+b;
}
int main()
{
Mat_<float> m(4,4,3.3f);
float r;
process(m,r,2,2);
//cerr << r << endl << m << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment