Question

I know many people are interested in the technical difference between IplImage and CvMat. (Yes, NOT cv::Mat(*), but CvMat.) So, let's clear the differences with a practical focus.

Is CvMat the refcounted version of IplImage? Is CvMat only a wrapper around IplImage? If so, why did they also develop CvMat?

I asked these questions because I saw IplImage being far and away the most popular at the overall searches and in my opinion it also has the most posts.

What is the benefit of still using IplImage instead of newer structures?

(*)(I have put also c++ tag here as many people are using it also with c++, and also some libraries prefer IplImage.)

Was it helpful?

Solution 2

IplImage came from the Intel Image Processing library, according to the docs: http://opencv.willowgarage.com/documentation/basic_structures.html#iplimage

This question also addresses the CvMat structure, which may be of note to you: What is the memory structure of OpenCV's cvMat?

As regards which is more beneficial: while there may be slight speed differences here or there with either CvMat or IplImage in various contexts — it depends on what you want to do. E.g. do you need to share a matrix structure in memory? Do you need to efficiently serialize, or search, etc? The application matters.

(Theoretically, one advantage offered by IplImage is that due to its pedigree, it's generally more compatible with existing implementations, as you noted.)

OTHER TIPS

I recommend you to read paragraph OpenCV Primitive Data Types from the book Learning OpenCV. There's a big and good explanation about difference between these two datatypes.

Answering your question:

What is the benefit of still using IplImage instead of newer structures?

Maybe none. It has been deprecated by the devs for some reason, I would guess that the reason why you still find it a lot is because of legacy code; because people still follow old code samples not being aware that the structure is deprecated and because "Learning OpenCV first edition" is outdated with regards to the opencv functions signatures and data structures but it is still followed by a lot of people starting with opencv.

As a reference, Learning OpenCV 2nd edition is supposed to be out March 2013, but don't quote me on that ;)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top