有没有什么方法可以使用 OpenCV 的 imread
函数从 std::in
中读取数据?
Mat imread( const string& filename, int flags=1 );
函数只接受文件名,但是 stdin 是否有一些“神奇”的值?
最佳答案
OpenCV 提供了对缓冲区而不是文件名起作用的 imdecode 函数。您需要先将标准输入读入缓冲区。
http://opencv.willowgarage.com/documentation/cpp/reading_and_writing_images_and_video.html
关于c++ - OpenCV:从 std::in 读取图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5457837/