Skip to content

Commit

Permalink
Merge pull request opencv#2093 from SpecLad:merge-2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Pavlenko authored and OpenCV Buildbot committed Dec 30, 2013
2 parents 8a456c5 + cdc10de commit 967703c
Show file tree
Hide file tree
Showing 43 changed files with 182 additions and 661 deletions.
502 changes: 0 additions & 502 deletions 3rdparty/include/MultiMon.h

This file was deleted.

3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions"
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
OCV_OPTION(ENABLE_WINRT_MODE "Build with Windows Runtime support" OFF IF WIN32 )
OCV_OPTION(ENABLE_WINRT_MODE_NATIVE "Build with Windows Runtime native C++ support" OFF IF WIN32 )


# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -643,7 +644,7 @@ endif()
if(WIN32)
status("")
status(" Windows RT support:" HAVE_WINRT THEN YES ELSE NO)
if (ENABLE_WINRT_MODE)
if (ENABLE_WINRT_MODE OR ENABLE_WINRT_MODE_NATIVE)
status(" Windows SDK v8.0:" ${WINDOWS_SDK_PATH})
status(" Visual Studio 2012:" ${VISUAL_STUDIO_PATH})
endif()
Expand Down
12 changes: 8 additions & 4 deletions cmake/OpenCVCRTLinkage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set(HAVE_WINRT FALSE)
# search Windows Platform SDK
message(STATUS "Checking for Windows Platform SDK")
GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
if (WINDOWS_SDK_PATH STREQUAL "")
if(WINDOWS_SDK_PATH STREQUAL "")
set(HAVE_MSPDK FALSE)
message(STATUS "Windows Platform SDK 8.0 was not found")
else()
Expand All @@ -19,7 +19,7 @@ endif()
#search for Visual Studio 11.0 install directory
message(STATUS "Checking for Visual Studio 2012")
GET_FILENAME_COMPONENT(VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH CACHE)
if (VISUAL_STUDIO_PATH STREQUAL "")
if(VISUAL_STUDIO_PATH STREQUAL "")
set(HAVE_MSVC2012 FALSE)
message(STATUS "Visual Studio 2012 was not found")
else()
Expand All @@ -30,11 +30,15 @@ try_compile(HAVE_WINRT_SDK
"${OpenCV_BINARY_DIR}"
"${OpenCV_SOURCE_DIR}/cmake/checks/winrttest.cpp")

if (ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
if(ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
set(HAVE_WINRT TRUE)
set(HAVE_WINRT_CX TRUE)
elseif(ENABLE_WINRT_MODE_NATIVE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
set(HAVE_WINRT TRUE)
set(HAVE_WINRT_CX FALSE)
endif()

if (HAVE_WINRT)
if(HAVE_WINRT)
add_definitions(/DWINVER=0x0602 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=0x0602)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /appcontainer")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /appcontainer")
Expand Down
14 changes: 7 additions & 7 deletions doc/tutorials/introduction/android_binary_package/O4A_SDK.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ The structure of package contents looks as follows:

::

OpenCV-2.4.7-android-sdk
OpenCV-2.4.8-android-sdk
|_ apk
| |_ OpenCV_2.4.7_binary_pack_armv7a.apk
| |_ OpenCV_2.4.7_Manager_2.14_XXX.apk
| |_ OpenCV_2.4.8_binary_pack_armv7a.apk
| |_ OpenCV_2.4.8_Manager_2.16_XXX.apk
|
|_ doc
|_ samples
Expand Down Expand Up @@ -157,10 +157,10 @@ Get the OpenCV4Android SDK

.. code-block:: bash
unzip ~/Downloads/OpenCV-2.4.7-android-sdk.zip
unzip ~/Downloads/OpenCV-2.4.8-android-sdk.zip
.. |opencv_android_bin_pack| replace:: :file:`OpenCV-2.4.7-android-sdk.zip`
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.7/OpenCV-2.4.7-android-sdk.zip/download
.. |opencv_android_bin_pack| replace:: :file:`OpenCV-2.4.8-android-sdk.zip`
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.8/OpenCV-2.4.8-android-sdk.zip/download
.. |opencv_android_bin_pack_url| replace:: |opencv_android_bin_pack|
.. |seven_zip| replace:: 7-Zip
.. _seven_zip: http://www.7-zip.org/
Expand Down Expand Up @@ -295,7 +295,7 @@ Well, running samples from Eclipse is very simple:
.. code-block:: sh
:linenos:
<Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.7_Manager_2.14_armv7a-neon.apk
<Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.8_Manager_2.16_armv7a-neon.apk
.. note:: ``armeabi``, ``armv7a-neon``, ``arm7a-neon-android8``, ``mips`` and ``x86`` stand for
platform targets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ Manager to access OpenCV libraries externally installed in the target system.
:guilabel:`File -> Import -> Existing project in your workspace`.

Press :guilabel:`Browse` button and locate OpenCV4Android SDK
(:file:`OpenCV-2.4.7-android-sdk/sdk`).
(:file:`OpenCV-2.4.8-android-sdk/sdk`).

.. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library
:align: center

#. In application project add a reference to the OpenCV Java SDK in
:guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.7``.
:guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.8``.

.. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library
Expand Down Expand Up @@ -128,27 +128,27 @@ described above.
#. Add the OpenCV library project to your workspace the same way as for the async initialization
above. Use menu :guilabel:`File -> Import -> Existing project in your workspace`,
press :guilabel:`Browse` button and select OpenCV SDK path
(:file:`OpenCV-2.4.7-android-sdk/sdk`).
(:file:`OpenCV-2.4.8-android-sdk/sdk`).

.. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library
:align: center

#. In the application project add a reference to the OpenCV4Android SDK in
:guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.7``;
:guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.8``;

.. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library
:align: center

#. If your application project **doesn't have a JNI part**, just copy the corresponding OpenCV
native libs from :file:`<OpenCV-2.4.7-android-sdk>/sdk/native/libs/<target_arch>` to your
native libs from :file:`<OpenCV-2.4.8-android-sdk>/sdk/native/libs/<target_arch>` to your
project directory to folder :file:`libs/<target_arch>`.

In case of the application project **with a JNI part**, instead of manual libraries copying you
need to modify your ``Android.mk`` file:
add the following two code lines after the ``"include $(CLEAR_VARS)"`` and before
``"include path_to_OpenCV-2.4.7-android-sdk/sdk/native/jni/OpenCV.mk"``
``"include path_to_OpenCV-2.4.8-android-sdk/sdk/native/jni/OpenCV.mk"``

.. code-block:: make
:linenos:
Expand Down Expand Up @@ -221,7 +221,7 @@ taken:

.. code-block:: make
include C:\Work\OpenCV4Android\OpenCV-2.4.7-android-sdk\sdk\native\jni\OpenCV.mk
include C:\Work\OpenCV4Android\OpenCV-2.4.8-android-sdk\sdk\native\jni\OpenCV.mk
Should be inserted into the :file:`jni/Android.mk` file **after** this line:

Expand Down
5 changes: 4 additions & 1 deletion modules/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ set(the_description "The Core Functionality")
ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES} "${OPENCL_LIBRARIES}" OPTIONAL opencv_cudev)
ocv_module_include_directories(${ZLIB_INCLUDE_DIRS})

if(HAVE_WINRT_CX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW")
endif()
if(HAVE_WINRT)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW /GS /Gm- /AI\"${WINDOWS_SDK_PATH}/References/CommonConfiguration/Neutral\" /AI\"${VISUAL_STUDIO_PATH}/vcpackages\"")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GS /Gm- /AI\"${WINDOWS_SDK_PATH}/References/CommonConfiguration/Neutral\" /AI\"${VISUAL_STUDIO_PATH}/vcpackages\"")
endif()

if(HAVE_CUDA)
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ std::wstring GetTempPathWinRT()
if (FAILED(WindowsCreateStringReference(RuntimeClass_Windows_Storage_ApplicationData,
(UINT32)wcslen(RuntimeClass_Windows_Storage_ApplicationData), &hstrHead, &str)))
return wstr;
if (FAILED(Windows::Foundation::GetActivationFactory(str, appdataFactory.ReleaseAndGetAddressOf())))
if (FAILED(RoGetActivationFactory(str, IID_PPV_ARGS(appdataFactory.ReleaseAndGetAddressOf()))))
return wstr;
if (FAILED(appdataFactory->get_Current(appdataRef.ReleaseAndGetAddressOf())))
return wstr;
Expand Down
2 changes: 1 addition & 1 deletion modules/cuda/test/test_gpumat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ CUDA_TEST_P(ConvertTo, WithOutScaling)
cv::Mat dst_gold;
src.convertTo(dst_gold, depth2);

EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
EXPECT_MAT_NEAR(dst_gold, dst, 1.0);
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/cuda/test/test_objdetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct HOG : testing::TestWithParam<cv::cuda::DeviceInfo>, cv::cuda::HOGDescript
};

// desabled while resize does not fixed
CUDA_TEST_P(HOG, Detect)
CUDA_TEST_P(HOG, DISABLED_Detect)
{
cv::Mat img_rgb = readImage("hog/road.png");
ASSERT_FALSE(img_rgb.empty());
Expand Down
4 changes: 4 additions & 0 deletions modules/cudaarithm/perf/perf_arithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ using namespace perf;
//////////////////////////////////////////////////////////////////////
// GEMM

#ifdef HAVE_CUBLAS

CV_FLAGS(GemmFlags, 0, cv::GEMM_1_T, cv::GEMM_2_T, cv::GEMM_3_T)
#define ALL_GEMM_FLAGS Values(GemmFlags(0), GemmFlags(cv::GEMM_1_T), GemmFlags(cv::GEMM_2_T), GemmFlags(cv::GEMM_3_T), \
GemmFlags(cv::GEMM_1_T | cv::GEMM_2_T), GemmFlags(cv::GEMM_1_T | cv::GEMM_3_T), GemmFlags(cv::GEMM_1_T | cv::GEMM_2_T | cv::GEMM_3_T))
Expand Down Expand Up @@ -98,6 +100,8 @@ PERF_TEST_P(Sz_Type_Flags, GEMM,
}
}

#endif

//////////////////////////////////////////////////////////////////////
// MulSpectrums

Expand Down
2 changes: 1 addition & 1 deletion modules/cudaarithm/test/test_element_operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2514,7 +2514,7 @@ CUDA_TEST_P(AddWeighted, Accuracy)
cv::Mat dst_gold;
cv::addWeighted(src1, alpha, src2, beta, gamma, dst_gold, dst_depth);

EXPECT_MAT_NEAR(dst_gold, dst, dst_depth < CV_32F ? 1.0 : 1e-3);
EXPECT_MAT_NEAR(dst_gold, dst, dst_depth < CV_32F ? 2.0 : 1e-3);
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/cudaarithm/test/test_reductions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ CUDA_TEST_P(Normalize, WithOutMask)
cv::Mat dst_gold;
cv::normalize(src, dst_gold, alpha, beta, norm_type, type);

EXPECT_MAT_NEAR(dst_gold, dst, 1e-6);
EXPECT_MAT_NEAR(dst_gold, dst, 1.0);
}

CUDA_TEST_P(Normalize, WithMask)
Expand Down
8 changes: 4 additions & 4 deletions modules/cudaimgproc/test/test_color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ CUDA_TEST_P(CvtColor, BGR2YCrCb)
cv::Mat dst_gold;
cv::cvtColor(src, dst_gold, cv::COLOR_BGR2YCrCb);

EXPECT_MAT_NEAR(dst_gold, dst, 1e-5);
EXPECT_MAT_NEAR(dst_gold, dst, 1.0);
}

CUDA_TEST_P(CvtColor, RGB2YCrCb)
Expand All @@ -728,7 +728,7 @@ CUDA_TEST_P(CvtColor, RGB2YCrCb)
cv::Mat dst_gold;
cv::cvtColor(src, dst_gold, cv::COLOR_RGB2YCrCb);

EXPECT_MAT_NEAR(dst_gold, dst, 1e-5);
EXPECT_MAT_NEAR(dst_gold, dst, 1.0);
}

CUDA_TEST_P(CvtColor, BGR2YCrCb4)
Expand All @@ -749,7 +749,7 @@ CUDA_TEST_P(CvtColor, BGR2YCrCb4)
cv::split(h_dst, channels);
cv::merge(channels, 3, h_dst);

EXPECT_MAT_NEAR(dst_gold, h_dst, 1e-5);
EXPECT_MAT_NEAR(dst_gold, h_dst, 1.0);
}

CUDA_TEST_P(CvtColor, RGBA2YCrCb4)
Expand All @@ -771,7 +771,7 @@ CUDA_TEST_P(CvtColor, RGBA2YCrCb4)
cv::split(h_dst, channels);
cv::merge(channels, 3, h_dst);

EXPECT_MAT_NEAR(dst_gold, h_dst, 1e-5);
EXPECT_MAT_NEAR(dst_gold, h_dst, 1.0);
}

CUDA_TEST_P(CvtColor, YCrCb2BGR)
Expand Down
2 changes: 1 addition & 1 deletion modules/cudaoptflow/perf/perf_optflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ PERF_TEST_P(ImagePair, OpticalFlowBM,
}
}

PERF_TEST_P(ImagePair, FastOpticalFlowBM,
PERF_TEST_P(ImagePair, DISABLED_FastOpticalFlowBM,
Values<pair_string>(make_pair("gpu/opticalflow/frame0.png", "gpu/opticalflow/frame1.png")))
{
declare.time(400);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ class HierarchicalClusteringIndex : public NNIndex<Distance>
trees_ = get_param(params,"trees",4);
root = new NodePtr[trees_];
indices = new int*[trees_];

for (int i=0; i<trees_; ++i) {
root[i] = NULL;
indices[i] = NULL;
}
}

HierarchicalClusteringIndex(const HierarchicalClusteringIndex&);
Expand All @@ -309,11 +314,34 @@ class HierarchicalClusteringIndex : public NNIndex<Distance>
*/
virtual ~HierarchicalClusteringIndex()
{
free_elements();

if (root!=NULL) {
delete[] root;
}

if (indices!=NULL) {
delete[] indices;
}
}


/**
* Release the inner elements of indices[]
*/
void free_elements()
{
if (indices!=NULL) {
for(int i=0; i<trees_; ++i) {
if (indices[i]!=NULL) {
delete[] indices[i];
indices[i] = NULL;
}
}
}
}


/**
* Returns size of index.
*/
Expand Down Expand Up @@ -348,6 +376,9 @@ class HierarchicalClusteringIndex : public NNIndex<Distance>
if (branching_<2) {
throw FLANNException("Branching factor must be at least 2");
}

free_elements();

for (int i=0; i<trees_; ++i) {
indices[i] = new int[size_];
for (size_t j=0; j<size_; ++j) {
Expand Down Expand Up @@ -387,6 +418,17 @@ class HierarchicalClusteringIndex : public NNIndex<Distance>
load_value(stream, centers_init_);
load_value(stream, leaf_size_);
load_value(stream, memoryCounter);

free_elements();

if (root!=NULL) {
delete[] root;
}

if (indices!=NULL) {
delete[] indices;
}

indices = new int*[trees_];
root = new NodePtr[trees_];
for (int i=0; i<trees_; ++i) {
Expand Down
1 change: 0 additions & 1 deletion modules/highgui/src/window_w32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wmissing-declarations"
#endif
#include <MultiMon.h>

#include <commctrl.h>
#include <winuser.h>
Expand Down
2 changes: 1 addition & 1 deletion modules/imgproc/doc/feature_detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ http://en.wikipedia.org/wiki/Canny_edge_detector

* An example on using the canny edge detector can be found at opencv_source_code/samples/cpp/edge.cpp

* (Python) An example on using the canny edge detector can be found at opencv_source_code/samples/cpp/edge.py
* (Python) An example on using the canny edge detector can be found at opencv_source_code/samples/python/edge.py

cornerEigenValsAndVecs
----------------------
Expand Down
2 changes: 1 addition & 1 deletion modules/imgproc/include/opencv2/imgproc/imgproc_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ CV_INLINE double cvContourPerimeter( const void* contour )
}


/* Calculates contour boundning rectangle (update=1) or
/* Calculates contour bounding rectangle (update=1) or
just retrieves pre-calculated rectangle (update=0) */
CVAPI(CvRect) cvBoundingRect( CvArr* points, int update CV_DEFAULT(0) );

Expand Down
3 changes: 2 additions & 1 deletion modules/imgproc/src/canny.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@

#include "precomp.hpp"

/*
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
#define USE_IPP_CANNY 1
#else
#undef USE_IPP_CANNY
#endif

*/
#ifdef USE_IPP_CANNY
namespace cv
{
Expand Down
Loading

0 comments on commit 967703c

Please sign in to comment.