diff --git a/core/sample-vpImageConvert-6.cpp b/core/sample-vpImageConvert-6.cpp index 1d851e5..ae1de1e 100644 --- a/core/sample-vpImageConvert-6.cpp +++ b/core/sample-vpImageConvert-6.cpp @@ -2,9 +2,13 @@ #include #include +#if defined(HAVE_OPENCV_IMGCODECS) +#include +#endif + int main() { -#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) && defined(HAVE_OPENCV_IMGCODECS) vpImage Ig; // A greyscale image cv::Mat Ip; @@ -12,7 +16,7 @@ int main() vpImageIo::readPGM(Ig, "image.pgm"); // Convert the vpImage in to greyscale cv::Mat vpImageConvert::convert(Ig, Ip); - // Treatments on cv::MatIp + // Treatments on cv::Mat Ip //... // Save the cv::Mat on the disk cv::imwrite("image.pgm", Ip); diff --git a/core/sample-vpImageConvert-7.cpp b/core/sample-vpImageConvert-7.cpp index e7c6452..cf045ff 100644 --- a/core/sample-vpImageConvert-7.cpp +++ b/core/sample-vpImageConvert-7.cpp @@ -2,9 +2,13 @@ #include #include +#if defined(HAVE_OPENCV_IMGCODECS) +#include +#endif + int main() { -#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) && defined(HAVE_OPENCV_IMGCODECS) vpImage Ig; // A greyscale image cv::Mat Ip; diff --git a/core/sample-vpImageConvert-8.cpp b/core/sample-vpImageConvert-8.cpp index 41c0a61..c277c18 100644 --- a/core/sample-vpImageConvert-8.cpp +++ b/core/sample-vpImageConvert-8.cpp @@ -2,9 +2,13 @@ #include #include +#if defined(HAVE_OPENCV_IMGCODECS) +#include +#endif + int main() { -#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) && defined(HAVE_OPENCV_IMGCODECS) vpImage Ig; // A grayscale image cv::Mat Ip; diff --git a/core/sample-vpImageConvert-9.cpp b/core/sample-vpImageConvert-9.cpp index 133d173..6765473 100644 --- a/core/sample-vpImageConvert-9.cpp +++ b/core/sample-vpImageConvert-9.cpp @@ -2,9 +2,14 @@ #include #include + +#if defined(HAVE_OPENCV_IMGCODECS) +#include +#endif + int main() { -#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) && defined(HAVE_OPENCV_IMGCODECS) vpImage Ic; // A color image cv::Mat Ip;