2 #include <visp3/core/vpImageConvert.h> 3 #include <visp3/io/vpImageIo.h> 7 #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) 10 #if VISP_HAVE_OPENCV_VERSION >= 0x030200 11 int flags = cv::IMREAD_GRAYSCALE | cv::IMREAD_IGNORE_ORIENTATION;
12 #elif VISP_HAVE_OPENCV_VERSION >= 0x030000 13 int flags = cv::IMREAD_GRAYSCALE;
14 #elif VISP_HAVE_OPENCV_VERSION >= 0x020100 15 int flags = CV_LOAD_IMAGE_GRAYSCALE;
18 A = cv::imread(
"monkey.bmp", flags);
27 std::cout <<
"Catch an exception: " << e << std::endl;
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
error that can be emited by ViSP classes.
static void write(const vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)