问题
Tried to compile some code that uses OpenCV and got this error:
1 |
|
The code at that error line tries to construct a cv::Mat object from IplImage:
1 2 3 4 5 6 |
|
解决办法
It turns out this code worked in older versions of OpenCV. But with recent versions of OpenCV, this cv::Mat constructor is no longer present.
Instead, the conversion has to be performed using a cv::cvarrToMat function:
1 2 3 4 5 6 |
|
Tried with: OpenCV 2.4.9 and Ubuntu 12.04 LTS