user804649
user804649

Reputation: 315

How do I convert Mat to IplImage in C NOT C++

I'm using some old C code that uses the old deprecated IplImage type.

I'm using the new OpenCV 2.3.1 for Android, and the images I get from the camera are CvMats. I want to convert them to IplImage so I can pass it to the native function.

Alternatively, I could modify the original function to accept a CvMat and convert it to IplImage inside the body of the function, but I need to do this in C NOT C++.

Upvotes: 1

Views: 1389

Answers (1)

Jouni K. Seppänen
Jouni K. Seppänen

Reputation: 44128

Use cvGetImage:

IplImage tmp;
IplImage* result = cvGetImage((CvArr*) mat, &tmp);

Upvotes: 6

Related Questions