From 0429b36fd9f47d2f0289421ff234d567f5d0f797 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 8 Mar 2017 08:36:28 +0100 Subject: [PATCH] ATV Modulator: implement opencv --- plugins/channeltx/CMakeLists.txt | 7 ++++++- plugins/channeltx/modatv/CMakeLists.txt | 4 ++++ plugins/channeltx/modatv/atvmod.h | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/channeltx/CMakeLists.txt b/plugins/channeltx/CMakeLists.txt index 06e040138..764c280fd 100644 --- a/plugins/channeltx/CMakeLists.txt +++ b/plugins/channeltx/CMakeLists.txt @@ -1,7 +1,12 @@ project(mod) +find_package(OpenCV) + add_subdirectory(modam) -add_subdirectory(modatv) add_subdirectory(modnfm) add_subdirectory(modssb) add_subdirectory(modwfm) + +if (OpenCV_FOUND) +add_subdirectory(modatv) +endif() diff --git a/plugins/channeltx/modatv/CMakeLists.txt b/plugins/channeltx/modatv/CMakeLists.txt index 3f98fd4dc..816051100 100644 --- a/plugins/channeltx/modatv/CMakeLists.txt +++ b/plugins/channeltx/modatv/CMakeLists.txt @@ -16,8 +16,11 @@ set(modatv_FORMS atvmodgui.ui ) +# OpenCV variables defined in /usr/share/OpenCV/OpenCVConfig.cmake (Ubuntu) + include_directories( . + ${OpenCV_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ) @@ -34,6 +37,7 @@ add_library(modatv SHARED ) target_link_libraries(modatv + ${OpenCV_LIBS} ${QT_LIBRARIES} sdrbase ) diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h index 27a23063e..8eb512276 100644 --- a/plugins/channeltx/modatv/atvmod.h +++ b/plugins/channeltx/modatv/atvmod.h @@ -20,6 +20,9 @@ #include #include +#include +#include + #include #include "dsp/basebandsamplesource.h" @@ -209,6 +212,8 @@ private: Real m_peakLevel; Real m_levelSum; + cv::Mat m_image; + static const float m_blackLevel; static const float m_spanLevel; static const int m_levelNbSamples;