从相机prosilica保存垫图像

时间:2014-04-05 22:31:05

标签: c++ opencv mat

我正在开发一个从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);

请问有什么问题?

1 个答案:

答案 0 :(得分:0)

如果您使用Mat

CV_32FC3图片深度为3。然后你无法创建Mat图像,当你尝试编写该图像时它会崩溃。