diff --git a/cmake/jkqtplotter_deployopencv.cmake b/cmake/jkqtplotter_deployopencv.cmake index 3271aec758..e47f41a5f2 100644 --- a/cmake/jkqtplotter_deployopencv.cmake +++ b/cmake/jkqtplotter_deployopencv.cmake @@ -1,12 +1,12 @@ function(jkqtplotter_deployopencv TARGET_NAME) #use windeploy if(OpenCV_FOUND) - if(WIN32) - add_custom_command(TARGET ${EXENAME} POST_BUILD # Adds a post-build event the TARGET - COMMAND ${CMAKE_COMMAND} -E copy_directory - "${_OpenCV_LIB_PATH}" - $ - ) - endif(WIN32) - endif(OpenCV_Found) -endfunction(jkqtplotter_deployopencv) \ No newline at end of file + if(WIN32) + add_custom_command(TARGET ${EXENAME} POST_BUILD # Adds a post-build event the TARGET + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${_OpenCV_LIB_PATH}" + $ + ) + endif(WIN32) + endif(OpenCV_FOUND) +endfunction(jkqtplotter_deployopencv) diff --git a/doc/dox/jkqtplotter.dox b/doc/dox/jkqtplotter.dox index 7e6da375e1..b985b09c67 100644 --- a/doc/dox/jkqtplotter.dox +++ b/doc/dox/jkqtplotter.dox @@ -161,6 +161,11 @@ Examples: - \ref JKQTPlotterImagePlotRGBOpenCV . +The OpenCV-binding itself is header-only, and NOT compiled into the JKQtPlotter libraries. Therefore you can simply include the header and use the facilities provided by it. + +The CMake-build system of JKQtPlotter (and its examples) is compatible with both OpenCV 3.4.x and 4.x and uses the standard `find_package(OpenCV)` facilities provided by OpenCV to compile and bind against that library. +If you want to build the OpenCV-based JKQtPlotter examples (see list above), you either have to ensure that CMake finds OpenCV by itself (i.e. somewhere in the default search paths), or you can set the CMake variable `OpenCV_DIR` so it points to the OpenCV directory before configuring JKQtPlotter. + \defgroup jkqtpplottersupprt Support Classes and Functions \ingroup jkqtplotter diff --git a/examples/imageplot_opencv/README.md b/examples/imageplot_opencv/README.md index 3af489b160..04602405e1 100644 --- a/examples/imageplot_opencv/README.md +++ b/examples/imageplot_opencv/README.md @@ -1,8 +1,12 @@ # Example (JKQTPlotter): Simple math image plot, showin a 1-channel OpenCV cv::Mat {#JKQTPlotterImagePlotOpenCV} -This project (see `./examples/imageplot_opencv/`) simply creates a JKQTPlotter widget (as a new window) and adds a color-coded image plot of a mathematical function (here the Airy disk). The image is generated as an OpenCV cv::Mat image and then copied into a single column of the internal datasdtore (JKQTPMathImage could be directly used without the internal datastore). +This project (see `./examples/imageplot_opencv/`) simply creates a JKQTPlotter widget (as a new window) and adds a color-coded image plot of a mathematical function (here the Airy disk). The image is generated as an OpenCV `cv::Mat` (see https://opencv.org/) image and then copied into a single column of the internal datasdtore (JKQTPMathImage could be directly used without the internal datastore). To copy the data a special OpenCV Interface function `JKQTPCopyCvMatToColumn()` is used, that copies the data from a cv::Mat directly into a column. -The function `JKQTPCopyCvMatToColumn()` is available from the (non-default) header-only extension from `jkqtplotter/jkqtpopencvinterface.h`. This header provides facilities to interface JKQTPlotter with OPenCV. +The function `JKQTPCopyCvMatToColumn()` is available from the (non-default) header-only extension from `jkqtplotter/jkqtpopencvinterface.h`. This header provides facilities to interface JKQTPlotter with OpenCV. The OpenCV-binding itself is header-only, and NOT compiled into the JKQtPlotter libraries. Therefore you can simply include the header and use the facilities provided by it. + +The CMake-build system of JKQtPlotter (and its examples) is compatible with both OpenCV 3.4.x and 4.x and uses the standard `find_package(OpenCV)` facilities provided by OpenCV to compile and bind against that library. +If you want to build the OpenCV-based JKQtPlotter examples (see list above), you either have to ensure that CMake finds OpenCV by itself (i.e. somewhere in the default search paths), or you can set the CMake variable `OpenCV_DIR` so it points to the OpenCV directory before configuring JKQtPlotter. + The source code of the main application is (see [`imageplot_opencv.cpp`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/imageplot_opencv/imageplot_opencv.cpp): ```.cpp diff --git a/examples/rgbimageplot_opencv/README.md b/examples/rgbimageplot_opencv/README.md index c692854afd..9b1cd84c23 100644 --- a/examples/rgbimageplot_opencv/README.md +++ b/examples/rgbimageplot_opencv/README.md @@ -2,7 +2,10 @@ This project (see `./examples/imageplot_opencv/`) simply creates a JKQTPlotter widget (as a new window) and shows an RGB image read from a BMP-file. The image is generated as an [OpenCV](https://opencv.org/) [`cv::Mat`](https://docs.opencv.org/4.0.0/d3/d63/classcv_1_1Mat.html) image and then copied into a single column of the internal datasdtore (JKQTPMathImage could be directly used without the internal datastore). To copy the data a special OpenCV Interface function `JKQTPCopyCvMatToColumn()` is used, that copies the data from a (https://opencv.org/) [`cv::Mat`](https://docs.opencv.org/4.0.0/d3/d63/classcv_1_1Mat.html) directly into a column. -The function `JKQTPCopyCvMatToColumn()` is available from the (non-default) header-only extension from `jkqtplotter/jkqtpopencvinterface.h`. This header provides facilities to interface JKQTPlotter with OpenCV. +The function `JKQTPCopyCvMatToColumn()` is available from the (non-default) header-only extension from `jkqtplotter/jkqtpopencvinterface.h`. This header provides facilities to interface JKQTPlotter with OpenCV.The OpenCV-binding itself is header-only, and NOT compiled into the JKQtPlotter libraries. Therefore you can simply include the header and use the facilities provided by it. + +The CMake-build system of JKQtPlotter (and its examples) is compatible with both OpenCV 3.4.x and 4.x and uses the standard `find_package(OpenCV)` facilities provided by OpenCV to compile and bind against that library. +If you want to build the OpenCV-based JKQtPlotter examples (see list above), you either have to ensure that CMake finds OpenCV by itself (i.e. somewhere in the default search paths), or you can set the CMake variable `OpenCV_DIR` so it points to the OpenCV directory before configuring JKQtPlotter. The source code of the main application is (see [`imageplot_opencv.cpp`](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/imageplot_opencv/imageplot_opencv.cpp): ```.cpp diff --git a/lib/jkqtplotter/jkqtpopencvinterface.h b/lib/jkqtplotter/jkqtpopencvinterface.h index 55fdbeea14..ac005f5430 100644 --- a/lib/jkqtplotter/jkqtpopencvinterface.h +++ b/lib/jkqtplotter/jkqtpopencvinterface.h @@ -19,7 +19,6 @@ -#include "jkqtplotter/jkqtplotter_imexport.h" #include "jkqtplotter/jkqtpdatastorage.h" #include @@ -36,7 +35,7 @@ * \param channel to copy from \a mat * \return the ID of the newly created column * - * \note You need to define the Macro JKQTPLOTTER_OPENCV_INTERFACE when compiling this lib to enabled this function. + * \see \ref jkqtpopencvinterface, \ref JKQTPlotterImagePlotOpenCV or \ref JKQTPlotterImagePlotRGBOpenCV for details on how to use this function. */ inline size_t JKQTPCopyCvMatToColumn(JKQTPDatastore* datastore, const cv::Mat& mat, const QString& name=QString(""), int channel=0);