Skip to content

Problem with MatExpr division and multiplication #9720

@kauba

Description

@kauba
System information (version)
  • OpenCV => 3.3.0
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2015
Detailed description
Mat m1(1, 1, CV_32FC1);
m1.at<float>(0) = 1.f;

const float a = 0.1f;

cout << (Mat)(m1.mul((a / m1))) << endl;
cout << (Mat)(m1.mul((Mat)(a / m1))) << endl;

Both expressions m1.mul((a / m1)) and m1.mul((Mat)(a / m1)) are expected to give the same result (0.1), but only the second one works. the first gives 10.

Steps to reproduce

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions