From afdf319f368815e86c64c7641de7d88325cb2d5d Mon Sep 17 00:00:00 2001 From: quentin Date: Thu, 5 Mar 2015 14:37:21 +0100 Subject: [PATCH 1/8] Add -L for CUDA libs path to pkg-config Add all dirs from CUDA_LIBS_PATH as -L linker options to OPENCV_LINKER_LIBS. These will end up in opencv.pc. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 665ffe3d62..4a34fc65b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -540,6 +540,9 @@ if(HAVE_CUDA AND NOT ENABLE_DYNAMIC_CUDA) if(HAVE_CUFFT) set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cufft_LIBRARY}) endif() + foreach(p ${CUDA_LIBS_PATH}) + set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} -L${p}) + endforeach() endif() # ---------------------------------------------------------------------------- From dde7c22fadac17946b676513974ddc4b306315da Mon Sep 17 00:00:00 2001 From: Alexander Nitsch Date: Sat, 7 Mar 2015 15:37:21 +0100 Subject: [PATCH 2/8] Fix MinGW architecture detection Fix typo that would always lead to detection of x86 for MinGW builds in the OpenCVConfig.cmake file. --- cmake/OpenCVConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/OpenCVConfig.cmake b/cmake/OpenCVConfig.cmake index 2d80f765b5..5f5fa1aadb 100644 --- a/cmake/OpenCVConfig.cmake +++ b/cmake/OpenCVConfig.cmake @@ -84,7 +84,7 @@ elseif(MINGW) set(OpenCV_RUNTIME mingw) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine - OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE + OUTPUT_VARIABLE CMAKE_OPENCV_GCC_TARGET_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64") set(MINGW64 1) From 13694c8ae871f9c4f3e46315f4fc6c3b9f4f0e38 Mon Sep 17 00:00:00 2001 From: Alexander Nitsch Date: Sat, 7 Mar 2015 15:49:48 +0100 Subject: [PATCH 3/8] Fix MinGW detection on x86 Make detection of x64 using the gcc's target triplet identical to the one used in cmake/OpenCVDetectCXXCompiler.cmake. Otherwise, MinGW-w64 setups will always be treated as x64 since they contain "w64" as vendor key. --- cmake/OpenCVConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/OpenCVConfig.cmake b/cmake/OpenCVConfig.cmake index 5f5fa1aadb..9f3591f484 100644 --- a/cmake/OpenCVConfig.cmake +++ b/cmake/OpenCVConfig.cmake @@ -86,7 +86,7 @@ elseif(MINGW) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine OUTPUT_VARIABLE CMAKE_OPENCV_GCC_TARGET_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) - if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64") + if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64") set(MINGW64 1) set(OpenCV_ARCH x64) else() From 514b3b520c546488605e7b5775f113a804c2aad2 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 17 Mar 2015 06:43:54 +0300 Subject: [PATCH 4/8] Documentation update after iOS warnings fix in contrib/retina header. --- modules/contrib/doc/retina/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/contrib/doc/retina/index.rst b/modules/contrib/doc/retina/index.rst index 24af092de5..b4e7285054 100644 --- a/modules/contrib/doc/retina/index.rst +++ b/modules/contrib/doc/retina/index.rst @@ -293,7 +293,7 @@ Retina::write Retina::setupIPLMagnoChannel ++++++++++++++++++++++++++++ -.. ocv:function:: void Retina::setupIPLMagnoChannel(const bool normaliseOutput = true, const float parasolCells_beta = 0, const float parasolCells_tau = 0, const float parasolCells_k = 7, const float amacrinCellsTemporalCutFrequency = 1.2, const float V0CompressionParameter = 0.95, const float localAdaptintegration_tau = 0, const float localAdaptintegration_k = 7 ) +.. ocv:function:: void Retina::setupIPLMagnoChannel(const bool normaliseOutput = true, const float parasolCells_beta = 0, const float parasolCells_tau = 0, const float parasolCells_k = 7, const float amacrinCellsTemporalCutFrequency = 1.2f, const float V0CompressionParameter = 0.95f, const float localAdaptintegration_tau = 0, const float localAdaptintegration_k = 7 ) Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel this channel processes signals output from OPL processing stage in peripheral vision, it allows motion information enhancement. It is decorrelated from the details channel. See reference papers for more details. @@ -309,7 +309,7 @@ Retina::setupIPLMagnoChannel Retina::setupOPLandIPLParvoChannel ++++++++++++++++++++++++++++++++++ -.. ocv:function:: void Retina::setupOPLandIPLParvoChannel(const bool colorMode = true, const bool normaliseOutput = true, const float photoreceptorsLocalAdaptationSensitivity = 0.7, const float photoreceptorsTemporalConstant = 0.5, const float photoreceptorsSpatialConstant = 0.53, const float horizontalCellsGain = 0, const float HcellsTemporalConstant = 1, const float HcellsSpatialConstant = 7, const float ganglionCellsSensitivity = 0.7 ) +.. ocv:function:: void Retina::setupOPLandIPLParvoChannel(const bool colorMode = true, const bool normaliseOutput = true, const float photoreceptorsLocalAdaptationSensitivity = 0.7f, const float photoreceptorsTemporalConstant = 0.5f, const float photoreceptorsSpatialConstant = 0.53f, const float horizontalCellsGain = 0, const float HcellsTemporalConstant = 1, const float HcellsSpatialConstant = 7, const float ganglionCellsSensitivity = 0.7f ) Setup the OPL and IPL parvo channels (see biologocal model) OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See reference papers for more informations. From 8755ffbf3103482fa6a7945af76fb09ff7ed19d2 Mon Sep 17 00:00:00 2001 From: Boris Daskalov Date: Tue, 17 Mar 2015 16:23:03 +0200 Subject: [PATCH 5/8] Fix a bad free space check in icvGrowSeq. A difference of two pointers was casted to unsigned which can lead to overflow on 64-bit systems. --- modules/core/src/datastructs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/datastructs.cpp b/modules/core/src/datastructs.cpp index 9438fa2768..76c3b2c371 100644 --- a/modules/core/src/datastructs.cpp +++ b/modules/core/src/datastructs.cpp @@ -645,7 +645,7 @@ icvGrowSeq( CvSeq *seq, int in_front_of ) /* If there is a free space just after last allocated block and it is big enough then enlarge the last block. This can happen only if the new block is added to the end of sequence: */ - if( (unsigned)(ICV_FREE_PTR(storage) - seq->block_max) < CV_STRUCT_ALIGN && + if( (size_t)(ICV_FREE_PTR(storage) - seq->block_max) < CV_STRUCT_ALIGN && storage->free_space >= seq->elem_size && !in_front_of ) { int delta = storage->free_space / elem_size; From 7711cd284b273abd0d32434fa49d8dd7f1c755fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Thu, 19 Mar 2015 21:25:10 +0100 Subject: [PATCH 6/8] Fix a bug that impede to set the trackbar pos using the Qt control panel --- modules/highgui/src/window_QT.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/highgui/src/window_QT.cpp b/modules/highgui/src/window_QT.cpp index b96d7cb06f..a9cb2c09c0 100644 --- a/modules/highgui/src/window_QT.cpp +++ b/modules/highgui/src/window_QT.cpp @@ -406,13 +406,14 @@ static CvBar* icvFindBarByName(QBoxLayout* layout, QString name_bar, typeBar typ static CvTrackbar* icvFindTrackBarByName(const char* name_trackbar, const char* name_window, QBoxLayout* layout = NULL) { QString nameQt(name_trackbar); + QString nameWinQt(name_window); - if (!name_window && global_control_panel) //window name is null and we have a control panel + if (nameWinQt.isEmpty() && global_control_panel) //window name is null and we have a control panel layout = global_control_panel->myLayout; if (!layout) { - QPointer w = icvFindWindowByName(QLatin1String(name_window)); + QPointer w = icvFindWindowByName(nameWinQt); if (!w) CV_Error(CV_StsNullPtr, "NULL window handler"); From d057828ee399e749d745c959eb70227bdfc7bf00 Mon Sep 17 00:00:00 2001 From: "Tim D. Smith" Date: Mon, 23 Mar 2015 23:09:57 -0700 Subject: [PATCH 7/8] Don't explicitly link Python on OS X Explicitly linking to a Python framework on OS X prevents modules from being built against one python (i.e. system python) and imported from another (i.e. Homebrew python); the interpreter segfaults if there's a linkage to a foreign python. Building the module with `-undefined dynamic_lookup` instead of an explicit link allows the symbols to be resolved at load time from a compatible python. --- modules/python/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 3c0f2fd419..354c786cb3 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -64,7 +64,11 @@ add_library(${the_module} SHARED src2/cv2.cpp ${CMAKE_CURRENT_BINARY_DIR}/genera if(PYTHON_DEBUG_LIBRARIES AND NOT PYTHON_LIBRARIES MATCHES "optimized.*debug") target_link_libraries(${the_module} debug ${PYTHON_DEBUG_LIBRARIES} optimized ${PYTHON_LIBRARIES}) else() - target_link_libraries(${the_module} ${PYTHON_LIBRARIES}) + if(APPLE) + set_target_properties(${the_module} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") + else() + target_link_libraries(${the_module} ${PYTHON_LIBRARIES}) + endif() endif() target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS}) From d430664791a56faa707c3accbc350ede2e78f8e0 Mon Sep 17 00:00:00 2001 From: Alexander Nitsch Date: Tue, 17 Mar 2015 13:52:59 +0100 Subject: [PATCH 8/8] Remove local variables from CMAKE namespace --- cmake/OpenCVConfig.cmake | 4 ++-- cmake/OpenCVDetectCXXCompiler.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/OpenCVConfig.cmake b/cmake/OpenCVConfig.cmake index 9f3591f484..99162405a9 100644 --- a/cmake/OpenCVConfig.cmake +++ b/cmake/OpenCVConfig.cmake @@ -84,9 +84,9 @@ elseif(MINGW) set(OpenCV_RUNTIME mingw) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine - OUTPUT_VARIABLE CMAKE_OPENCV_GCC_TARGET_MACHINE + OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) - if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64") + if(OPENCV_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64") set(MINGW64 1) set(OpenCV_ARCH x64) else() diff --git a/cmake/OpenCVDetectCXXCompiler.cmake b/cmake/OpenCVDetectCXXCompiler.cmake index ddf32c5cde..a5c0fae4ab 100644 --- a/cmake/OpenCVDetectCXXCompiler.cmake +++ b/cmake/OpenCVDetectCXXCompiler.cmake @@ -91,9 +91,9 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) if(WIN32) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine - OUTPUT_VARIABLE CMAKE_OPENCV_GCC_TARGET_MACHINE + OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) - if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64") + if(OPENCV_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64") set(MINGW64 1) endif() endif()