How to fill Matrix with zeros in OpenCV?

前端 未结 8 935
-上瘾入骨i
-上瘾入骨i 2020-12-15 03:36

The code below causes an exception. Why?

#include 
#include 

using namespace cv;
using namespace std;

void mai         


        
8条回答
  •  有刺的猬
    2020-12-15 04:17

    If You are more into programming with templates, You may also do it this way...

    template
    ... some algo ...
    cv::Mat mat = cv::Mat_<_Tp>::zeros(rows, cols);
    mat.at<_Tp>(i, j) = val;
    

提交回复
热议问题