In OpenCV it's common to access a pixel in a Mat
object like so:
float b = A.at<float>(4,5);
The problem is, if you don't know the type of data apriori, you're stuck. Is there a way of writing generic function headers that accept a Mat
with template type T
? I'd like to build functions for linear algebra calculations, and I don't want to have an if
clause separating double
and float
. Something like:
void func(Mat <T> a) {
a.at<T>(3,4) = ...
Is this possible in OpenCV?