4 #include <visp3/core/vpImageConvert.h> 5 #include <visp3/io/vpImageIo.h> 7 #if VISP_HAVE_OPENCV_VERSION >= 0x020300 8 #include <opencv2/core/core.hpp> 9 #include <opencv2/imgproc/imgproc.hpp> 14 #if VISP_HAVE_OPENCV_VERSION >= 0x020300 37 std::cout <<
"Save converted images from vpImage to cv::Mat" << std::endl;
38 std::cout <<
"- monkey-cv-color.jpeg" << std::endl;
39 std::cout <<
"- monkey-cv-grey.jpeg" << std::endl;
41 cv::imwrite(
"monkey-cv-color.jpeg", cv_img_color);
44 cv::imwrite(
"monkey-cv-grey.jpeg", cv_img_grey);
51 #if VISP_HAVE_OPENCV_VERSION >= 0x030000 52 cv::Mat cv_img_color = cv::imread(
"monkey.jpeg", cv::IMREAD_COLOR);
54 cv::Mat cv_img_color = cv::imread(
"monkey.jpeg", CV_LOAD_IMAGE_COLOR);
64 #if VISP_HAVE_OPENCV_VERSION >= 0x030000 65 cv::Mat cv_img_grey = cv::imread(
"monkey.jpeg", cv::IMREAD_GRAYSCALE);
67 cv::Mat cv_img_grey = cv::imread(
"monkey.jpeg", CV_LOAD_IMAGE_GRAYSCALE);
76 std::cout <<
"Save converted images from cv::Mat to vpImage" << std::endl;
77 std::cout <<
"- monkey-vp-color.jpeg" << std::endl;
78 std::cout <<
"- monkey-vp-grey.jpeg" << std::endl;
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
static void write(const vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)