"Mat::col() +=" doesn't work properly for matrix with 4 rows (Bug #2788)


Added by Bo Li about 12 years ago. Updated about 12 years ago.


Status:Done Start date:2013-02-08
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:2.4.4
Affected version:2.4.3 Operating System:
Difficulty: HW Platform:
Pull request:https://github.com/Itseez/opencv/pull/460

Description

For the following code.

#include <opencv2/opencv.hpp>

int main()
{
    cv::Mat m = (cv::Mat_<double>(4, 2) << 1, 2, 3, 4, 5, 6, 7, 8); 
    m.col(1) += 10; 
    std::cout << m << std::endl; 
}

Its output is

[1, 12;
 3, 4;
 5, 6;
 7, 8]

It should be

[1, 12;
 3, 14;
 5, 16;
 7, 18]

If changing m to be 5x2 or 3x2, then the result is right.


Associated revisions

Revision 7071bd63
Added by Kirill Kornyakov about 12 years ago

Added two tests to highlight bug #2788

Revision c9db91ac
Added by Alexander Alekhin almost 11 years ago

Merge pull request #2788 from alalek:icv_public

History

Updated by Kirill Kornyakov about 12 years ago

Looks like a bug, I've created a test that highlights the problem: https://github.com/Itseez/opencv/pull/470. @Bo Li, it would be great if you could prepare such pull request by yourself next time. It would simplify the process a lot! BTW, you can try to debug it since all team is kind of busy right now... ;-)

  • Category set to core
  • Target version set to 2.4.4
  • Description changed from For the following code. #include <opencv2/opencv.hpp> int main()... to For the following code. <pre> #include <opencv2/opencv.hpp> in... More

Updated by Kirill Kornyakov about 12 years ago

@Bo, thank you for the pull request, we'll review it soon!

  • Pull request set to https://github.com/Itseez/opencv/pull/460
  • Assignee set to Vadim Pisarevsky

Updated by Bo Li about 12 years ago

:-)
Kirill Kornyakov wrote:

@Bo, thank you for the pull request, we'll review it soon!

Updated by Kirill Kornyakov about 12 years ago

  • Status changed from Open to Done

Also available in: Atom PDF