从相机普罗硅中保存垫子图像

Save Mat image from camera prosilica

本文关键字:图像 保存 罗硅中 相机      更新时间:2023-10-16

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

请问有什么问题?

如果使用CV_32FC3Mat图像深度为 3。然后,您无法创建Mat映像,并且当您尝试写入该映像时,它会崩溃。