就一行,大家借鉴
Mat image=Mat(stImageInfo.nHeight,stImageInfo.nWidth,CV_8UC1,pData);
这样还是没有图形界面的,用opencv加一个imshow就行
nRet = MV_CC_GetOneFrameTimeout(handle, pData, nDataSize, &stImageInfo, 1000);
Mat image=Mat(stImageInfo.nHeight,stImageInfo.nWidth,CV_8UC1,pData);
Mat img_rgb;
cvtColor(image, img_rgb, COLOR_GRAY2RGB);//灰度图
namedWindow("检测结果");
imshow("检测结果",drawing);
waitKey(5);