From 9eff5edb8016f1a7fdb9207c9da8b624d4a9d966 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 25 Oct 2023 15:51:39 +0200 Subject: [PATCH] add OpenCV includes for the vpConfig.h refactor --- core/sample-vpImageConvert-6.cpp | 8 ++++++-- core/sample-vpImageConvert-7.cpp | 6 +++++- core/sample-vpImageConvert-8.cpp | 6 +++++- core/sample-vpImageConvert-9.cpp | 7 ++++++- 4 files changed, 22 insertions(+), 5 deletions(-) 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;