0

I tried to convert mat image to IplImage but i could not able to convert it , i tried like this

Mat frame=imread("image path");
IplImage* image=IplImage(frame);

I got the error like cannot convert 'IplImage {aka _IplImage}' to 'IplImage* {aka _IplImage*}' in initialization...please any one tell how to convert in opencv 3.0

berak
  • 39,159
  • 9
  • 91
  • 89
  • don't do it. IplImage is mega deprecated in 3.0. If you must use IplImage (for dependacy issues/legacy code) then use an older version of OpenCV – GPPK Mar 30 '15 at 06:51
  • they removed any conversions like that in the 3.0 api. do not use IplImages in the 1st place, please. – berak Mar 30 '15 at 06:53
  • Deprecation aside, the error above just indicates that the compiler can't convert from the object to the pointer; `IplImage* image = new IplImage(frame);` should do the trick - don't forget to `delete` the pointer later, though. At least that's still working in 2.4.9, and the struct in 3.0 still seems to have the constructor. Also possible duplicate: [Converting cv::Mat to IplImage*](http://stackoverflow.com/questions/4664187/converting-cvmat-to-iplimage) ;) – ChK Mar 30 '15 at 08:23

0 Answers0