Mat_ -> Matx conversion sets matrix to all zeros (Bug #3891)
Description
The automatic conversion from Mat_ to Matx always sets the matrix to zero. This is because the corresponding operator
calls the standard constructor which then sets all values to zero.
The bad thing about this is, that this conversion also happens automatically if a function accepting Matx is called with a Mat_ object. See the example program: the first matrix is non-zero while the second and third are all zero.
Fixing the bug by changingthis->Mat::operator Matx<typename DataType<_Tp>::channel_type, m, n>();
tothis->Mat::operator Matx<typename DataType<_Tp>::channel_type, m, n>((_Tp*)data);
did not work - the standard constructor is still called.
Associated revisions
Merge pull request #3891 from mshabunin:fix-v4l2-link
History
Updated by Philipp Hasper over 10 years ago
- Target version set to 3.0-beta
Updated by Andrey Pavlenko over 10 years ago
Philipp, thanks for the report.
OpenCV community would appreciate if you also fix the problem and submit a pull-request.
Otherwise please wait for the fix by somebody other.
- Status changed from New to Open
- Assignee set to Andrey Pavlenko
- Difficulty set to Medium
- Priority changed from Blocker to High
- Category set to core
Updated by Maksim Shabunin almost 10 years ago
- Target version changed from 3.0-beta to 3.0
Updated by Vadim Pisarevsky almost 10 years ago
at least on OSX with Xcode 6.1 and clang the code works fine
- Status changed from Open to Cancelled
Updated by Alexander Alekhin over 9 years ago
Problem exists for MSVS2010 / MSVS 2012 builds and test "Core_Matx.fromMat_" failed.
- Assignee changed from Andrey Pavlenko to Alexander Alekhin
- Status changed from Cancelled to Open
Updated by Alexander Alekhin over 9 years ago
- Status changed from Open to Done