我正在开发一个从prosilica相机中获取图像的程序。
我将帧恢复为包含ImageBuffer变量的strcut。
为了保存恢复的图像,我喜欢这样:
tPvFrame frame;// a struct given by the SDK camera.
Mat Image=Mat(frame->Height, frame->Width, CV_32FC3, frame->ImageBuffer);
//the image depth is 5.
cout<<"Depth Image---------------------------"<<Image.depth()<<endl;
//The program has unexpectedly finished here
imwrite("image.jpg", Image);
请问有什么问题?
答案 0 :(得分:0)
Mat
, CV_32FC3
图片深度为3。然后你无法创建Mat
图像,当你尝试编写该图像时它会崩溃。