I\'m confused by the OpenCV Mat element types. This is from the docs:
There is a limited fixed set of primitive data types the library can operate on.
That i
In core.hpp you can find the following:
/*!
A helper class for cv::DataType
The class is specialized for each fundamental numerical data type supported by OpenCV.
It provides DataDepth::value constant.
*/
template class DataDepth {};
template<> class DataDepth { public: enum { value = CV_8U, fmt=(int)'u' }; };
template<> class DataDepth { public: enum { value = CV_8U, fmt=(int)'u' }; };
template<> class DataDepth { public: enum { value = CV_8S, fmt=(int)'c' }; };
template<> class DataDepth { public: enum { value = CV_8S, fmt=(int)'c' }; };
template<> class DataDepth { public: enum { value = CV_16U, fmt=(int)'w' }; };
template<> class DataDepth { public: enum { value = CV_16S, fmt=(int)'s' }; };
template<> class DataDepth { public: enum { value = CV_32S, fmt=(int)'i' }; };
// this is temporary solution to support 32-bit unsigned integers
template<> class DataDepth { public: enum { value = CV_32S, fmt=(int)'i' }; };
template<> class DataDepth { public: enum { value = CV_32F, fmt=(int)'f' }; };
template<> class DataDepth { public: enum { value = CV_64F, fmt=(int)'d' }; };
template class DataDepth<_Tp*> { public: enum { value = CV_USRTYPE1, fmt=(int)'r' }; };
You can see that CV_32S is the value for the type int, not int32_t.