Problem with MatExpr (A x B.t).t (Bug #2106)
Description
The following code:
void testMe() { cv::Mat1f a(2,2); cv::Mat1f b(1,2); cv::Mat1f c = (a*b.t()).t(); }
causes assertion failure:
OpenCV Error: Assertion failed (a_size.height == len) in gemm, file .../dev/Ai/opencv/modules/core/src/matmul.cpp, line 723
Am I expecting too much from MatExpr and should assign a*b.t() to a temporary ?
History
Updated by nemerle - over 12 years ago
If anyone else is having problems with this sequence of operations, using transpose of a matrix product transform
serves as a workaround
\(A x B).t => B.t x A.t
void testMeWorkaround() { cv::Mat1f a(2,2); cv::Mat1f b(1,2); cv::Mat1f c = b*a.t(); // was (a*b.t()).t() }
Updated by Vadim Pisarevsky over 12 years ago
thanks! fixed in r8808
- Status changed from Open to Done
Updated by Andrey Kamaev over 12 years ago
- Target version set to 2.4.2