.exe 已触发了一个断点。

#include<opencv.hpp>
#include<iostream>

using namespace std;
using namespace cv;

int main()
{
	//读入8位灰度图像
	Mat src;
	src = imread("Lena.png", 0);
	imshow("Src image", src);
	Mat dst(src.rows, src.cols, CV_8UC3, Scalar(0, 0, 0));
	for (int i = 0; i < src.rows; i++)
	{
		uchar *current = src.ptr<uchar>(i);
		Vec3f *current_d = dst.ptr<Vec3f>(i);
		for (int j = 0; j < src.cols; j++)
		{
			current_d[j][0] = current[j];
			current_d[j][1] = current[j];
			current_d[j][2] = current[j];
		}
	}
	cout << dst << endl;
	imshow("假彩色图像", dst);
	while (waitKey(0) != 'q') {};
}

为什么会出现这种问题,当把dst构造函数列数设为src.cols*src.cols可以显示图片