Opencv multiply scalar and matrix

后端 未结 5 2220
北海茫月
北海茫月 2021-02-19 06:11

I have been trying to achieve something which should pretty trivial and is trivial in Matlab.

I want to simply achieve something such as:

cv::Ma         


        
5条回答
  •  无人及你
    2021-02-19 06:56

    For big Mats you should use forEach.

    If C++11 is available:

    m.forEach([&](double& element, const int position[]) -> void
    {
    element *= 5;
    }
    );
    

提交回复
热议问题