1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge remote-tracking branch 'origin/2.4' into merge-2.4

Conflicts:
	modules/core/include/opencv2/core/types_c.h
	modules/gpu/src/cuda/imgproc.cu
	modules/gpu/src/cuda/safe_call.hpp
	modules/gpu/src/error.cpp
	modules/gpu/src/imgproc.cpp
	modules/imgproc/src/distransform.cpp
	modules/imgproc/src/shapedescr.cpp
	modules/python/src2/cv2.cpp
	modules/python/src2/cv2.cv.hpp
This commit is contained in:
Roman Donchenko
2013-07-22 18:38:57 +04:00
32 changed files with 358 additions and 215 deletions
+10
View File
@@ -744,6 +744,16 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe
if( labelType == CV_DIST_LABEL_CCOMP )
{
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
if( maskSize == CV_DIST_MASK_5 )
{
IppiSize roi = { src->cols, src->rows };
if( ippiDistanceTransform_5x5_8u32f_C1R(
src->data.ptr, src->step,
dst->data.fl, dst->step, roi, _mask) >= 0 )
return;
}
#endif
Mat zpix = src == 0;
connectedComponents(zpix, labels, 8, CV_32S);
}
+12 -4
View File
@@ -266,6 +266,8 @@ public:
}
private:
calcHist1D_Invoker operator=(const calcHist1D_Invoker&);
T* p_[one];
uchar* mask_;
int step_[one];
@@ -338,6 +340,8 @@ public:
}
private:
calcHist2D_Invoker operator=(const calcHist2D_Invoker&);
T* p_[two];
uchar* mask_;
int step_[two];
@@ -428,6 +432,8 @@ public:
}
private:
calcHist3D_Invoker operator=(const calcHist3D_Invoker&);
T* p_[three];
uchar* mask_;
int step_[three];
@@ -767,8 +773,7 @@ calcHist_( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
#ifdef HAVE_TBB
calcHist1D_Invoker<T> body(_ptrs, _deltas, hist, _uniranges, size[0], dims, imsize);
parallel_for(BlockedRange(0, imsize.height), body);
return;
#endif
#else
double a = uniranges[0], b = uniranges[1];
int sz = size[0], d0 = deltas[0], step0 = deltas[1];
const T* p0 = (const T*)ptrs[0];
@@ -791,14 +796,15 @@ calcHist_( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
((int*)H)[idx]++;
}
}
#endif //HAVE_TBB
return;
}
else if( dims == 2 )
{
#ifdef HAVE_TBB
calcHist2D_Invoker<T> body(_ptrs, _deltas, hist, _uniranges, size, dims, imsize, hstep);
parallel_for(BlockedRange(0, imsize.height), body);
return;
#endif
#else
double a0 = uniranges[0], b0 = uniranges[1], a1 = uniranges[2], b1 = uniranges[3];
int sz0 = size[0], sz1 = size[1];
int d0 = deltas[0], step0 = deltas[1],
@@ -827,6 +833,8 @@ calcHist_( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
((int*)(H + hstep0*idx0))[idx1]++;
}
}
#endif //HAVE_TBB
return;
}
else if( dims == 3 )
{
+1 -1
View File
@@ -381,7 +381,7 @@ cv::RotatedRect cv::fitEllipse( InputArray _points )
// New fitellipse algorithm, contributed by Dr. Daniel Weiss
Point2f c(0,0);
double gfp[5], rp[5], t;
const double min_eps = 1e-6;
const double min_eps = 1e-8;
bool is_float = depth == CV_32F;
const Point* ptsi = (const Point*)points.data;
const Point2f* ptsf = (const Point2f*)points.data;
+50
View File
@@ -41,6 +41,9 @@
//M*/
#include "precomp.hpp"
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
static IppStatus sts = ippInit();
#endif
namespace cv
{
@@ -234,6 +237,53 @@ void cv::integral( InputArray _src, OutputArray _sum, OutputArray _sqsum, Output
if( sdepth <= 0 )
sdepth = depth == CV_8U ? CV_32S : CV_64F;
sdepth = CV_MAT_DEPTH(sdepth);
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
if( ( depth == CV_8U ) && ( !_tilted.needed() ) )
{
if( sdepth == CV_32F )
{
if( cn == 1 )
{
IppiSize srcRoiSize = ippiSize( src.cols, src.rows );
_sum.create( isize, CV_MAKETYPE( sdepth, cn ) );
sum = _sum.getMat();
if( _sqsum.needed() )
{
_sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) );
sqsum = _sqsum.getMat();
ippiSqrIntegral_8u32f64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 );
}
else
{
ippiIntegral_8u32f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, srcRoiSize, 0 );
}
return;
}
}
if( sdepth == CV_32S )
{
if( cn == 1 )
{
IppiSize srcRoiSize = ippiSize( src.cols, src.rows );
_sum.create( isize, CV_MAKETYPE( sdepth, cn ) );
sum = _sum.getMat();
if( _sqsum.needed() )
{
_sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) );
sqsum = _sqsum.getMat();
ippiSqrIntegral_8u32s64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 );
}
else
{
ippiIntegral_8u32s_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, srcRoiSize, 0 );
}
return;
}
}
}
#endif
_sum.create( isize, CV_MAKETYPE(sdepth, cn) );
sum = _sum.getMat();