Opencv multiply scalar and matrix

后端 未结 5 2221
北海茫月
北海茫月 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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-19 06:52

    For java there is no operator overloading, but the Mat object provides the functionality with a convertTo method.

    Mat dst= new Mat(src.rows(),src.cols(),src.type());
    src.convertTo(dst,-1,scale,offset);
    

    Doc on this method is here

提交回复
热议问题