mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
fix legacy constants
This commit is contained in:
parent
5f249a3e67
commit
0e6a2c0491
@ -23,7 +23,7 @@ PERF_TEST_P(Size_MatType_ROp, reduceR,
|
|||||||
int reduceOp = get<2>(GetParam());
|
int reduceOp = get<2>(GetParam());
|
||||||
|
|
||||||
int ddepth = -1;
|
int ddepth = -1;
|
||||||
if( CV_MAT_DEPTH(matType) < CV_32S && (reduceOp == CV_REDUCE_SUM || reduceOp == CV_REDUCE_AVG) )
|
if( CV_MAT_DEPTH(matType) < CV_32S && (reduceOp == REDUCE_SUM || reduceOp == REDUCE_AVG) )
|
||||||
ddepth = CV_32S;
|
ddepth = CV_32S;
|
||||||
|
|
||||||
Mat src(sz, matType);
|
Mat src(sz, matType);
|
||||||
@ -51,7 +51,7 @@ PERF_TEST_P(Size_MatType_ROp, reduceC,
|
|||||||
int reduceOp = get<2>(GetParam());
|
int reduceOp = get<2>(GetParam());
|
||||||
|
|
||||||
int ddepth = -1;
|
int ddepth = -1;
|
||||||
if( CV_MAT_DEPTH(matType)< CV_32S && (reduceOp == CV_REDUCE_SUM || reduceOp == CV_REDUCE_AVG) )
|
if( CV_MAT_DEPTH(matType)< CV_32S && (reduceOp == REDUCE_SUM || reduceOp == REDUCE_AVG) )
|
||||||
ddepth = CV_32S;
|
ddepth = CV_32S;
|
||||||
|
|
||||||
Mat src(sz, matType);
|
Mat src(sz, matType);
|
||||||
|
@ -804,7 +804,7 @@ void calcCovarMatrix( InputArray _src, OutputArray _covar, InputOutputArray _mea
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ctype = std::max(CV_MAT_DEPTH(ctype >= 0 ? ctype : type), CV_32F);
|
ctype = std::max(CV_MAT_DEPTH(ctype >= 0 ? ctype : type), CV_32F);
|
||||||
reduce( _src, _mean, takeRows ? 0 : 1, CV_REDUCE_AVG, ctype );
|
reduce( _src, _mean, takeRows ? 0 : 1, REDUCE_AVG, ctype );
|
||||||
mean = _mean.getMat();
|
mean = _mean.getMat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,7 +616,7 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
|
|||||||
if (!doubleSupport && (sdepth == CV_64F || ddepth == CV_64F))
|
if (!doubleSupport && (sdepth == CV_64F || ddepth == CV_64F))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (op == CV_REDUCE_AVG)
|
if (op == REDUCE_AVG)
|
||||||
{
|
{
|
||||||
if (sdepth < CV_32S && ddepth < CV_32S)
|
if (sdepth < CV_32S && ddepth < CV_32S)
|
||||||
ddepth = CV_32S;
|
ddepth = CV_32S;
|
||||||
@ -654,7 +654,7 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
|
|||||||
_dst.create(dsize, dtype);
|
_dst.create(dsize, dtype);
|
||||||
UMat dst = _dst.getUMat();
|
UMat dst = _dst.getUMat();
|
||||||
|
|
||||||
if (op0 == CV_REDUCE_AVG)
|
if (op0 == REDUCE_AVG)
|
||||||
k.args(ocl::KernelArg::ReadOnly(src),
|
k.args(ocl::KernelArg::ReadOnly(src),
|
||||||
ocl::KernelArg::WriteOnlyNoSize(dst), 1.0f / src.cols);
|
ocl::KernelArg::WriteOnlyNoSize(dst), 1.0f / src.cols);
|
||||||
else
|
else
|
||||||
@ -690,7 +690,7 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
|
|||||||
ocl::KernelArg srcarg = ocl::KernelArg::ReadOnly(src),
|
ocl::KernelArg srcarg = ocl::KernelArg::ReadOnly(src),
|
||||||
temparg = ocl::KernelArg::WriteOnlyNoSize(dst);
|
temparg = ocl::KernelArg::WriteOnlyNoSize(dst);
|
||||||
|
|
||||||
if (op0 == CV_REDUCE_AVG)
|
if (op0 == REDUCE_AVG)
|
||||||
k.args(srcarg, temparg, 1.0f / (dim == 0 ? src.rows : src.cols));
|
k.args(srcarg, temparg, 1.0f / (dim == 0 ? src.rows : src.cols));
|
||||||
else
|
else
|
||||||
k.args(srcarg, temparg);
|
k.args(srcarg, temparg);
|
||||||
@ -717,8 +717,8 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
|
|||||||
int ddepth = CV_MAT_DEPTH(dtype);
|
int ddepth = CV_MAT_DEPTH(dtype);
|
||||||
|
|
||||||
CV_Assert( cn == CV_MAT_CN(dtype) );
|
CV_Assert( cn == CV_MAT_CN(dtype) );
|
||||||
CV_Assert( op == CV_REDUCE_SUM || op == CV_REDUCE_MAX ||
|
CV_Assert( op == REDUCE_SUM || op == REDUCE_MAX ||
|
||||||
op == CV_REDUCE_MIN || op == CV_REDUCE_AVG );
|
op == REDUCE_MIN || op == REDUCE_AVG );
|
||||||
|
|
||||||
CV_OCL_RUN(_dst.isUMat(),
|
CV_OCL_RUN(_dst.isUMat(),
|
||||||
ocl_reduce(_src, _dst, dim, op, op0, stype, dtype))
|
ocl_reduce(_src, _dst, dim, op, op0, stype, dtype))
|
||||||
@ -732,9 +732,9 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
|
|||||||
_dst.create(dim == 0 ? 1 : src.rows, dim == 0 ? src.cols : 1, dtype);
|
_dst.create(dim == 0 ? 1 : src.rows, dim == 0 ? src.cols : 1, dtype);
|
||||||
Mat dst = _dst.getMat(), temp = dst;
|
Mat dst = _dst.getMat(), temp = dst;
|
||||||
|
|
||||||
if( op == CV_REDUCE_AVG )
|
if( op == REDUCE_AVG )
|
||||||
{
|
{
|
||||||
op = CV_REDUCE_SUM;
|
op = REDUCE_SUM;
|
||||||
if( sdepth < CV_32S && ddepth < CV_32S )
|
if( sdepth < CV_32S && ddepth < CV_32S )
|
||||||
{
|
{
|
||||||
temp.create(dst.rows, dst.cols, CV_32SC(cn));
|
temp.create(dst.rows, dst.cols, CV_32SC(cn));
|
||||||
@ -745,7 +745,7 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
|
|||||||
ReduceFunc func = 0;
|
ReduceFunc func = 0;
|
||||||
if( dim == 0 )
|
if( dim == 0 )
|
||||||
{
|
{
|
||||||
if( op == CV_REDUCE_SUM )
|
if( op == REDUCE_SUM )
|
||||||
{
|
{
|
||||||
if(sdepth == CV_8U && ddepth == CV_32S)
|
if(sdepth == CV_8U && ddepth == CV_32S)
|
||||||
func = GET_OPTIMIZED(reduceSumR8u32s);
|
func = GET_OPTIMIZED(reduceSumR8u32s);
|
||||||
@ -768,7 +768,7 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
|
|||||||
else if(sdepth == CV_64F && ddepth == CV_64F)
|
else if(sdepth == CV_64F && ddepth == CV_64F)
|
||||||
func = reduceSumR64f64f;
|
func = reduceSumR64f64f;
|
||||||
}
|
}
|
||||||
else if(op == CV_REDUCE_MAX)
|
else if(op == REDUCE_MAX)
|
||||||
{
|
{
|
||||||
if(sdepth == CV_8U && ddepth == CV_8U)
|
if(sdepth == CV_8U && ddepth == CV_8U)
|
||||||
func = GET_OPTIMIZED(reduceMaxR8u);
|
func = GET_OPTIMIZED(reduceMaxR8u);
|
||||||
@ -781,7 +781,7 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
|
|||||||
else if(sdepth == CV_64F && ddepth == CV_64F)
|
else if(sdepth == CV_64F && ddepth == CV_64F)
|
||||||
func = reduceMaxR64f;
|
func = reduceMaxR64f;
|
||||||
}
|
}
|
||||||
else if(op == CV_REDUCE_MIN)
|
else if(op == REDUCE_MIN)
|
||||||
{
|
{
|
||||||
if(sdepth == CV_8U && ddepth == CV_8U)
|
if(sdepth == CV_8U && ddepth == CV_8U)
|
||||||
func = GET_OPTIMIZED(reduceMinR8u);
|
func = GET_OPTIMIZED(reduceMinR8u);
|
||||||
@ -797,7 +797,7 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(op == CV_REDUCE_SUM)
|
if(op == REDUCE_SUM)
|
||||||
{
|
{
|
||||||
if(sdepth == CV_8U && ddepth == CV_32S)
|
if(sdepth == CV_8U && ddepth == CV_32S)
|
||||||
func = GET_OPTIMIZED(reduceSumC8u32s);
|
func = GET_OPTIMIZED(reduceSumC8u32s);
|
||||||
@ -820,7 +820,7 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
|
|||||||
else if(sdepth == CV_64F && ddepth == CV_64F)
|
else if(sdepth == CV_64F && ddepth == CV_64F)
|
||||||
func = reduceSumC64f64f;
|
func = reduceSumC64f64f;
|
||||||
}
|
}
|
||||||
else if(op == CV_REDUCE_MAX)
|
else if(op == REDUCE_MAX)
|
||||||
{
|
{
|
||||||
if(sdepth == CV_8U && ddepth == CV_8U)
|
if(sdepth == CV_8U && ddepth == CV_8U)
|
||||||
func = GET_OPTIMIZED(reduceMaxC8u);
|
func = GET_OPTIMIZED(reduceMaxC8u);
|
||||||
@ -833,7 +833,7 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
|
|||||||
else if(sdepth == CV_64F && ddepth == CV_64F)
|
else if(sdepth == CV_64F && ddepth == CV_64F)
|
||||||
func = reduceMaxC64f;
|
func = reduceMaxC64f;
|
||||||
}
|
}
|
||||||
else if(op == CV_REDUCE_MIN)
|
else if(op == REDUCE_MIN)
|
||||||
{
|
{
|
||||||
if(sdepth == CV_8U && ddepth == CV_8U)
|
if(sdepth == CV_8U && ddepth == CV_8U)
|
||||||
func = GET_OPTIMIZED(reduceMinC8u);
|
func = GET_OPTIMIZED(reduceMinC8u);
|
||||||
@ -854,7 +854,7 @@ void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
|
|||||||
|
|
||||||
func( src, temp );
|
func( src, temp );
|
||||||
|
|
||||||
if( op0 == CV_REDUCE_AVG )
|
if( op0 == REDUCE_AVG )
|
||||||
temp.convertTo(dst, dst.type(), 1./(dim == 0 ? src.rows : src.cols));
|
temp.convertTo(dst, dst.type(), 1./(dim == 0 ? src.rows : src.cols));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -868,9 +868,9 @@ template<typename T> static void sort_( const Mat& src, Mat& dst, int flags )
|
|||||||
{
|
{
|
||||||
AutoBuffer<T> buf;
|
AutoBuffer<T> buf;
|
||||||
int n, len;
|
int n, len;
|
||||||
bool sortRows = (flags & 1) == CV_SORT_EVERY_ROW;
|
bool sortRows = (flags & 1) == SORT_EVERY_ROW;
|
||||||
bool inplace = src.data == dst.data;
|
bool inplace = src.data == dst.data;
|
||||||
bool sortDescending = (flags & CV_SORT_DESCENDING) != 0;
|
bool sortDescending = (flags & SORT_DESCENDING) != 0;
|
||||||
|
|
||||||
if( sortRows )
|
if( sortRows )
|
||||||
n = src.rows, len = src.cols;
|
n = src.rows, len = src.cols;
|
||||||
@ -940,8 +940,8 @@ static bool ipp_sort(const Mat& src, Mat& dst, int flags)
|
|||||||
{
|
{
|
||||||
CV_INSTRUMENT_REGION_IPP();
|
CV_INSTRUMENT_REGION_IPP();
|
||||||
|
|
||||||
bool sortRows = (flags & 1) == CV_SORT_EVERY_ROW;
|
bool sortRows = (flags & 1) == SORT_EVERY_ROW;
|
||||||
bool sortDescending = (flags & CV_SORT_DESCENDING) != 0;
|
bool sortDescending = (flags & SORT_DESCENDING) != 0;
|
||||||
bool inplace = (src.data == dst.data);
|
bool inplace = (src.data == dst.data);
|
||||||
int depth = src.depth();
|
int depth = src.depth();
|
||||||
IppDataType type = ippiGetDataType(depth);
|
IppDataType type = ippiGetDataType(depth);
|
||||||
@ -1013,8 +1013,8 @@ template<typename T> static void sortIdx_( const Mat& src, Mat& dst, int flags )
|
|||||||
{
|
{
|
||||||
AutoBuffer<T> buf;
|
AutoBuffer<T> buf;
|
||||||
AutoBuffer<int> ibuf;
|
AutoBuffer<int> ibuf;
|
||||||
bool sortRows = (flags & 1) == CV_SORT_EVERY_ROW;
|
bool sortRows = (flags & 1) == SORT_EVERY_ROW;
|
||||||
bool sortDescending = (flags & CV_SORT_DESCENDING) != 0;
|
bool sortDescending = (flags & SORT_DESCENDING) != 0;
|
||||||
|
|
||||||
CV_Assert( src.data != dst.data );
|
CV_Assert( src.data != dst.data );
|
||||||
|
|
||||||
|
@ -1819,8 +1819,8 @@ OCL_TEST_P(ReduceSum, Mat)
|
|||||||
{
|
{
|
||||||
generateTestData();
|
generateTestData();
|
||||||
|
|
||||||
OCL_OFF(cv::reduce(src_roi, dst_roi, dim, CV_REDUCE_SUM, dtype));
|
OCL_OFF(cv::reduce(src_roi, dst_roi, dim, REDUCE_SUM, dtype));
|
||||||
OCL_ON(cv::reduce(usrc_roi, udst_roi, dim, CV_REDUCE_SUM, dtype));
|
OCL_ON(cv::reduce(usrc_roi, udst_roi, dim, REDUCE_SUM, dtype));
|
||||||
|
|
||||||
double eps = ddepth <= CV_32S ? 1 : 7e-4;
|
double eps = ddepth <= CV_32S ? 1 : 7e-4;
|
||||||
OCL_EXPECT_MATS_NEAR(dst, eps);
|
OCL_EXPECT_MATS_NEAR(dst, eps);
|
||||||
@ -1835,8 +1835,8 @@ OCL_TEST_P(ReduceMax, Mat)
|
|||||||
{
|
{
|
||||||
generateTestData();
|
generateTestData();
|
||||||
|
|
||||||
OCL_OFF(cv::reduce(src_roi, dst_roi, dim, CV_REDUCE_MAX, dtype));
|
OCL_OFF(cv::reduce(src_roi, dst_roi, dim, REDUCE_MAX, dtype));
|
||||||
OCL_ON(cv::reduce(usrc_roi, udst_roi, dim, CV_REDUCE_MAX, dtype));
|
OCL_ON(cv::reduce(usrc_roi, udst_roi, dim, REDUCE_MAX, dtype));
|
||||||
|
|
||||||
OCL_EXPECT_MATS_NEAR(dst, 0);
|
OCL_EXPECT_MATS_NEAR(dst, 0);
|
||||||
}
|
}
|
||||||
@ -1850,8 +1850,8 @@ OCL_TEST_P(ReduceMin, Mat)
|
|||||||
{
|
{
|
||||||
generateTestData();
|
generateTestData();
|
||||||
|
|
||||||
OCL_OFF(cv::reduce(src_roi, dst_roi, dim, CV_REDUCE_MIN, dtype));
|
OCL_OFF(cv::reduce(src_roi, dst_roi, dim, REDUCE_MIN, dtype));
|
||||||
OCL_ON(cv::reduce(usrc_roi, udst_roi, dim, CV_REDUCE_MIN, dtype));
|
OCL_ON(cv::reduce(usrc_roi, udst_roi, dim, REDUCE_MIN, dtype));
|
||||||
|
|
||||||
OCL_EXPECT_MATS_NEAR(dst, 0);
|
OCL_EXPECT_MATS_NEAR(dst, 0);
|
||||||
}
|
}
|
||||||
@ -1865,8 +1865,8 @@ OCL_TEST_P(ReduceAvg, Mat)
|
|||||||
{
|
{
|
||||||
generateTestData();
|
generateTestData();
|
||||||
|
|
||||||
OCL_OFF(cv::reduce(src_roi, dst_roi, dim, CV_REDUCE_AVG, dtype));
|
OCL_OFF(cv::reduce(src_roi, dst_roi, dim, REDUCE_AVG, dtype));
|
||||||
OCL_ON(cv::reduce(usrc_roi, udst_roi, dim, CV_REDUCE_AVG, dtype));
|
OCL_ON(cv::reduce(usrc_roi, udst_roi, dim, REDUCE_AVG, dtype));
|
||||||
|
|
||||||
double eps = ddepth <= CV_32S ? 1 : 6e-6;
|
double eps = ddepth <= CV_32S ? 1 : 6e-6;
|
||||||
OCL_EXPECT_MATS_NEAR(dst, eps);
|
OCL_EXPECT_MATS_NEAR(dst, eps);
|
||||||
|
@ -93,7 +93,7 @@ int Core_ReduceTest::checkOp( const Mat& src, int dstType, int opType, const Mat
|
|||||||
{
|
{
|
||||||
int srcType = src.type();
|
int srcType = src.type();
|
||||||
bool support = false;
|
bool support = false;
|
||||||
if( opType == CV_REDUCE_SUM || opType == CV_REDUCE_AVG )
|
if( opType == REDUCE_SUM || opType == REDUCE_AVG )
|
||||||
{
|
{
|
||||||
if( srcType == CV_8U && (dstType == CV_32S || dstType == CV_32F || dstType == CV_64F) )
|
if( srcType == CV_8U && (dstType == CV_32S || dstType == CV_32F || dstType == CV_64F) )
|
||||||
support = true;
|
support = true;
|
||||||
@ -106,7 +106,7 @@ int Core_ReduceTest::checkOp( const Mat& src, int dstType, int opType, const Mat
|
|||||||
if( srcType == CV_64F && dstType == CV_64F)
|
if( srcType == CV_64F && dstType == CV_64F)
|
||||||
support = true;
|
support = true;
|
||||||
}
|
}
|
||||||
else if( opType == CV_REDUCE_MAX )
|
else if( opType == REDUCE_MAX )
|
||||||
{
|
{
|
||||||
if( srcType == CV_8U && dstType == CV_8U )
|
if( srcType == CV_8U && dstType == CV_8U )
|
||||||
support = true;
|
support = true;
|
||||||
@ -115,7 +115,7 @@ int Core_ReduceTest::checkOp( const Mat& src, int dstType, int opType, const Mat
|
|||||||
if( srcType == CV_64F && dstType == CV_64F )
|
if( srcType == CV_64F && dstType == CV_64F )
|
||||||
support = true;
|
support = true;
|
||||||
}
|
}
|
||||||
else if( opType == CV_REDUCE_MIN )
|
else if( opType == REDUCE_MIN )
|
||||||
{
|
{
|
||||||
if( srcType == CV_8U && dstType == CV_8U)
|
if( srcType == CV_8U && dstType == CV_8U)
|
||||||
support = true;
|
support = true;
|
||||||
@ -128,7 +128,7 @@ int Core_ReduceTest::checkOp( const Mat& src, int dstType, int opType, const Mat
|
|||||||
return cvtest::TS::OK;
|
return cvtest::TS::OK;
|
||||||
|
|
||||||
double eps = 0.0;
|
double eps = 0.0;
|
||||||
if ( opType == CV_REDUCE_SUM || opType == CV_REDUCE_AVG )
|
if ( opType == REDUCE_SUM || opType == REDUCE_AVG )
|
||||||
{
|
{
|
||||||
if ( dstType == CV_32F )
|
if ( dstType == CV_32F )
|
||||||
eps = 1.e-5;
|
eps = 1.e-5;
|
||||||
@ -152,10 +152,10 @@ int Core_ReduceTest::checkOp( const Mat& src, int dstType, int opType, const Mat
|
|||||||
if( check )
|
if( check )
|
||||||
{
|
{
|
||||||
char msg[100];
|
char msg[100];
|
||||||
const char* opTypeStr = opType == CV_REDUCE_SUM ? "CV_REDUCE_SUM" :
|
const char* opTypeStr = opType == REDUCE_SUM ? "REDUCE_SUM" :
|
||||||
opType == CV_REDUCE_AVG ? "CV_REDUCE_AVG" :
|
opType == REDUCE_AVG ? "REDUCE_AVG" :
|
||||||
opType == CV_REDUCE_MAX ? "CV_REDUCE_MAX" :
|
opType == REDUCE_MAX ? "REDUCE_MAX" :
|
||||||
opType == CV_REDUCE_MIN ? "CV_REDUCE_MIN" : "unknown operation type";
|
opType == REDUCE_MIN ? "REDUCE_MIN" : "unknown operation type";
|
||||||
string srcTypeStr, dstTypeStr;
|
string srcTypeStr, dstTypeStr;
|
||||||
getMatTypeStr( src.type(), srcTypeStr );
|
getMatTypeStr( src.type(), srcTypeStr );
|
||||||
getMatTypeStr( dstType, dstTypeStr );
|
getMatTypeStr( dstType, dstTypeStr );
|
||||||
@ -195,19 +195,19 @@ int Core_ReduceTest::checkCase( int srcType, int dstType, int dim, Size sz )
|
|||||||
CV_Assert( 0 );
|
CV_Assert( 0 );
|
||||||
|
|
||||||
// 1. sum
|
// 1. sum
|
||||||
tempCode = checkOp( src, dstType, CV_REDUCE_SUM, sum, dim );
|
tempCode = checkOp( src, dstType, REDUCE_SUM, sum, dim );
|
||||||
code = tempCode != cvtest::TS::OK ? tempCode : code;
|
code = tempCode != cvtest::TS::OK ? tempCode : code;
|
||||||
|
|
||||||
// 2. avg
|
// 2. avg
|
||||||
tempCode = checkOp( src, dstType, CV_REDUCE_AVG, avg, dim );
|
tempCode = checkOp( src, dstType, REDUCE_AVG, avg, dim );
|
||||||
code = tempCode != cvtest::TS::OK ? tempCode : code;
|
code = tempCode != cvtest::TS::OK ? tempCode : code;
|
||||||
|
|
||||||
// 3. max
|
// 3. max
|
||||||
tempCode = checkOp( src, dstType, CV_REDUCE_MAX, max, dim );
|
tempCode = checkOp( src, dstType, REDUCE_MAX, max, dim );
|
||||||
code = tempCode != cvtest::TS::OK ? tempCode : code;
|
code = tempCode != cvtest::TS::OK ? tempCode : code;
|
||||||
|
|
||||||
// 4. min
|
// 4. min
|
||||||
tempCode = checkOp( src, dstType, CV_REDUCE_MIN, min, dim );
|
tempCode = checkOp( src, dstType, REDUCE_MIN, min, dim );
|
||||||
code = tempCode != cvtest::TS::OK ? tempCode : code;
|
code = tempCode != cvtest::TS::OK ? tempCode : code;
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
@ -315,7 +315,7 @@ TEST(Core_PCA, accuracy)
|
|||||||
Mat rBackPrjTestPoints = rPCA.backProject( rPrjTestPoints );
|
Mat rBackPrjTestPoints = rPCA.backProject( rPrjTestPoints );
|
||||||
|
|
||||||
Mat avg(1, sz.width, CV_32FC1 );
|
Mat avg(1, sz.width, CV_32FC1 );
|
||||||
cv::reduce( rPoints, avg, 0, CV_REDUCE_AVG );
|
cv::reduce( rPoints, avg, 0, REDUCE_AVG );
|
||||||
Mat Q = rPoints - repeat( avg, rPoints.rows, 1 ), Qt = Q.t(), eval, evec;
|
Mat Q = rPoints - repeat( avg, rPoints.rows, 1 ), Qt = Q.t(), eval, evec;
|
||||||
Q = Qt * Q;
|
Q = Qt * Q;
|
||||||
Q = Q /(float)rPoints.rows;
|
Q = Q /(float)rPoints.rows;
|
||||||
@ -1559,10 +1559,10 @@ TEST(Reduce, regression_should_fail_bug_4594)
|
|||||||
cv::Mat src = cv::Mat::eye(4, 4, CV_8U);
|
cv::Mat src = cv::Mat::eye(4, 4, CV_8U);
|
||||||
std::vector<int> dst;
|
std::vector<int> dst;
|
||||||
|
|
||||||
EXPECT_THROW(cv::reduce(src, dst, 0, CV_REDUCE_MIN, CV_32S), cv::Exception);
|
EXPECT_THROW(cv::reduce(src, dst, 0, REDUCE_MIN, CV_32S), cv::Exception);
|
||||||
EXPECT_THROW(cv::reduce(src, dst, 0, CV_REDUCE_MAX, CV_32S), cv::Exception);
|
EXPECT_THROW(cv::reduce(src, dst, 0, REDUCE_MAX, CV_32S), cv::Exception);
|
||||||
EXPECT_NO_THROW(cv::reduce(src, dst, 0, CV_REDUCE_SUM, CV_32S));
|
EXPECT_NO_THROW(cv::reduce(src, dst, 0, REDUCE_SUM, CV_32S));
|
||||||
EXPECT_NO_THROW(cv::reduce(src, dst, 0, CV_REDUCE_AVG, CV_32S));
|
EXPECT_NO_THROW(cv::reduce(src, dst, 0, REDUCE_AVG, CV_32S));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Mat, push_back_vector)
|
TEST(Mat, push_back_vector)
|
||||||
|
@ -3018,7 +3018,7 @@ TEST(CovariationMatrixVectorOfMatWithMean, accuracy)
|
|||||||
cv::randu(src,cv::Scalar(-128), cv::Scalar(128));
|
cv::randu(src,cv::Scalar(-128), cv::Scalar(128));
|
||||||
cv::Mat goldMean;
|
cv::Mat goldMean;
|
||||||
|
|
||||||
cv::reduce(src,goldMean,0 ,CV_REDUCE_AVG, CV_32F);
|
cv::reduce(src,goldMean,0 ,REDUCE_AVG, CV_32F);
|
||||||
|
|
||||||
cv::calcCovarMatrix(src,gold,goldMean,singleMatFlags,CV_32F);
|
cv::calcCovarMatrix(src,gold,goldMean,singleMatFlags,CV_32F);
|
||||||
|
|
||||||
|
@ -6,9 +6,6 @@
|
|||||||
|
|
||||||
#include "opencv2/ts.hpp"
|
#include "opencv2/ts.hpp"
|
||||||
#include "opencv2/ts/ocl_test.hpp"
|
#include "opencv2/ts/ocl_test.hpp"
|
||||||
#include "opencv2/core/core_c.h"
|
|
||||||
|
|
||||||
#include "opencv2/core/cvdef.h"
|
|
||||||
#include "opencv2/core/private.hpp"
|
#include "opencv2/core/private.hpp"
|
||||||
#include "opencv2/core/hal/hal.hpp"
|
#include "opencv2/core/hal/hal.hpp"
|
||||||
|
|
||||||
|
@ -1398,8 +1398,8 @@ TEST(UMat, testTempObjects_Mat_issue_8693)
|
|||||||
randu(srcUMat, -1.f, 1.f);
|
randu(srcUMat, -1.f, 1.f);
|
||||||
srcUMat.copyTo(srcMat);
|
srcUMat.copyTo(srcMat);
|
||||||
|
|
||||||
reduce(srcUMat, srcUMat, 0, CV_REDUCE_SUM);
|
reduce(srcUMat, srcUMat, 0, REDUCE_SUM);
|
||||||
reduce(srcMat, srcMat, 0, CV_REDUCE_SUM);
|
reduce(srcMat, srcMat, 0, REDUCE_SUM);
|
||||||
|
|
||||||
srcUMat.convertTo(srcUMat, CV_64FC1);
|
srcUMat.convertTo(srcUMat, CV_64FC1);
|
||||||
srcMat.convertTo(srcMat, CV_64FC1);
|
srcMat.convertTo(srcMat, CV_64FC1);
|
||||||
|
@ -637,7 +637,7 @@ bool ExrEncoder::write( const Mat& img, const std::vector<int>& params )
|
|||||||
|
|
||||||
for( size_t i = 0; i < params.size(); i += 2 )
|
for( size_t i = 0; i < params.size(); i += 2 )
|
||||||
{
|
{
|
||||||
if( params[i] == CV_IMWRITE_EXR_TYPE )
|
if( params[i] == IMWRITE_EXR_TYPE )
|
||||||
{
|
{
|
||||||
switch( params[i+1] )
|
switch( params[i+1] )
|
||||||
{
|
{
|
||||||
|
@ -643,23 +643,23 @@ bool JpegEncoder::write( const Mat& img, const std::vector<int>& params )
|
|||||||
|
|
||||||
for( size_t i = 0; i < params.size(); i += 2 )
|
for( size_t i = 0; i < params.size(); i += 2 )
|
||||||
{
|
{
|
||||||
if( params[i] == CV_IMWRITE_JPEG_QUALITY )
|
if( params[i] == IMWRITE_JPEG_QUALITY )
|
||||||
{
|
{
|
||||||
quality = params[i+1];
|
quality = params[i+1];
|
||||||
quality = MIN(MAX(quality, 0), 100);
|
quality = MIN(MAX(quality, 0), 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( params[i] == CV_IMWRITE_JPEG_PROGRESSIVE )
|
if( params[i] == IMWRITE_JPEG_PROGRESSIVE )
|
||||||
{
|
{
|
||||||
progressive = params[i+1];
|
progressive = params[i+1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if( params[i] == CV_IMWRITE_JPEG_OPTIMIZE )
|
if( params[i] == IMWRITE_JPEG_OPTIMIZE )
|
||||||
{
|
{
|
||||||
optimize = params[i+1];
|
optimize = params[i+1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if( params[i] == CV_IMWRITE_JPEG_LUMA_QUALITY )
|
if( params[i] == IMWRITE_JPEG_LUMA_QUALITY )
|
||||||
{
|
{
|
||||||
if (params[i+1] >= 0)
|
if (params[i+1] >= 0)
|
||||||
{
|
{
|
||||||
@ -674,7 +674,7 @@ bool JpegEncoder::write( const Mat& img, const std::vector<int>& params )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( params[i] == CV_IMWRITE_JPEG_CHROMA_QUALITY )
|
if( params[i] == IMWRITE_JPEG_CHROMA_QUALITY )
|
||||||
{
|
{
|
||||||
if (params[i+1] >= 0)
|
if (params[i+1] >= 0)
|
||||||
{
|
{
|
||||||
@ -682,7 +682,7 @@ bool JpegEncoder::write( const Mat& img, const std::vector<int>& params )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( params[i] == CV_IMWRITE_JPEG_RST_INTERVAL )
|
if( params[i] == IMWRITE_JPEG_RST_INTERVAL )
|
||||||
{
|
{
|
||||||
rst_interval = params[i+1];
|
rst_interval = params[i+1];
|
||||||
rst_interval = MIN(MAX(rst_interval, 0), 65535L);
|
rst_interval = MIN(MAX(rst_interval, 0), 65535L);
|
||||||
|
@ -111,12 +111,12 @@ static bool rgb_convert (void *src, void *target, int width, int target_channels
|
|||||||
int target_depth);
|
int target_depth);
|
||||||
|
|
||||||
const static struct pam_format formats[] = {
|
const static struct pam_format formats[] = {
|
||||||
{CV_IMWRITE_PAM_FORMAT_NULL, "", NULL, {0, 0, 0, 0} },
|
{IMWRITE_PAM_FORMAT_NULL, "", NULL, {0, 0, 0, 0} },
|
||||||
{CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE, "BLACKANDWHITE", NULL, {0, 0, 0, 0} },
|
{IMWRITE_PAM_FORMAT_BLACKANDWHITE, "BLACKANDWHITE", NULL, {0, 0, 0, 0} },
|
||||||
{CV_IMWRITE_PAM_FORMAT_GRAYSCALE, "GRAYSCALE", NULL, {0, 0, 0, 0} },
|
{IMWRITE_PAM_FORMAT_GRAYSCALE, "GRAYSCALE", NULL, {0, 0, 0, 0} },
|
||||||
{CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA, "GRAYSCALE_ALPHA", NULL, {0, 0, 0, 0} },
|
{IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA, "GRAYSCALE_ALPHA", NULL, {0, 0, 0, 0} },
|
||||||
{CV_IMWRITE_PAM_FORMAT_RGB, "RGB", rgb_convert, {0, 1, 2, 0} },
|
{IMWRITE_PAM_FORMAT_RGB, "RGB", rgb_convert, {0, 1, 2, 0} },
|
||||||
{CV_IMWRITE_PAM_FORMAT_RGB_ALPHA, "RGB_ALPHA", NULL, {0, 1, 2, 0} },
|
{IMWRITE_PAM_FORMAT_RGB_ALPHA, "RGB_ALPHA", NULL, {0, 1, 2, 0} },
|
||||||
};
|
};
|
||||||
#define PAM_FORMATS_NO (sizeof (fields) / sizeof ((fields)[0]))
|
#define PAM_FORMATS_NO (sizeof (fields) / sizeof ((fields)[0]))
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ PAMDecoder::PAMDecoder()
|
|||||||
m_offset = -1;
|
m_offset = -1;
|
||||||
m_buf_supported = true;
|
m_buf_supported = true;
|
||||||
bit_mode = false;
|
bit_mode = false;
|
||||||
selected_fmt = CV_IMWRITE_PAM_FORMAT_NULL;
|
selected_fmt = IMWRITE_PAM_FORMAT_NULL;
|
||||||
m_maxval = 0;
|
m_maxval = 0;
|
||||||
m_channels = 0;
|
m_channels = 0;
|
||||||
m_sampledepth = 0;
|
m_sampledepth = 0;
|
||||||
@ -462,14 +462,14 @@ bool PAMDecoder::readHeader()
|
|||||||
|
|
||||||
if (flds_endhdr && flds_height && flds_width && flds_depth && flds_maxval)
|
if (flds_endhdr && flds_height && flds_width && flds_depth && flds_maxval)
|
||||||
{
|
{
|
||||||
if (selected_fmt == CV_IMWRITE_PAM_FORMAT_NULL)
|
if (selected_fmt == IMWRITE_PAM_FORMAT_NULL)
|
||||||
{
|
{
|
||||||
if (m_channels == 1 && m_maxval == 1)
|
if (m_channels == 1 && m_maxval == 1)
|
||||||
selected_fmt = CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE;
|
selected_fmt = IMWRITE_PAM_FORMAT_BLACKANDWHITE;
|
||||||
else if (m_channels == 1 && m_maxval < 256)
|
else if (m_channels == 1 && m_maxval < 256)
|
||||||
selected_fmt = CV_IMWRITE_PAM_FORMAT_GRAYSCALE;
|
selected_fmt = IMWRITE_PAM_FORMAT_GRAYSCALE;
|
||||||
else if (m_channels == 3 && m_maxval < 256)
|
else if (m_channels == 3 && m_maxval < 256)
|
||||||
selected_fmt = CV_IMWRITE_PAM_FORMAT_RGB;
|
selected_fmt = IMWRITE_PAM_FORMAT_RGB;
|
||||||
}
|
}
|
||||||
m_type = CV_MAKETYPE(m_sampledepth, m_channels);
|
m_type = CV_MAKETYPE(m_sampledepth, m_channels);
|
||||||
m_offset = m_strm.getPos();
|
m_offset = m_strm.getPos();
|
||||||
@ -512,7 +512,7 @@ bool PAMDecoder::readData(Mat& img)
|
|||||||
if( m_offset < 0 || !m_strm.isOpened())
|
if( m_offset < 0 || !m_strm.isOpened())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (selected_fmt != CV_IMWRITE_PAM_FORMAT_NULL)
|
if (selected_fmt != IMWRITE_PAM_FORMAT_NULL)
|
||||||
fmt = &formats[selected_fmt];
|
fmt = &formats[selected_fmt];
|
||||||
else {
|
else {
|
||||||
/* default layout handling */
|
/* default layout handling */
|
||||||
@ -662,8 +662,8 @@ bool PAMEncoder::write( const Mat& img, const std::vector<int>& params )
|
|||||||
|
|
||||||
/* parse save file type */
|
/* parse save file type */
|
||||||
for( size_t i = 0; i < params.size(); i += 2 )
|
for( size_t i = 0; i < params.size(); i += 2 )
|
||||||
if( params[i] == CV_IMWRITE_PAM_TUPLETYPE ) {
|
if( params[i] == IMWRITE_PAM_TUPLETYPE ) {
|
||||||
if ( params[i+1] > CV_IMWRITE_PAM_FORMAT_NULL &&
|
if ( params[i+1] > IMWRITE_PAM_FORMAT_NULL &&
|
||||||
params[i+1] < (int) PAM_FORMATS_NO)
|
params[i+1] < (int) PAM_FORMATS_NO)
|
||||||
fmt = &formats[params[i+1]];
|
fmt = &formats[params[i+1]];
|
||||||
}
|
}
|
||||||
|
@ -243,7 +243,7 @@ bool WebPEncoder::write(const Mat& img, const std::vector<int>& params)
|
|||||||
|
|
||||||
if (params.size() > 1)
|
if (params.size() > 1)
|
||||||
{
|
{
|
||||||
if (params[0] == CV_IMWRITE_WEBP_QUALITY)
|
if (params[0] == IMWRITE_WEBP_QUALITY)
|
||||||
{
|
{
|
||||||
comp_lossless = false;
|
comp_lossless = false;
|
||||||
quality = static_cast<float>(params[1]);
|
quality = static_cast<float>(params[1]);
|
||||||
|
@ -562,7 +562,7 @@ imreadmulti_(const String& filename, int flags, std::vector<Mat>& mats, int star
|
|||||||
if ((flags & IMREAD_ANYDEPTH) == 0)
|
if ((flags & IMREAD_ANYDEPTH) == 0)
|
||||||
type = CV_MAKETYPE(CV_8U, CV_MAT_CN(type));
|
type = CV_MAKETYPE(CV_8U, CV_MAT_CN(type));
|
||||||
|
|
||||||
if ((flags & CV_LOAD_IMAGE_COLOR) != 0 ||
|
if ((flags & IMREAD_COLOR) != 0 ||
|
||||||
((flags & IMREAD_ANYCOLOR) != 0 && CV_MAT_CN(type) > 1))
|
((flags & IMREAD_ANYCOLOR) != 0 && CV_MAT_CN(type) > 1))
|
||||||
type = CV_MAKETYPE(CV_MAT_DEPTH(type), 3);
|
type = CV_MAKETYPE(CV_MAT_DEPTH(type), 3);
|
||||||
else
|
else
|
||||||
|
@ -43,11 +43,8 @@
|
|||||||
#define __IMGCODECS_H_
|
#define __IMGCODECS_H_
|
||||||
|
|
||||||
#include "opencv2/imgcodecs.hpp"
|
#include "opencv2/imgcodecs.hpp"
|
||||||
#include "opencv2/imgcodecs/legacy/constants_c.h"
|
|
||||||
|
|
||||||
#include "opencv2/core/utility.hpp"
|
#include "opencv2/core/utility.hpp"
|
||||||
#include "opencv2/core/private.hpp"
|
#include "opencv2/core/private.hpp"
|
||||||
|
|
||||||
#include "opencv2/imgproc.hpp"
|
#include "opencv2/imgproc.hpp"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -656,7 +656,7 @@ public:
|
|||||||
|
|
||||||
// Update weights
|
// Update weights
|
||||||
// not normalized first
|
// not normalized first
|
||||||
reduce(trainProbs, weights, 0, CV_REDUCE_SUM);
|
reduce(trainProbs, weights, 0, REDUCE_SUM);
|
||||||
|
|
||||||
// Update means
|
// Update means
|
||||||
means.create(nclusters, dim, CV_64FC1);
|
means.create(nclusters, dim, CV_64FC1);
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include "opencv2/ts.hpp"
|
#include "opencv2/ts.hpp"
|
||||||
#include <opencv2/ts/cuda_test.hpp> // EXPECT_MAT_NEAR
|
#include <opencv2/ts/cuda_test.hpp> // EXPECT_MAT_NEAR
|
||||||
#include "opencv2/ml.hpp"
|
#include "opencv2/ml.hpp"
|
||||||
#include "opencv2/core/core_c.h"
|
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
using std::ifstream;
|
using std::ifstream;
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
#include "cascadedetect.hpp"
|
#include "cascadedetect.hpp"
|
||||||
#include "opencv2/core/core_c.h"
|
|
||||||
#include "opencv2/core/hal/intrin.hpp"
|
#include "opencv2/core/hal/intrin.hpp"
|
||||||
#include "opencl_kernels_objdetect.hpp"
|
#include "opencl_kernels_objdetect.hpp"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user