I'm creating a module that should accept an OpenCV matrix. I'm new to OpenCV and effectively not using the library, so maybe my question is naive.
I would like to have a function that accepts OpenCV types as widely as possible (cv::Mat
, cv::Mat_<T>
, cv::Matx<T,M,N>
), however I need to know the underlying value-type at compile-time.
My question is: Is the value-type known at compile-time for cv::Mat
? It seems that one can cast, and that one can extract it at run-time. But can it be found at compile-time? My guess is no, because the underlying value-type is non-standard. But if it is known, how do I get it?
This does not seem to work:
template <class T>
inline void foo(const T& bar)
{
using value_type = typename std::decay_t<T>::value_type;
}