From 6d41124d43c21cfbe6fd6c0f89661292f69baf5f Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 17 Jan 2017 20:00:51 +0300 Subject: [PATCH 1/6] remove precomp.cpp files --- modules/dpm/src/precomp.cpp | 44 -------------------------- modules/plot/src/precomp.cpp | 50 ------------------------------ modules/reg/perf/perf_precomp.cpp | 44 -------------------------- modules/reg/src/precomp.cpp | 39 ----------------------- modules/reg/test/test_precomp.cpp | 44 -------------------------- modules/rgbd/test/test_precomp.cpp | 1 - 6 files changed, 222 deletions(-) delete mode 100644 modules/dpm/src/precomp.cpp delete mode 100644 modules/plot/src/precomp.cpp delete mode 100644 modules/reg/perf/perf_precomp.cpp delete mode 100644 modules/reg/src/precomp.cpp delete mode 100644 modules/reg/test/test_precomp.cpp delete mode 100644 modules/rgbd/test/test_precomp.cpp diff --git a/modules/dpm/src/precomp.cpp b/modules/dpm/src/precomp.cpp deleted file mode 100644 index ca7dd448f..000000000 --- a/modules/dpm/src/precomp.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2015, Itseez Inc, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Itseez Inc or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#include "precomp.hpp" - -/* End of file. */ diff --git a/modules/plot/src/precomp.cpp b/modules/plot/src/precomp.cpp deleted file mode 100644 index 1f92d9210..000000000 --- a/modules/plot/src/precomp.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ -//################################################################################ -// -// Created by Nuno Moutinho -// -//################################################################################ - -#include "precomp.hpp" - -/* End of file. */ diff --git a/modules/reg/perf/perf_precomp.cpp b/modules/reg/perf/perf_precomp.cpp deleted file mode 100644 index 9de21b149..000000000 --- a/modules/reg/perf/perf_precomp.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, Alfonso Sanchez-Beato, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#include "perf_precomp.hpp" diff --git a/modules/reg/src/precomp.cpp b/modules/reg/src/precomp.cpp deleted file mode 100644 index 50a932ce3..000000000 --- a/modules/reg/src/precomp.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// Copyright (C) 2013, Alfonso Sanchez-Beato, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - - -#include "precomp.hpp" diff --git a/modules/reg/test/test_precomp.cpp b/modules/reg/test/test_precomp.cpp deleted file mode 100644 index d2133d4b3..000000000 --- a/modules/reg/test/test_precomp.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, Alfonso Sanchez-Beato, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#include "test_precomp.hpp" diff --git a/modules/rgbd/test/test_precomp.cpp b/modules/rgbd/test/test_precomp.cpp deleted file mode 100644 index 5956e13e3..000000000 --- a/modules/rgbd/test/test_precomp.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "test_precomp.hpp" From 2feb23cf369ee38e36d068a04c8bf5fae10b65f3 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 16 Jan 2017 18:10:40 +0300 Subject: [PATCH 2/6] cmake: include contrib modules into "opencv_world" --- modules/dnn/CMakeLists.txt | 3 +-- modules/dnn/cmake/OpenCVFindLibProtobuf.cmake | 2 +- modules/dnn/src/caffe/caffe_importer.cpp | 2 +- modules/dnn/src/tensorflow/tf_importer.cpp | 2 +- modules/hdf/CMakeLists.txt | 5 ++--- modules/saliency/CMakeLists.txt | 1 - modules/saliency/src/BING/CmFile.cpp | 2 +- modules/saliency/src/BING/CmShow.cpp | 2 +- modules/saliency/src/BING/FilterTIG.cpp | 2 +- modules/saliency/src/BING/ValStructVec.cpp | 2 +- modules/saliency/src/BING/objectnessBING.cpp | 2 +- modules/xfeatures2d/CMakeLists.txt | 4 ++-- modules/xfeatures2d/src/pct_signatures/grayscale_bitmap.cpp | 2 +- modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp | 2 +- modules/xfeatures2d/src/pct_signatures/pct_sampler.cpp | 2 +- modules/ximgproc/CMakeLists.txt | 3 --- modules/xobjdetect/CMakeLists.txt | 2 +- 17 files changed, 17 insertions(+), 23 deletions(-) diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt index 0bcd77355..1bd6ce7cd 100644 --- a/modules/dnn/CMakeLists.txt +++ b/modules/dnn/CMakeLists.txt @@ -3,7 +3,6 @@ if(WINRT) endif() set(the_description "Deep neural network module. It allows to load models from different frameworks and to make forward pass") -set(OPENCV_MODULE_IS_PART_OF_WORLD OFF) ocv_add_module(dnn opencv_core opencv_imgproc PRIVATE_REQUIRED "${LAPACK_LIBRARIES}" WRAP python matlab) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-shadow -Wno-parentheses -Wmaybe-uninitialized -Wsign-promo @@ -36,7 +35,7 @@ endif() # ---------------------------------------------------------------------------- # Resolve libprotobuf dependency # ---------------------------------------------------------------------------- -include(cmake/OpenCVFindLibProtobuf.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/OpenCVFindLibProtobuf.cmake) ocv_source_group("Src\\protobuf" FILES ${PROTOBUF_SRCS} ${PROTOBUF_HDRS}) ocv_module_include_directories(include ${PROTOBUF_INCLUDE_DIR}) diff --git a/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake b/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake index eb2a729cc..b67bcf718 100644 --- a/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake +++ b/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake @@ -28,7 +28,7 @@ if(PROTOBUF_FOUND) # nothing else() include(${CMAKE_CURRENT_LIST_DIR}/download_protobuf.cmake) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/protobuf) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/protobuf ${CMAKE_BINARY_DIR}/3rdparty/protobuf) set(PROTOBUF_LIBRARIES libprotobuf) set(PROTOBUF_INCLUDE_DIR ${PROTOBUF_CPP_PATH}/protobuf-3.1.0/src) endif() diff --git a/modules/dnn/src/caffe/caffe_importer.cpp b/modules/dnn/src/caffe/caffe_importer.cpp index 5f66393c8..312671e3e 100644 --- a/modules/dnn/src/caffe/caffe_importer.cpp +++ b/modules/dnn/src/caffe/caffe_importer.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" using namespace cv; using namespace cv::dnn; diff --git a/modules/dnn/src/tensorflow/tf_importer.cpp b/modules/dnn/src/tensorflow/tf_importer.cpp index 6caccefad..b6131d460 100644 --- a/modules/dnn/src/tensorflow/tf_importer.cpp +++ b/modules/dnn/src/tensorflow/tf_importer.cpp @@ -9,7 +9,7 @@ Implementation of Tensorflow models parser */ -#include "precomp.hpp" +#include "../precomp.hpp" using namespace cv; using namespace cv::dnn; diff --git a/modules/hdf/CMakeLists.txt b/modules/hdf/CMakeLists.txt index b6bfa4998..2a1ae68bd 100644 --- a/modules/hdf/CMakeLists.txt +++ b/modules/hdf/CMakeLists.txt @@ -31,6 +31,5 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Winvalid-offsetof) set(the_description "Hierarchical Data Format I/O") ocv_define_module(hdf opencv_core WRAP python) - -include_directories(${HDF5_INCLUDE_DIRS}) -target_link_libraries(opencv_hdf ${HDF5_LIBRARIES}) +ocv_target_link_libraries(${the_module} ${HDF5_LIBRARIES}) +ocv_include_directories(${HDF5_INCLUDE_DIRS}) diff --git a/modules/saliency/CMakeLists.txt b/modules/saliency/CMakeLists.txt index 1d0d40ee2..dcc83ebb0 100644 --- a/modules/saliency/CMakeLists.txt +++ b/modules/saliency/CMakeLists.txt @@ -3,7 +3,6 @@ if(CV_ICC AND NOT MSVC) endif() set(the_description "Saliency API") -set(OPENCV_MODULE_IS_PART_OF_WORLD OFF) ocv_define_module(saliency opencv_imgproc opencv_highgui opencv_features2d WRAP python) diff --git a/modules/saliency/src/BING/CmFile.cpp b/modules/saliency/src/BING/CmFile.cpp index 2c9ba9dd0..c65ae703b 100644 --- a/modules/saliency/src/BING/CmFile.cpp +++ b/modules/saliency/src/BING/CmFile.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" #include "CmFile.hpp" namespace cv diff --git a/modules/saliency/src/BING/CmShow.cpp b/modules/saliency/src/BING/CmShow.cpp index 838ccb9e0..3482b7027 100644 --- a/modules/saliency/src/BING/CmShow.cpp +++ b/modules/saliency/src/BING/CmShow.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" #include "CmShow.hpp" #include "opencv2/core.hpp" #include diff --git a/modules/saliency/src/BING/FilterTIG.cpp b/modules/saliency/src/BING/FilterTIG.cpp index d9796bcd7..07206180b 100644 --- a/modules/saliency/src/BING/FilterTIG.cpp +++ b/modules/saliency/src/BING/FilterTIG.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" #include "CmShow.hpp" namespace cv diff --git a/modules/saliency/src/BING/ValStructVec.cpp b/modules/saliency/src/BING/ValStructVec.cpp index 097c9be24..8343ced1d 100644 --- a/modules/saliency/src/BING/ValStructVec.cpp +++ b/modules/saliency/src/BING/ValStructVec.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" namespace cv { diff --git a/modules/saliency/src/BING/objectnessBING.cpp b/modules/saliency/src/BING/objectnessBING.cpp index cd3019b9b..6e83a094f 100644 --- a/modules/saliency/src/BING/objectnessBING.cpp +++ b/modules/saliency/src/BING/objectnessBING.cpp @@ -39,7 +39,7 @@ // //M*/ -#include "precomp.hpp" +#include "../precomp.hpp" #include "BING/kyheader.hpp" #include "CmTimer.hpp" diff --git a/modules/xfeatures2d/CMakeLists.txt b/modules/xfeatures2d/CMakeLists.txt index f295bddae..35402f2a2 100644 --- a/modules/xfeatures2d/CMakeLists.txt +++ b/modules/xfeatures2d/CMakeLists.txt @@ -1,5 +1,5 @@ set(the_description "Contributed/Experimental Algorithms for Salient 2D Features Detection") ocv_define_module(xfeatures2d opencv_core opencv_imgproc opencv_features2d opencv_calib3d opencv_shape opencv_highgui opencv_videoio opencv_ml OPTIONAL opencv_cudaarithm WRAP python java) -include(cmake/download_vgg.cmake) -include(cmake/download_boostdesc.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_vgg.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_boostdesc.cmake) diff --git a/modules/xfeatures2d/src/pct_signatures/grayscale_bitmap.cpp b/modules/xfeatures2d/src/pct_signatures/grayscale_bitmap.cpp index 0ed6a7632..4553fa934 100644 --- a/modules/xfeatures2d/src/pct_signatures/grayscale_bitmap.cpp +++ b/modules/xfeatures2d/src/pct_signatures/grayscale_bitmap.cpp @@ -57,7 +57,7 @@ References: ACM, 2010. */ -#include "precomp.hpp" +#include "../precomp.hpp" #include "grayscale_bitmap.hpp" diff --git a/modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp b/modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp index 71fccafc8..acbd0205d 100644 --- a/modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp +++ b/modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp @@ -57,7 +57,7 @@ References: ACM, 2010. */ -#include "precomp.hpp" +#include "../precomp.hpp" #include "opencv2/core/core_c.h" // <- because CV_REDUCE_SUM was undeclared without it #include "pct_clusterizer.hpp" diff --git a/modules/xfeatures2d/src/pct_signatures/pct_sampler.cpp b/modules/xfeatures2d/src/pct_signatures/pct_sampler.cpp index 2426d2352..766b5076f 100644 --- a/modules/xfeatures2d/src/pct_signatures/pct_sampler.cpp +++ b/modules/xfeatures2d/src/pct_signatures/pct_sampler.cpp @@ -57,7 +57,7 @@ References: ACM, 2010. */ -#include "precomp.hpp" +#include "../precomp.hpp" #include "pct_sampler.hpp" diff --git a/modules/ximgproc/CMakeLists.txt b/modules/ximgproc/CMakeLists.txt index 91ed65e0e..1a6860d12 100644 --- a/modules/ximgproc/CMakeLists.txt +++ b/modules/ximgproc/CMakeLists.txt @@ -1,5 +1,2 @@ set(the_description "Extended image processing module. It includes edge-aware filters and etc.") -set(OPENCV_MODULE_IS_PART_OF_WORLD OFF) ocv_define_module(ximgproc opencv_imgproc opencv_core opencv_highgui opencv_calib3d WRAP python) - -target_link_libraries(opencv_ximgproc) diff --git a/modules/xobjdetect/CMakeLists.txt b/modules/xobjdetect/CMakeLists.txt index 567909b8a..598987f90 100644 --- a/modules/xobjdetect/CMakeLists.txt +++ b/modules/xobjdetect/CMakeLists.txt @@ -1,5 +1,5 @@ set(the_description "Object detection algorithms") ocv_define_module(xobjdetect opencv_core opencv_imgproc opencv_highgui opencv_objdetect WRAP python) if (NOT APPLE_FRAMEWORK) - add_subdirectory(tools) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools ${CMAKE_CURRENT_BINARY_DIR}/tools) endif() From 62cc8d86e9aaef4f7bb7cc45022acadb4e1e7b0c Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 17 Jan 2017 17:44:06 +0300 Subject: [PATCH 3/6] dnn: build fixes --- modules/dnn/src/layers/convolution_layer.cpp | 12 ++++++------ modules/dnn/src/layers/elementwise_layers.hpp | 4 +--- modules/dnn/src/layers/lrn_layer.cpp | 2 +- modules/dnn/src/layers/softmax_layer.cpp | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/modules/dnn/src/layers/convolution_layer.cpp b/modules/dnn/src/layers/convolution_layer.cpp index c58eb9eff..8ef95fcfe 100644 --- a/modules/dnn/src/layers/convolution_layer.cpp +++ b/modules/dnn/src/layers/convolution_layer.cpp @@ -60,12 +60,12 @@ BaseConvolutionLayerImpl::BaseConvolutionLayerImpl(): inpGroupCn(0), outGroupCn(0), ksize(0), bias(false), tryUseOpenCL(false) { - #if HAVE_CBLAS - if (getBlasThreads() != cv::getThreadNum()) - { - setBlasThreads(cv::getThreadNum()); - } - #endif +#ifdef HAVE_LAPACK + if (getBlasThreads() != cv::getThreadNum()) + { + setBlasThreads(cv::getThreadNum()); + } +#endif } void BaseConvolutionLayerImpl::init() diff --git a/modules/dnn/src/layers/elementwise_layers.hpp b/modules/dnn/src/layers/elementwise_layers.hpp index 6ab52325e..0c01812bf 100644 --- a/modules/dnn/src/layers/elementwise_layers.hpp +++ b/modules/dnn/src/layers/elementwise_layers.hpp @@ -46,9 +46,7 @@ #include #include #include -#ifdef HAVE_OPENCL -#include "modules/dnn/opencl_kernels_dnn.hpp" -#endif +#include "opencl_kernels_dnn.hpp" namespace cv { diff --git a/modules/dnn/src/layers/lrn_layer.cpp b/modules/dnn/src/layers/lrn_layer.cpp index e2c0ec791..54958df38 100644 --- a/modules/dnn/src/layers/lrn_layer.cpp +++ b/modules/dnn/src/layers/lrn_layer.cpp @@ -42,7 +42,7 @@ #include "../precomp.hpp" #include "layers_common.hpp" #include "lrn_layer.hpp" -#include "modules/dnn/opencl_kernels_dnn.hpp" +#include "opencl_kernels_dnn.hpp" #include #include #include diff --git a/modules/dnn/src/layers/softmax_layer.cpp b/modules/dnn/src/layers/softmax_layer.cpp index 576ed4d57..54751bc7c 100644 --- a/modules/dnn/src/layers/softmax_layer.cpp +++ b/modules/dnn/src/layers/softmax_layer.cpp @@ -43,7 +43,7 @@ #include "layers_common.hpp" #include "softmax_layer.hpp" #include -#include "modules/dnn/opencl_kernels_dnn.hpp" +#include "opencl_kernels_dnn.hpp" #include #include using std::max; From 4bf9cb5520d437e1dac623e29288decd9b5a50e7 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 17 Jan 2017 19:57:36 +0300 Subject: [PATCH 4/6] dnn: fix 'log1p' re-definition in THGeneral --- modules/dnn/src/torch/THGeneral.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/dnn/src/torch/THGeneral.cpp b/modules/dnn/src/torch/THGeneral.cpp index dc56e3625..1bf0b4f89 100644 --- a/modules/dnn/src/torch/THGeneral.cpp +++ b/modules/dnn/src/torch/THGeneral.cpp @@ -1,14 +1,6 @@ #if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER -#include "THGeneral.h" #include -extern "C" -{ - -#ifndef TH_HAVE_THREAD -#define __thread -#endif - #if defined(TH_DISABLE_HEAP_TRACKING) #elif (defined(__unix) || defined(_WIN32)) #include @@ -16,6 +8,15 @@ extern "C" #include #endif +#include "THGeneral.h" + +extern "C" +{ + +#ifndef TH_HAVE_THREAD +#define __thread +#endif + /* Torch Error Handling */ static void defaultTorchErrorHandlerFunction(const char *msg, void*) { From 944d40a1b5ff8d3a104531e9e08ab4b091bf7839 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 18 Jan 2017 16:56:06 +0300 Subject: [PATCH 5/6] cmake: freetype external dependencies via ocv_target_link_libraries --- modules/freetype/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/freetype/CMakeLists.txt b/modules/freetype/CMakeLists.txt index 805d8ebb6..6710df320 100644 --- a/modules/freetype/CMakeLists.txt +++ b/modules/freetype/CMakeLists.txt @@ -19,7 +19,8 @@ endif() if( FREETYPE_FOUND AND HARFBUZZ_FOUND ) - ocv_define_module(freetype opencv_core opencv_imgproc PRIVATE_REQUIRED ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} WRAP python) + ocv_define_module(freetype opencv_core opencv_imgproc WRAP python) + ocv_target_link_libraries(${the_module} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES}) ocv_include_directories( ${FREETYPE_INCLUDE_DIRS} ${HARFBUZZ_INCLUDE_DIRS} ) else() ocv_module_disable(freetype) From 072956924b0c086e00395dcf1ce6fdda3af0f4a5 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 25 Jan 2017 15:16:10 +0300 Subject: [PATCH 6/6] build: fix build error --- modules/xfeatures2d/src/affine_feature2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/xfeatures2d/src/affine_feature2d.cpp b/modules/xfeatures2d/src/affine_feature2d.cpp index 60f43bf57..ac60a569a 100644 --- a/modules/xfeatures2d/src/affine_feature2d.cpp +++ b/modules/xfeatures2d/src/affine_feature2d.cpp @@ -211,7 +211,7 @@ bool calcAffineAdaptation(const Mat & fimage, Elliptic_KeyPoint & keypoint) float ratio = 1 - q; //if ratio == 1 means q == 0 and one axes equals to 0 - if (!isnan(ratio) && ratio != 1) + if (!cvIsNaN(ratio) && ratio != 1) { //Update U matrix U = U * Mk;