Mixing Matx and Mat in cv::add results in an error (Bug #2336)
Description
When mixing cv::Mat and cv::Matx for the source arguments in cv::add, OpenCV complains about not being to do the operation even though it should be possible.
A short example with 3x3 matrices should explain it quite well.
Error:cv::add(cv::Mat(3, 3, CV_32F), cv::Matx33f(), cv::Matx33f());
Works (surrounded 2nd argument with cv::Mat)cv::add(cv::Mat(3, 3, CV_32F), cv::Mat(cv::Matx33f()), cv::Matx33f());
Works too (not mixing src1 and src2)cv::add(cv::Matx33f(), cv::Matx33f(), cv::Matx33f());
The problem seems to be that the arithm_op function is fine when the source kinds are equal, but does a wrong check otherwise and complains as soon as one of the input matrices is of type MatX.
Associated revisions
added test for #2336
fixed mixed-type array operations (bug #2336)
Merge pull request #2336 from SpecLad:useOclChanged
History
Updated by Reto Grieder over 12 years ago
Forgot to mention: OpenCV 2.4.2, running on Windows and iOS (same problem).
Updated by Alexander Shishkov over 12 years ago
- Category set to core
- Description changed from When mixing cv::Mat and cv::Matx for the source arguments in cv::add, OpenCV ... to When mixing cv::Mat and cv::Matx for the source arguments in cv::add, OpenCV ... More
Updated by Reto Grieder over 12 years ago
For starters, I believe the query (kind1 == kind2)
on line 1227 in arithm.cpp
to be insufficient because it shouldn't make a difference whether the input is cv::Mat or cv::Matx as long as a matrix header can be derived.
Updated by Vadim Pisarevsky over 12 years ago
thanks! the bug was fixed in commmit:1ded15
- Status changed from Open to Done
- Target version set to 2.4.3
- Assignee set to Vadim Pisarevsky