mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Move cv::Mat out of core.hpp
This commit is contained in:
@@ -35,7 +35,7 @@ struct BaseElemWiseOp
|
||||
|
||||
virtual int getRandomType(RNG& rng)
|
||||
{
|
||||
return cvtest::randomType(rng, DEPTH_MASK_ALL_BUT_8S, 1,
|
||||
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_ALL_BUT_8S, 1,
|
||||
ninputs > 1 ? ARITHM_MAX_CHANNELS : 4);
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ struct CmpOp : public BaseElemWiseOp
|
||||
}
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
return cvtest::randomType(rng, DEPTH_MASK_ALL_BUT_8S, 1, 1);
|
||||
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_ALL_BUT_8S, 1, 1);
|
||||
}
|
||||
|
||||
double getMaxErr(int)
|
||||
@@ -455,7 +455,7 @@ struct CmpSOp : public BaseElemWiseOp
|
||||
}
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
return cvtest::randomType(rng, DEPTH_MASK_ALL_BUT_8S, 1, 1);
|
||||
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_ALL_BUT_8S, 1, 1);
|
||||
}
|
||||
double getMaxErr(int)
|
||||
{
|
||||
@@ -478,7 +478,7 @@ struct CopyOp : public BaseElemWiseOp
|
||||
}
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
return cvtest::randomType(rng, DEPTH_MASK_ALL, 1, ARITHM_MAX_CHANNELS);
|
||||
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_ALL, 1, ARITHM_MAX_CHANNELS);
|
||||
}
|
||||
double getMaxErr(int)
|
||||
{
|
||||
@@ -501,7 +501,7 @@ struct SetOp : public BaseElemWiseOp
|
||||
}
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
return cvtest::randomType(rng, DEPTH_MASK_ALL, 1, ARITHM_MAX_CHANNELS);
|
||||
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_ALL, 1, ARITHM_MAX_CHANNELS);
|
||||
}
|
||||
double getMaxErr(int)
|
||||
{
|
||||
@@ -718,8 +718,8 @@ struct ConvertScaleOp : public BaseElemWiseOp
|
||||
}
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
int srctype = cvtest::randomType(rng, DEPTH_MASK_ALL, 1, ARITHM_MAX_CHANNELS);
|
||||
ddepth = cvtest::randomType(rng, DEPTH_MASK_ALL, 1, 1);
|
||||
int srctype = cvtest::randomType(rng, _OutputArray::DEPTH_MASK_ALL, 1, ARITHM_MAX_CHANNELS);
|
||||
ddepth = cvtest::randomType(rng, _OutputArray::DEPTH_MASK_ALL, 1, 1);
|
||||
return srctype;
|
||||
}
|
||||
double getMaxErr(int)
|
||||
@@ -957,7 +957,7 @@ struct ExpOp : public BaseElemWiseOp
|
||||
ExpOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {};
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
return cvtest::randomType(rng, DEPTH_MASK_FLT, 1, ARITHM_MAX_CHANNELS);
|
||||
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_FLT, 1, ARITHM_MAX_CHANNELS);
|
||||
}
|
||||
void getValueRange(int depth, double& minval, double& maxval)
|
||||
{
|
||||
@@ -984,7 +984,7 @@ struct LogOp : public BaseElemWiseOp
|
||||
LogOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {};
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
return cvtest::randomType(rng, DEPTH_MASK_FLT, 1, ARITHM_MAX_CHANNELS);
|
||||
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_FLT, 1, ARITHM_MAX_CHANNELS);
|
||||
}
|
||||
void getValueRange(int depth, double& minval, double& maxval)
|
||||
{
|
||||
@@ -1070,7 +1070,7 @@ struct CartToPolarToCartOp : public BaseElemWiseOp
|
||||
}
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
return cvtest::randomType(rng, DEPTH_MASK_FLT, 1, 1);
|
||||
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_FLT, 1, 1);
|
||||
}
|
||||
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||
{
|
||||
@@ -1157,7 +1157,7 @@ struct CountNonZeroOp : public BaseElemWiseOp
|
||||
{}
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
return cvtest::randomType(rng, DEPTH_MASK_ALL, 1, 1);
|
||||
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_ALL, 1, 1);
|
||||
}
|
||||
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
||||
{
|
||||
@@ -1237,7 +1237,7 @@ struct NormOp : public BaseElemWiseOp
|
||||
};
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
int type = cvtest::randomType(rng, DEPTH_MASK_ALL_BUT_8S, 1, 4);
|
||||
int type = cvtest::randomType(rng, _OutputArray::DEPTH_MASK_ALL_BUT_8S, 1, 4);
|
||||
for(;;)
|
||||
{
|
||||
normType = rng.uniform(1, 8);
|
||||
@@ -1283,7 +1283,7 @@ struct MinMaxLocOp : public BaseElemWiseOp
|
||||
};
|
||||
int getRandomType(RNG& rng)
|
||||
{
|
||||
return cvtest::randomType(rng, DEPTH_MASK_ALL_BUT_8S, 1, 1);
|
||||
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_ALL_BUT_8S, 1, 1);
|
||||
}
|
||||
void saveOutput(const vector<int>& minidx, const vector<int>& maxidx,
|
||||
double minval, double maxval, Mat& dst)
|
||||
|
||||
@@ -211,7 +211,7 @@ protected:
|
||||
vector<int> pt;
|
||||
|
||||
if( !m || !CV_IS_MAT(m) || m->rows != test_mat.rows || m->cols != test_mat.cols ||
|
||||
cvtest::cmpEps( Mat(&stub1), Mat(&_test_stub1), &max_diff, 0, &pt, true) < 0 )
|
||||
cvtest::cmpEps( cv::cvarrToMat(&stub1), cv::cvarrToMat(&_test_stub1), &max_diff, 0, &pt, true) < 0 )
|
||||
{
|
||||
ts->printf( cvtest::TS::LOG, "the read matrix is not correct: (%.20g vs %.20g) at (%d,%d)\n",
|
||||
cvGetReal2D(&stub1, pt[0], pt[1]), cvGetReal2D(&_test_stub1, pt[0], pt[1]),
|
||||
@@ -241,7 +241,7 @@ protected:
|
||||
if( !CV_ARE_TYPES_EQ(&stub, &_test_stub) ||
|
||||
!CV_ARE_SIZES_EQ(&stub, &_test_stub) ||
|
||||
//cvNorm(&stub, &_test_stub, CV_L2) != 0 )
|
||||
cvtest::cmpEps( Mat(&stub1), Mat(&_test_stub1), &max_diff, 0, &pt, true) < 0 )
|
||||
cvtest::cmpEps( cv::cvarrToMat(&stub1), cv::cvarrToMat(&_test_stub1), &max_diff, 0, &pt, true) < 0 )
|
||||
{
|
||||
ts->printf( cvtest::TS::LOG, "readObj method: the read nd matrix is not correct: (%.20g vs %.20g) vs at (%d,%d)\n",
|
||||
cvGetReal2D(&stub1, pt[0], pt[1]), cvGetReal2D(&_test_stub1, pt[0], pt[1]),
|
||||
@@ -259,7 +259,7 @@ protected:
|
||||
if( !CV_ARE_TYPES_EQ(&stub, &_test_stub) ||
|
||||
!CV_ARE_SIZES_EQ(&stub, &_test_stub) ||
|
||||
//cvNorm(&stub, &_test_stub, CV_L2) != 0 )
|
||||
cvtest::cmpEps( Mat(&stub1), Mat(&_test_stub1), &max_diff, 0, &pt, true) < 0 )
|
||||
cvtest::cmpEps( cv::cvarrToMat(&stub1), cv::cvarrToMat(&_test_stub1), &max_diff, 0, &pt, true) < 0 )
|
||||
{
|
||||
ts->printf( cvtest::TS::LOG, "C++ method: the read nd matrix is not correct: (%.20g vs %.20g) vs at (%d,%d)\n",
|
||||
cvGetReal2D(&stub1, pt[0], pt[1]), cvGetReal2D(&_test_stub1, pt[1], pt[0]),
|
||||
@@ -271,11 +271,11 @@ protected:
|
||||
cvRelease((void**)&m_nd);
|
||||
|
||||
Ptr<CvSparseMat> m_s = (CvSparseMat*)fs["test_sparse_mat"].readObj();
|
||||
Ptr<CvSparseMat> _test_sparse_ = (CvSparseMat*)test_sparse_mat;
|
||||
Ptr<CvSparseMat> _test_sparse_ = cvCreateSparseMat(test_sparse_mat);
|
||||
Ptr<CvSparseMat> _test_sparse = (CvSparseMat*)cvClone(_test_sparse_);
|
||||
SparseMat m_s2;
|
||||
fs["test_sparse_mat"] >> m_s2;
|
||||
Ptr<CvSparseMat> _m_s2 = (CvSparseMat*)m_s2;
|
||||
Ptr<CvSparseMat> _m_s2 = cvCreateSparseMat(m_s2);
|
||||
|
||||
if( !m_s || !CV_IS_SPARSE_MAT(m_s) ||
|
||||
!cvTsCheckSparse(m_s, _test_sparse,0) ||
|
||||
|
||||
@@ -734,7 +734,7 @@ void Core_ArrayOpTest::run( int /* start_from */)
|
||||
}
|
||||
}
|
||||
|
||||
Ptr<CvSparseMat> M2 = (CvSparseMat*)M;
|
||||
Ptr<CvSparseMat> M2 = cvCreateSparseMat(M);
|
||||
MatND Md;
|
||||
M.copyTo(Md);
|
||||
SparseMat M3; SparseMat(Md).convertTo(M3, Md.type(), 2);
|
||||
|
||||
@@ -2292,9 +2292,9 @@ void Core_SolvePolyTest::run( int )
|
||||
cvFlip(&amat, &amat, 0);
|
||||
int nr2;
|
||||
if( cubic_case == 0 )
|
||||
nr2 = cv::solveCubic(cv::Mat(&amat),umat2);
|
||||
nr2 = cv::solveCubic(cv::cvarrToMat(&amat),umat2);
|
||||
else
|
||||
nr2 = cv::solveCubic(cv::Mat_<float>(cv::Mat(&amat)), umat2);
|
||||
nr2 = cv::solveCubic(cv::Mat_<float>(cv::cvarrToMat(&amat)), umat2);
|
||||
cvFlip(&amat, &amat, 0);
|
||||
if(nr2 > 0)
|
||||
std::sort(ar2.begin(), ar2.begin()+nr2, pred_double());
|
||||
|
||||
Reference in New Issue
Block a user