使用cvSaveImage保存IplImage(不是IplImage*)

som*_*ech 0 c opencv

我想使用下面的代码保存IplImage(不是IplImage*)

IplImage ipl_from_mat((IplImage)imgDisparity8U); 
cvNamedWindow("window", CV_WINDOW_AUTOSIZE); 
variable when you need it as IplImage* 
cvShowImage("window", &ipl_from_mat);  
cvSaveImage("disparity.jpg",ipl_from_mat);//Problem with this line
Run Code Online (Sandbox Code Playgroud)

但它似乎无法实现.请帮我.

谢谢和关心Somu

JMB*_*ise 6

你必须传递这样的指针是不可能的:

cvSaveImage("disparity.jpg", &ipl_from_mat);
Run Code Online (Sandbox Code Playgroud)