mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge commit '43aec5ad' into merge-2.4
Conflicts: cmake/OpenCVConfig.cmake cmake/OpenCVLegacyOptions.cmake modules/contrib/src/retina.cpp modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst modules/gpu/doc/video.rst modules/gpu/src/speckle_filtering.cpp modules/python/src2/cv2.cv.hpp modules/python/test/test2.py samples/python/watershed.py
This commit is contained in:
@@ -544,7 +544,7 @@ Range
|
||||
-----
|
||||
.. ocv:class:: Range
|
||||
|
||||
Template class specifying a continuous subsequence (slice) of a sequence.
|
||||
Template class specifying a continuous subsequence (slice) of a sequence.
|
||||
|
||||
::
|
||||
|
||||
@@ -854,7 +854,7 @@ Mat
|
||||
---
|
||||
.. ocv:class:: Mat
|
||||
|
||||
OpenCV C++ n-dimensional dense array class
|
||||
OpenCV C++ n-dimensional dense array class
|
||||
::
|
||||
|
||||
class CV_EXPORTS Mat
|
||||
@@ -2941,4 +2941,3 @@ The above methods are usually enough for users. If you want to make your own alg
|
||||
* Add public virtual method ``AlgorithmInfo* info() const;`` to your class.
|
||||
* Add constructor function, ``AlgorithmInfo`` instance and implement the ``info()`` method. The simplest way is to take http://code.opencv.org/projects/opencv/repository/revisions/master/entry/modules/ml/src/ml_init.cpp as the reference and modify it according to the list of your parameters.
|
||||
* Add some public function (e.g. ``initModule_<mymodule>()``) that calls info() of your algorithm and put it into the same source file as ``info()`` implementation. This is to force C++ linker to include this object file into the target application. See ``Algorithm::create()`` for details.
|
||||
|
||||
|
||||
@@ -16,4 +16,3 @@ core. The Core Functionality
|
||||
clustering
|
||||
utility_and_system_functions_and_macros
|
||||
opengl_interop
|
||||
|
||||
|
||||
@@ -1580,4 +1580,3 @@ Gathers all node pointers to a single sequence.
|
||||
:param storage: Container for the sequence
|
||||
|
||||
The function puts pointers of all nodes reachable from ``first`` into a single sequence. The pointers are written sequentially in the depth-first order.
|
||||
|
||||
|
||||
@@ -1677,4 +1677,3 @@ For example, `NumPy <http://numpy.scipy.org/>`_ arrays support the array interfa
|
||||
(480, 640, 3) 1
|
||||
|
||||
.. note:: In the new Python wrappers (**cv2** module) the function is not needed, since cv2 can process Numpy arrays (and this is the only supported array type).
|
||||
|
||||
|
||||
@@ -24,4 +24,3 @@ PERF_TEST_P(Size_MatType, abs, TYPICAL_MATS_ABS)
|
||||
|
||||
SANITY_CHECK(c);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,4 +73,3 @@ PERF_TEST_P(Size_MatType, bitwise_xor, TYPICAL_MATS_BITW_ARITHM)
|
||||
|
||||
SANITY_CHECK(c);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,4 +34,4 @@ PERF_TEST_P( Size_SrcDepth_DstChannels, merge,
|
||||
TEST_CYCLE_MULTIRUN(runs) merge( (vector<Mat> &)mv, dst );
|
||||
|
||||
SANITY_CHECK(dst, 1e-12);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1396,4 +1396,4 @@ CV_IMPL void cvNormalize( const CvArr* srcarr, CvArr* dstarr,
|
||||
cv::normalize( src, dst, a, b, norm_type, dst.type(), mask );
|
||||
}
|
||||
|
||||
/* End of file. */
|
||||
/* End of file. */
|
||||
|
||||
@@ -1823,4 +1823,4 @@ cvSVBkSb( const CvArr* warr, const CvArr* uarr,
|
||||
|
||||
cv::SVD::backSubst(w, u, v, rhs, dst);
|
||||
CV_Assert( dst.data == dst0.data );
|
||||
}
|
||||
}
|
||||
|
||||
+111
-111
@@ -454,45 +454,45 @@ cv::Scalar cv::sum( InputArray _src )
|
||||
{
|
||||
Mat src = _src.getMat();
|
||||
int k, cn = src.channels(), depth = src.depth();
|
||||
|
||||
|
||||
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
|
||||
size_t total_size = src.total();
|
||||
int rows = src.size[0], cols = (int)(total_size/rows);
|
||||
if( src.dims == 2 || (src.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
|
||||
{
|
||||
IppiSize sz = { cols, rows };
|
||||
int type = src.type();
|
||||
typedef IppStatus (CV_STDCALL* ippiSumFunc)(const void*, int, IppiSize, double *, int);
|
||||
ippiSumFunc ippFunc =
|
||||
type == CV_8UC1 ? (ippiSumFunc)ippiSum_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiSumFunc)ippiSum_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiSumFunc)ippiSum_8u_C4R :
|
||||
type == CV_16UC1 ? (ippiSumFunc)ippiSum_16u_C1R :
|
||||
type == CV_16UC3 ? (ippiSumFunc)ippiSum_16u_C3R :
|
||||
type == CV_16UC4 ? (ippiSumFunc)ippiSum_16u_C4R :
|
||||
type == CV_16SC1 ? (ippiSumFunc)ippiSum_16s_C1R :
|
||||
type == CV_16SC3 ? (ippiSumFunc)ippiSum_16s_C3R :
|
||||
type == CV_16SC4 ? (ippiSumFunc)ippiSum_16s_C4R :
|
||||
type == CV_32FC1 ? (ippiSumFunc)ippiSum_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiSumFunc)ippiSum_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiSumFunc)ippiSum_32f_C4R :
|
||||
0;
|
||||
if( ippFunc )
|
||||
{
|
||||
Ipp64f res[4];
|
||||
if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 )
|
||||
{
|
||||
Scalar sc;
|
||||
for( int i = 0; i < cn; i++ )
|
||||
{
|
||||
sc[i] = res[i];
|
||||
}
|
||||
return sc;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
size_t total_size = src.total();
|
||||
int rows = src.size[0], cols = (int)(total_size/rows);
|
||||
if( src.dims == 2 || (src.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
|
||||
{
|
||||
IppiSize sz = { cols, rows };
|
||||
int type = src.type();
|
||||
typedef IppStatus (CV_STDCALL* ippiSumFunc)(const void*, int, IppiSize, double *, int);
|
||||
ippiSumFunc ippFunc =
|
||||
type == CV_8UC1 ? (ippiSumFunc)ippiSum_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiSumFunc)ippiSum_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiSumFunc)ippiSum_8u_C4R :
|
||||
type == CV_16UC1 ? (ippiSumFunc)ippiSum_16u_C1R :
|
||||
type == CV_16UC3 ? (ippiSumFunc)ippiSum_16u_C3R :
|
||||
type == CV_16UC4 ? (ippiSumFunc)ippiSum_16u_C4R :
|
||||
type == CV_16SC1 ? (ippiSumFunc)ippiSum_16s_C1R :
|
||||
type == CV_16SC3 ? (ippiSumFunc)ippiSum_16s_C3R :
|
||||
type == CV_16SC4 ? (ippiSumFunc)ippiSum_16s_C4R :
|
||||
type == CV_32FC1 ? (ippiSumFunc)ippiSum_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiSumFunc)ippiSum_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiSumFunc)ippiSum_32f_C4R :
|
||||
0;
|
||||
if( ippFunc )
|
||||
{
|
||||
Ipp64f res[4];
|
||||
if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 )
|
||||
{
|
||||
Scalar sc;
|
||||
for( int i = 0; i < cn; i++ )
|
||||
{
|
||||
sc[i] = res[i];
|
||||
}
|
||||
return sc;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
SumFunc func = getSumFunc(depth);
|
||||
|
||||
CV_Assert( cn <= 4 && func != 0 );
|
||||
@@ -566,81 +566,81 @@ cv::Scalar cv::mean( InputArray _src, InputArray _mask )
|
||||
CV_Assert( mask.empty() || mask.type() == CV_8U );
|
||||
|
||||
int k, cn = src.channels(), depth = src.depth();
|
||||
|
||||
|
||||
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
|
||||
size_t total_size = src.total();
|
||||
int rows = src.size[0], cols = (int)(total_size/rows);
|
||||
if( src.dims == 2 || (src.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
|
||||
{
|
||||
IppiSize sz = { cols, rows };
|
||||
int type = src.type();
|
||||
if( !mask.empty() )
|
||||
{
|
||||
typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC1)(const void *, int, void *, int, IppiSize, Ipp64f *);
|
||||
ippiMaskMeanFuncC1 ippFuncC1 =
|
||||
type == CV_8UC1 ? (ippiMaskMeanFuncC1)ippiMean_8u_C1MR :
|
||||
type == CV_16UC1 ? (ippiMaskMeanFuncC1)ippiMean_16u_C1MR :
|
||||
type == CV_32FC1 ? (ippiMaskMeanFuncC1)ippiMean_32f_C1MR :
|
||||
0;
|
||||
if( ippFuncC1 )
|
||||
{
|
||||
Ipp64f res;
|
||||
if( ippFuncC1(src.data, src.step[0], mask.data, mask.step[0], sz, &res) >= 0 )
|
||||
{
|
||||
return Scalar(res);
|
||||
}
|
||||
}
|
||||
typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC3)(const void *, int, void *, int, IppiSize, int, Ipp64f *);
|
||||
ippiMaskMeanFuncC3 ippFuncC3 =
|
||||
type == CV_8UC3 ? (ippiMaskMeanFuncC3)ippiMean_8u_C3CMR :
|
||||
type == CV_16UC3 ? (ippiMaskMeanFuncC3)ippiMean_16u_C3CMR :
|
||||
type == CV_32FC3 ? (ippiMaskMeanFuncC3)ippiMean_32f_C3CMR :
|
||||
0;
|
||||
if( ippFuncC3 )
|
||||
{
|
||||
Ipp64f res1, res2, res3;
|
||||
if( ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 1, &res1) >= 0 &&
|
||||
ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 2, &res2) >= 0 &&
|
||||
ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 3, &res3) >= 0 )
|
||||
{
|
||||
return Scalar(res1, res2, res3);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef IppStatus (CV_STDCALL* ippiMeanFunc)(const void*, int, IppiSize, double *, int);
|
||||
ippiMeanFunc ippFunc =
|
||||
type == CV_8UC1 ? (ippiMeanFunc)ippiMean_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiMeanFunc)ippiMean_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiMeanFunc)ippiMean_8u_C4R :
|
||||
type == CV_16UC1 ? (ippiMeanFunc)ippiMean_16u_C1R :
|
||||
type == CV_16UC3 ? (ippiMeanFunc)ippiMean_16u_C3R :
|
||||
type == CV_16UC4 ? (ippiMeanFunc)ippiMean_16u_C4R :
|
||||
type == CV_16SC1 ? (ippiMeanFunc)ippiMean_16s_C1R :
|
||||
type == CV_16SC3 ? (ippiMeanFunc)ippiMean_16s_C3R :
|
||||
type == CV_16SC4 ? (ippiMeanFunc)ippiMean_16s_C4R :
|
||||
type == CV_32FC1 ? (ippiMeanFunc)ippiMean_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiMeanFunc)ippiMean_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiMeanFunc)ippiMean_32f_C4R :
|
||||
0;
|
||||
if( ippFunc )
|
||||
{
|
||||
Ipp64f res[4];
|
||||
if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 )
|
||||
{
|
||||
Scalar sc;
|
||||
for( int i = 0; i < cn; i++ )
|
||||
{
|
||||
sc[i] = res[i];
|
||||
}
|
||||
return sc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
size_t total_size = src.total();
|
||||
int rows = src.size[0], cols = (int)(total_size/rows);
|
||||
if( src.dims == 2 || (src.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
|
||||
{
|
||||
IppiSize sz = { cols, rows };
|
||||
int type = src.type();
|
||||
if( !mask.empty() )
|
||||
{
|
||||
typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC1)(const void *, int, void *, int, IppiSize, Ipp64f *);
|
||||
ippiMaskMeanFuncC1 ippFuncC1 =
|
||||
type == CV_8UC1 ? (ippiMaskMeanFuncC1)ippiMean_8u_C1MR :
|
||||
type == CV_16UC1 ? (ippiMaskMeanFuncC1)ippiMean_16u_C1MR :
|
||||
type == CV_32FC1 ? (ippiMaskMeanFuncC1)ippiMean_32f_C1MR :
|
||||
0;
|
||||
if( ippFuncC1 )
|
||||
{
|
||||
Ipp64f res;
|
||||
if( ippFuncC1(src.data, src.step[0], mask.data, mask.step[0], sz, &res) >= 0 )
|
||||
{
|
||||
return Scalar(res);
|
||||
}
|
||||
}
|
||||
typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC3)(const void *, int, void *, int, IppiSize, int, Ipp64f *);
|
||||
ippiMaskMeanFuncC3 ippFuncC3 =
|
||||
type == CV_8UC3 ? (ippiMaskMeanFuncC3)ippiMean_8u_C3CMR :
|
||||
type == CV_16UC3 ? (ippiMaskMeanFuncC3)ippiMean_16u_C3CMR :
|
||||
type == CV_32FC3 ? (ippiMaskMeanFuncC3)ippiMean_32f_C3CMR :
|
||||
0;
|
||||
if( ippFuncC3 )
|
||||
{
|
||||
Ipp64f res1, res2, res3;
|
||||
if( ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 1, &res1) >= 0 &&
|
||||
ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 2, &res2) >= 0 &&
|
||||
ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 3, &res3) >= 0 )
|
||||
{
|
||||
return Scalar(res1, res2, res3);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef IppStatus (CV_STDCALL* ippiMeanFunc)(const void*, int, IppiSize, double *, int);
|
||||
ippiMeanFunc ippFunc =
|
||||
type == CV_8UC1 ? (ippiMeanFunc)ippiMean_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiMeanFunc)ippiMean_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiMeanFunc)ippiMean_8u_C4R :
|
||||
type == CV_16UC1 ? (ippiMeanFunc)ippiMean_16u_C1R :
|
||||
type == CV_16UC3 ? (ippiMeanFunc)ippiMean_16u_C3R :
|
||||
type == CV_16UC4 ? (ippiMeanFunc)ippiMean_16u_C4R :
|
||||
type == CV_16SC1 ? (ippiMeanFunc)ippiMean_16s_C1R :
|
||||
type == CV_16SC3 ? (ippiMeanFunc)ippiMean_16s_C3R :
|
||||
type == CV_16SC4 ? (ippiMeanFunc)ippiMean_16s_C4R :
|
||||
type == CV_32FC1 ? (ippiMeanFunc)ippiMean_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiMeanFunc)ippiMean_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiMeanFunc)ippiMean_32f_C4R :
|
||||
0;
|
||||
if( ippFunc )
|
||||
{
|
||||
Ipp64f res[4];
|
||||
if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 )
|
||||
{
|
||||
Scalar sc;
|
||||
for( int i = 0; i < cn; i++ )
|
||||
{
|
||||
sc[i] = res[i];
|
||||
}
|
||||
return sc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
SumFunc func = getSumFunc(depth);
|
||||
|
||||
CV_Assert( cn <= 4 && func != 0 );
|
||||
|
||||
@@ -2118,5 +2118,3 @@ TEST(Core_DS_Seq, sort_invert) { Core_SeqSortInvTest test; test.safe_run(); }
|
||||
TEST(Core_DS_Set, basic_operations) { Core_SetTest test; test.safe_run(); }
|
||||
TEST(Core_DS_Graph, basic_operations) { Core_GraphTest test; test.safe_run(); }
|
||||
TEST(Core_DS_Graph, scan) { Core_GraphScanTest test; test.safe_run(); }
|
||||
|
||||
|
||||
|
||||
@@ -866,5 +866,3 @@ protected:
|
||||
};
|
||||
|
||||
TEST(Core_DFT, complex_output) { Core_DFTComplexOutputTest test; test.safe_run(); }
|
||||
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ protected:
|
||||
Vec<int, 5> v1(15, 16, 17, 18, 19), ov1;
|
||||
Scalar sc1(20.0, 21.1, 22.2, 23.3), osc1;
|
||||
Range g1(7, 8), og1;
|
||||
|
||||
|
||||
FileStorage fs(fname, FileStorage::WRITE);
|
||||
fs << "mi" << mi;
|
||||
fs << "mv" << mv;
|
||||
|
||||
@@ -2755,4 +2755,3 @@ TEST(CovariationMatrixVectorOfMatWithMean, accuracy)
|
||||
}
|
||||
|
||||
/* End of file. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user