OpenCV:从std ::中读取图像? [英] OpenCV: reading image from std::in?

查看:210
本文介绍了OpenCV:从std ::中读取图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有某种方法使用OpenCV的 imread 函数从 std :: in

Is there some way of using OpenCV's imread function to read from std::in?

Mat imread( const string& filename, int flags=1 );

函数仅接受文件名,但stdin有一些魔术值?

Function accepts only filename, but is there some "magic" value for stdin?

推荐答案

OpenCV提供了在缓冲区而不是文件名上工作的imdecode函数。您需要先将stdin读入缓冲区。

OpenCV provides imdecode functions that work on buffers instead of filename. You would need to read stdin into a buffer first.

http://opencv.willowgarage.com/documentation/cpp/reading_and_writing_images_and_video.html

这篇关于OpenCV:从std ::中读取图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆