Skip to content

Commit b2d359b

Browse files
Roman DonchenkoOpenCV Buildbot
Roman Donchenko
authored and
OpenCV Buildbot
committed
Merge pull request opencv#1170 from SpecLad:merge-2.4
2 parents ef91d7e + 3939d78 commit b2d359b

32 files changed

+358
-215
lines changed

3rdparty/tbb/CMakeLists.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,15 @@ endif()
230230
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations)
231231
string(REPLACE "-Werror=non-virtual-dtor" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
232232

233+
if (WIN32)
234+
set(tbb_debug_postfix "_debug") # to fit pragmas in _windef.h inside TBB
235+
else()
236+
set(tbb_debug_postfix ${OPENCV_DEBUG_POSTFIX})
237+
endif()
238+
233239
set_target_properties(tbb
234240
PROPERTIES OUTPUT_NAME tbb
235-
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
241+
DEBUG_POSTFIX "${tbb_debug_postfix}"
236242
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
237243
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
238244
)

cmake/OpenCVDetectCUDA.cmake

+11-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ if(CUDA_FOUND)
9999
if(CUDA_GENERATION STREQUAL "Fermi")
100100
set(__cuda_arch_bin "2.0 2.1(2.0)")
101101
elseif(CUDA_GENERATION STREQUAL "Kepler")
102-
set(__cuda_arch_bin "3.0")
102+
if(${CUDA_VERSION} VERSION_LESS "5.0")
103+
set(__cuda_arch_bin "3.0")
104+
else()
105+
set(__cuda_arch_bin "3.0 3.5")
106+
endif()
103107
elseif(CUDA_GENERATION STREQUAL "Auto")
104108
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run"
105109
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
@@ -113,8 +117,12 @@ if(CUDA_FOUND)
113117
endif()
114118

115119
if(NOT DEFINED __cuda_arch_bin)
116-
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
117-
set(__cuda_arch_ptx "2.0 3.0")
120+
if(${CUDA_VERSION} VERSION_LESS "5.0")
121+
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
122+
else()
123+
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
124+
endif()
125+
set(__cuda_arch_ptx "3.0")
118126
endif()
119127

120128
set(CUDA_ARCH_BIN ${__cuda_arch_bin} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
Loading

doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Use for example the *OpenCV_Debug* name. Then by selecting the sheet :menuselect
5252

5353
.. code-block:: bash
5454
55-
$(OPENCV_DIR)\include
55+
$(OPENCV_DIR)\..\..\include
5656
5757
.. image:: images/PropertySheetOpenCVInclude.jpg
5858
:alt: Add the include dir like this.
@@ -64,7 +64,7 @@ Next go to the :menuselection:`Linker --> General` and under the *"Additional Li
6464

6565
.. code-block:: bash
6666
67-
$(OPENCV_DIR)\libs
67+
$(OPENCV_DIR)\lib
6868
6969
.. image:: images/PropertySheetOpenCVLib.jpg
7070
:alt: Add the library folder like this.

modules/contrib/src/ba.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ static void fjac(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, C
746746
CvMat* _mp = cvCreateMat(1, 1, CV_64FC2 ); //projection of the point
747747

748748
//split camera params into different matrices
749-
CvMat _ri, _ti, _k;
749+
CvMat _ri, _ti, _k = cvMat(0, 0, CV_64F, NULL); // dummy initialization to fix warning of cl.exe
750750
cvGetRows( cam_params, &_ri, 0, 3 );
751751
cvGetRows( cam_params, &_ti, 3, 6 );
752752

modules/contrib/src/featuretracker.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,18 @@ CvFeatureTracker::CvFeatureTracker(CvFeatureTrackerParams _params) :
5959
dd->set("nOctaveLayers", 5);
6060
dd->set("contrastThreshold", 0.04);
6161
dd->set("edgeThreshold", 10.7);
62+
break;
6263
case CvFeatureTrackerParams::SURF:
6364
dd = Algorithm::create<Feature2D>("Feature2D.SURF");
6465
if( dd.empty() )
6566
CV_Error(CV_StsNotImplemented, "OpenCV has been compiled without SURF support");
6667
dd->set("hessianThreshold", 400);
6768
dd->set("nOctaves", 3);
6869
dd->set("nOctaveLayers", 4);
70+
break;
6971
default:
7072
CV_Error(CV_StsBadArg, "Unknown feature type");
73+
break;
7174
}
7275

7376
matcher = new BFMatcher(NORM_L2);

modules/core/include/opencv2/core/cvdef.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
#ifndef CV_INLINE
8585
# if defined __cplusplus
8686
# define CV_INLINE static inline
87-
# elif (defined WIN32 || defined _WIN32 || defined WINCE) && !defined __GNUC__
87+
# elif defined _MSC_VER
8888
# define CV_INLINE __inline
8989
# else
9090
# define CV_INLINE static

modules/features2d/src/bagofwords.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void BOWImgDescriptorExtractor::compute( const Mat& image, std::vector<KeyPoint>
147147
int clusterCount = descriptorSize(); // = vocabulary.rows
148148

149149
// Compute descriptors for the image.
150-
Mat descriptors = _descriptors ? *_descriptors : Mat();
150+
Mat descriptors;
151151
dextractor->compute( image, keypoints, descriptors );
152152

153153
// Match keypoint descriptors to cluster center (to vocabulary)
@@ -176,6 +176,11 @@ void BOWImgDescriptorExtractor::compute( const Mat& image, std::vector<KeyPoint>
176176

177177
// Normalize image descriptor.
178178
imgDescriptor /= descriptors.rows;
179+
180+
// Add the descriptors of image keypoints
181+
if (_descriptors) {
182+
*_descriptors = descriptors.clone();
183+
}
179184
}
180185

181186
int BOWImgDescriptorExtractor::descriptorSize() const

modules/highgui/src/cap_qtkit.mm

+5-2
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,11 @@ - (IplImage*)getOutput;
275275
double sleepTime = 0.005;
276276
double total = 0;
277277

278-
while (![capture updateImage] && (total += sleepTime)<=timeOut)
279-
usleep((int)(sleepTime*1000));
278+
NSDate *loopUntil = [NSDate dateWithTimeIntervalSinceNow:sleepTime];
279+
while (![capture updateImage] && (total += sleepTime)<=timeOut &&
280+
[[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode
281+
beforeDate:loopUntil])
282+
loopUntil = [NSDate dateWithTimeIntervalSinceNow:sleepTime];
280283

281284
[localpool drain];
282285

modules/imgproc/src/distransform.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,16 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
744744

745745
if( labelType == CV_DIST_LABEL_CCOMP )
746746
{
747+
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
748+
if( maskSize == CV_DIST_MASK_5 )
749+
{
750+
IppiSize roi = { src->cols, src->rows };
751+
if( ippiDistanceTransform_5x5_8u32f_C1R(
752+
src->data.ptr, src->step,
753+
dst->data.fl, dst->step, roi, _mask) >= 0 )
754+
return;
755+
}
756+
#endif
747757
Mat zpix = src == 0;
748758
connectedComponents(zpix, labels, 8, CV_32S);
749759
}

modules/imgproc/src/histogram.cpp

+12-4
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ class calcHist1D_Invoker
266266
}
267267

268268
private:
269+
calcHist1D_Invoker operator=(const calcHist1D_Invoker&);
270+
269271
T* p_[one];
270272
uchar* mask_;
271273
int step_[one];
@@ -338,6 +340,8 @@ class calcHist2D_Invoker
338340
}
339341

340342
private:
343+
calcHist2D_Invoker operator=(const calcHist2D_Invoker&);
344+
341345
T* p_[two];
342346
uchar* mask_;
343347
int step_[two];
@@ -428,6 +432,8 @@ class calcHist3D_Invoker
428432
}
429433

430434
private:
435+
calcHist3D_Invoker operator=(const calcHist3D_Invoker&);
436+
431437
T* p_[three];
432438
uchar* mask_;
433439
int step_[three];
@@ -767,8 +773,7 @@ calcHist_( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
767773
#ifdef HAVE_TBB
768774
calcHist1D_Invoker<T> body(_ptrs, _deltas, hist, _uniranges, size[0], dims, imsize);
769775
parallel_for(BlockedRange(0, imsize.height), body);
770-
return;
771-
#endif
776+
#else
772777
double a = uniranges[0], b = uniranges[1];
773778
int sz = size[0], d0 = deltas[0], step0 = deltas[1];
774779
const T* p0 = (const T*)ptrs[0];
@@ -791,14 +796,15 @@ calcHist_( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
791796
((int*)H)[idx]++;
792797
}
793798
}
799+
#endif //HAVE_TBB
800+
return;
794801
}
795802
else if( dims == 2 )
796803
{
797804
#ifdef HAVE_TBB
798805
calcHist2D_Invoker<T> body(_ptrs, _deltas, hist, _uniranges, size, dims, imsize, hstep);
799806
parallel_for(BlockedRange(0, imsize.height), body);
800-
return;
801-
#endif
807+
#else
802808
double a0 = uniranges[0], b0 = uniranges[1], a1 = uniranges[2], b1 = uniranges[3];
803809
int sz0 = size[0], sz1 = size[1];
804810
int d0 = deltas[0], step0 = deltas[1],
@@ -827,6 +833,8 @@ calcHist_( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
827833
((int*)(H + hstep0*idx0))[idx1]++;
828834
}
829835
}
836+
#endif //HAVE_TBB
837+
return;
830838
}
831839
else if( dims == 3 )
832840
{

modules/imgproc/src/shapedescr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ cv::RotatedRect cv::fitEllipse( InputArray _points )
381381
// New fitellipse algorithm, contributed by Dr. Daniel Weiss
382382
Point2f c(0,0);
383383
double gfp[5], rp[5], t;
384-
const double min_eps = 1e-6;
384+
const double min_eps = 1e-8;
385385
bool is_float = depth == CV_32F;
386386
const Point* ptsi = (const Point*)points.data;
387387
const Point2f* ptsf = (const Point2f*)points.data;

modules/imgproc/src/sumpixels.cpp

+50
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
//M*/
4242

4343
#include "precomp.hpp"
44+
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
45+
static IppStatus sts = ippInit();
46+
#endif
4447

4548
namespace cv
4649
{
@@ -234,6 +237,53 @@ void cv::integral( InputArray _src, OutputArray _sum, OutputArray _sqsum, Output
234237
if( sdepth <= 0 )
235238
sdepth = depth == CV_8U ? CV_32S : CV_64F;
236239
sdepth = CV_MAT_DEPTH(sdepth);
240+
241+
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
242+
if( ( depth == CV_8U ) && ( !_tilted.needed() ) )
243+
{
244+
if( sdepth == CV_32F )
245+
{
246+
if( cn == 1 )
247+
{
248+
IppiSize srcRoiSize = ippiSize( src.cols, src.rows );
249+
_sum.create( isize, CV_MAKETYPE( sdepth, cn ) );
250+
sum = _sum.getMat();
251+
if( _sqsum.needed() )
252+
{
253+
_sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) );
254+
sqsum = _sqsum.getMat();
255+
ippiSqrIntegral_8u32f64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 );
256+
}
257+
else
258+
{
259+
ippiIntegral_8u32f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, srcRoiSize, 0 );
260+
}
261+
return;
262+
}
263+
}
264+
if( sdepth == CV_32S )
265+
{
266+
if( cn == 1 )
267+
{
268+
IppiSize srcRoiSize = ippiSize( src.cols, src.rows );
269+
_sum.create( isize, CV_MAKETYPE( sdepth, cn ) );
270+
sum = _sum.getMat();
271+
if( _sqsum.needed() )
272+
{
273+
_sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) );
274+
sqsum = _sqsum.getMat();
275+
ippiSqrIntegral_8u32s64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 );
276+
}
277+
else
278+
{
279+
ippiIntegral_8u32s_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, srcRoiSize, 0 );
280+
}
281+
return;
282+
}
283+
}
284+
}
285+
#endif
286+
237287
_sum.create( isize, CV_MAKETYPE(sdepth, cn) );
238288
sum = _sum.getMat();
239289

0 commit comments

Comments
 (0)