|
|
@ -118,7 +118,7 @@ bool CV_OperationsTest::TestMat() |
|
|
|
float data[] = { sqrt(2.f)/2, -sqrt(2.f)/2, 1.f, sqrt(2.f)/2, sqrt(2.f)/2, 10.f }; |
|
|
|
float data[] = { sqrt(2.f)/2, -sqrt(2.f)/2, 1.f, sqrt(2.f)/2, sqrt(2.f)/2, 10.f }; |
|
|
|
Mat rot_2x3(2, 3, CV_32F, data); |
|
|
|
Mat rot_2x3(2, 3, CV_32F, data); |
|
|
|
|
|
|
|
|
|
|
|
Mat res = one_3x1 + shi_3x1 + shi_3x1 + shi_3x1; |
|
|
|
Mat res = one_3x1 + shi_3x1 + shi_3x1 + shi_3x1; |
|
|
|
res = Mat(Mat(2 * rot_2x3) * res - shi_2x1) + shift; |
|
|
|
res = Mat(Mat(2 * rot_2x3) * res - shi_2x1) + shift; |
|
|
|
|
|
|
|
|
|
|
|
Mat tmp, res2; |
|
|
|
Mat tmp, res2; |
|
|
@ -751,20 +751,11 @@ bool CV_OperationsTest::TestTemplateMat() |
|
|
|
if (Mat3w(1, 1).channels() != 3) throw test_excep(); |
|
|
|
if (Mat3w(1, 1).channels() != 3) throw test_excep(); |
|
|
|
if (Mat3s(1, 1).channels() != 3) throw test_excep(); |
|
|
|
if (Mat3s(1, 1).channels() != 3) throw test_excep(); |
|
|
|
|
|
|
|
|
|
|
|
vector<Mat_<float> > mvf, mvf2; |
|
|
|
|
|
|
|
Mat_<Vec2f> mf2; |
|
|
|
|
|
|
|
mvf.push_back(Mat_<float>::ones(4, 3)); |
|
|
|
|
|
|
|
mvf.push_back(Mat_<float>::zeros(4, 3)); |
|
|
|
|
|
|
|
merge(mvf, mf2); |
|
|
|
|
|
|
|
split(mf2, mvf2); |
|
|
|
|
|
|
|
CV_Assert( norm(mvf2[0], mvf[0], CV_C) == 0 && |
|
|
|
|
|
|
|
norm(mvf2[1], mvf[1], CV_C) == 0 ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
Mat a(2,2,CV_32F,1.f); |
|
|
|
Mat a(2,2,CV_32F,1.f); |
|
|
|
Mat b(1,2,CV_32F,1.f); |
|
|
|
Mat b(1,2,CV_32F,1.f); |
|
|
|
Mat c = (a*b.t()).t(); |
|
|
|
Mat c = (a*b.t()).t(); |
|
|
|
CV_Assert( norm(c, CV_L1) == 4. ); |
|
|
|
CV_Assert( norm(c, CV_L1) == 4. ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const test_excep& e) |
|
|
|
catch (const test_excep& e) |
|
|
|