Can I use the OpenCV imread function to read from std::in ?
imread
std::in
Mat imread( const string& filename, int flags=1 );
The function accepts only the file name, but is there any βmagicβ value for stdin?
OpenCV provides imdecode functions that work with buffers instead of a file name. First you will need to read stdin into the buffer.
http://opencv.willowgarage.com/documentation/cpp/reading_and_writing_images_and_video.html
If you want to crack very quickly, here is what works on Linux:
#include <unistd.h> /* snip */ std::stringstream ss; ss << "/proc/" << getpid() << "/fd/0"; cv::Mat m = cv::imread(ss.str());
No,
But if you really want to, you can pass stdin to the named pipe (mkfifo) and read it.
Source: https://habr.com/ru/post/1469289/More articles:Java 7 fork / join framework does not use all available processor power - javaLogical operators - short (relational) and long (vector) forms - comparisonPython-opencv: reading image data from stdin - pythonHow to intersect two smooth shapes in OpenGL? - opengl-esHow to efficiently get n last rows with GROUP BY in sqlite? - sqlCan I get the GUID generated by CMake for a specific vcproj at the time of cmake? - guidMerging a new array of elements with an existing Nockoutout array causes binding errors - spliceSpring REST-ful uri with optional request - javatimeout for InetSocketAddress - javaWhat is the meaning of several reports listed in a single SSRS report? - sqlAll Articles