简体   繁体   English

OpenCV function 将8U图像转换为16U

[英]OpenCV function to convert 8U image to 16U

Is anyone aware of any functions in OpenCV which support 8U to 16U conversion?有人知道 OpenCV 中支持8U16U转换的任何功能吗? I tried cvConvertImage , cvConvertScale but they are all meant to operate only on 8U image formats.我试过cvConvertImagecvConvertScale但它们都只能在8U图像格式上运行。

If you're using the newer C++ API, then check out Mat::convertTo如果您使用的是较新的 C++ API,请查看Mat::convertTo

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM