-2

As it is said in the title, i want to convert an image into a matrix to be able to do some calculation i have used this declaration but it show me an error : no matching function for call to c::Mat::Mat(IplImage*&)

IplImage* image1 = cvLoadImage("C://images//PolarImage300915163358.bmp", 1);
Mat mtx(image1); // convert IplImage* -> Mat

is there something wrong with this declaration

ner
  • 711
  • 3
  • 13
  • 30
  • 1
    Don't mix C and C++ interfaces. `IplImage` is outdated, as it is `cvLoadImage`. Use instead `cv::imread`. [Here](http://docs.opencv.org/2.4/doc/tutorials/introduction/display_image/display_image.html) you find a tutorial. Note: `cv::Mat` is already the preferred OpenCV image format. – Antonio May 02 '16 at 13:21
  • also you could have tried this [solution](http://stackoverflow.com/a/30849778/888688), but as @Antonio said, the c++ interface is preferred, specially if your final goal is to get a `cv::Mat`. – api55 May 02 '16 at 13:31

1 Answers1

-1

It worked with this declaration

Mat   image1 = imread("C://images//PolarImage300915163358.bmp");
Andy
  • 49,085
  • 60
  • 166
  • 233
ner
  • 711
  • 3
  • 13
  • 30