0
我得通过OpenCV的Mat
的坐标迭代一个问题:迭代至Mat
cv::Mat picture = cv::Mat(depth.rows, depth.cols, CV_32F);
for (int y = 0; y < depth.rows; ++y)
{
for (int x = 0; x < depth.cols; ++x)
{
float depthValue = (float) depth.at<float>(y,x);
picture.at<float>(y, x) = depthValue;
}
}
cv::namedWindow("picture", cv::WINDOW_AUTOSIZE);
cv::imshow("picture", picture);
cv::waitKey(0);
得到的图片:
之前(深度)
后(图)
它看起来像是 1.缩放和 2.停在约三分之一的宽度。有任何想法吗?
是不是还深入cv_32f?告诉我们它的定义请 –
此外'CV_32F'在这里是无效的。你应该使用'CV_32FC <通道数>'。详情请看[这里](http://stackoverflow.com/a/37530646/5008845) – Miki