Merge 2.4.3-rc
This commit is contained in:
@@ -806,6 +806,7 @@ struct Mutex::Impl
|
||||
int refcount;
|
||||
};
|
||||
|
||||
#ifndef __GNUC__
|
||||
int _interlockedExchangeAdd(int* addr, int delta)
|
||||
{
|
||||
#if defined _MSC_VER && _MSC_VER >= 1500
|
||||
@@ -814,6 +815,7 @@ int _interlockedExchangeAdd(int* addr, int delta)
|
||||
return (int)InterlockedExchangeAdd((long volatile*)addr, delta);
|
||||
#endif
|
||||
}
|
||||
#endif // __GNUC__
|
||||
|
||||
#elif defined __APPLE__
|
||||
|
||||
|
@@ -69,7 +69,7 @@ protected:
|
||||
|
||||
bool SomeMatFunctions();
|
||||
bool TestMat();
|
||||
template<typename _Tp> void TestType(Size sz, _Tp value=_Tp(1.f));
|
||||
template<typename _Tp> void TestType(Size sz, _Tp value);
|
||||
bool TestTemplateMat();
|
||||
bool TestMatND();
|
||||
bool TestSparseMat();
|
||||
@@ -116,9 +116,12 @@ template<typename _Tp> void CV_OperationsTest::TestType(Size sz, _Tp value)
|
||||
m.elemSize() == sizeof(_Tp) && m.step == m.elemSize()*m.cols);
|
||||
for( int y = 0; y < sz.height; y++ )
|
||||
for( int x = 0; x < sz.width; x++ )
|
||||
m(y, x) = value;
|
||||
{
|
||||
m(y,x) = value;
|
||||
}
|
||||
|
||||
CV_Assert( sum(m.reshape(1,1))[0] == (double)sz.width*sz.height );
|
||||
double s = sum(Mat(m).reshape(1))[0];
|
||||
CV_Assert( s == (double)sz.width*sz.height );
|
||||
}
|
||||
|
||||
bool CV_OperationsTest::TestMat()
|
||||
@@ -795,15 +798,16 @@ bool CV_OperationsTest::TestTemplateMat()
|
||||
}
|
||||
CV_Assert( badarg_catched );
|
||||
|
||||
#include <iostream>
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
Size size(2, 5);
|
||||
TestType<float>(size);
|
||||
TestType<cv::Vec3f>(size);
|
||||
TestType<cv::Matx31f>(size);
|
||||
TestType<cv::Matx41f>(size);
|
||||
TestType<cv::Matx32f>(size);
|
||||
TestType<float>(size, 1.f);
|
||||
cv::Vec3f val1 = 1.f;
|
||||
TestType<cv::Vec3f>(size, val1);
|
||||
cv::Matx31f val2 = 1.f;
|
||||
TestType<cv::Matx31f>(size, val2);
|
||||
cv::Matx41f val3 = 1.f;
|
||||
TestType<cv::Matx41f>(size, val3);
|
||||
cv::Matx32f val4 = 1.f;
|
||||
TestType<cv::Matx32f>(size, val4);
|
||||
}
|
||||
catch (const test_excep& e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user