-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Closed
Labels
Milestone
Description
Test code to FAIL:
Mat a(Size(10, 5), CV_32FC1, 5);
Mat b(Size(10, 5), CV_32FC1, 2);
MatExpr r = a * b.t(); // gemm
cout << r.size() << endl;
cout << Mat(r).size() << endl;
Mat dst;
cv::add(r, Scalar(1), dst); // Exception raised
output:
[10 x 5]
[5 x 5]
... matrix_iterator.cpp:72: error: (-215:Assertion failed) A.size == arrays[i0]->size in function 'init'
Test code to PASS:
Mat a(Size(10, 5), CV_32FC1, 5);
Mat b(Size(10, 5), CV_32FC1, 2);
MatExpr r = a * b.t(); // gemm
Mat dst;
cv::add(Mat(r), Scalar(1), dst);
cout << dst << endl;
cout << r << endl;
(but gemm() is called twice due MatExpr "optimization")
More checks: master...alalek:check_matexpr_size
Reactions are currently unavailable