OpenCV function to convert 8U image to 16U

Does anyone know of any features in OpenCV that support conversion 8Uto 16U? I tried cvConvertImage, cvConvertScalebut they are all designed to work only with image formats 8U.

+3
source share
1 answer

If you are using the new C ++ API, check Mat::convertTo

Mat a(rows, cols, CV_8U);
Mat b;
a.convertTo(b, CV_16U);
+5
source

All Articles