这是因为图像参数类型不同的缘故,opencv无法直接从iplimage向mat转换,需要函数进行转换。比如:IplImage * ipl = ...;cv::Mat m = cv::cvarrToMat(ipl);供参考