c++ - opencv Mat ::convertTo assertion error

浏览:56日期:2023-05-08

问题描述

Mat sample(400,image_queue[i].size(),CV_32FC1);image_queue[i][j].reshape(0,1).convertTo(sample.col(j),CV_32FC1,1/255.0);

我想把 image_queue[i][j]这张图(CV_8UC,灰度图,20*20)作为sample的一列。执行第二句的时候报异常。!

c++ - opencv Mat ::convertTo assertion error

搞不懂为什么。求教!

问题解答

回答1:

Mat sample(400,image_queue[i].size(),CV_32FC1);

中image_queue[i].size()是你图像矩阵的一条边长吧,和图像的大小有什么对应关系吗

相关文章: