mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-11-15 10:05:47 +08:00
documentation improvement for OpenCV + minor fixes
This commit is contained in:
parent
528f6fe537
commit
e087f40870
@ -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}"
|
||||
$<TARGET_FILE_DIR:${EXENAME}>
|
||||
)
|
||||
endif(WIN32)
|
||||
endif(OpenCV_Found)
|
||||
endfunction(jkqtplotter_deployopencv)
|
||||
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}"
|
||||
$<TARGET_FILE_DIR:${EXENAME}>
|
||||
)
|
||||
endif(WIN32)
|
||||
endif(OpenCV_FOUND)
|
||||
endfunction(jkqtplotter_deployopencv)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
|
||||
|
||||
#include "jkqtplotter/jkqtplotter_imexport.h"
|
||||
#include "jkqtplotter/jkqtpdatastorage.h"
|
||||
#include <opencv2/core.hpp>
|
||||
|
||||
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user