Saturday, July 19, 2014

OpenCV: IplImage, cvMat, CV::Mat

IplImage

From the beginning of OpenCV, which had started off using Intel Image Processing Library from 2001, this class primarily revolves around C. Compared to cvMat and cv::Mat, it has no memory allocation services, a common attribute to C programs. Many past reference material and tutorials will use this class. This class was relevant in OpenCV 1.x.

cvMat

cvMat is also a class also in OpenCV 1.x which answered problems as stated in IplImage as a matrix class.

cv::mat

cv::mat is a more object oriented, C++, version of cvMat, which is also a matrix class for image processing.

Why Post this?

The reason I brought this up was reading the second chapter in O'Reilly Learning OpenCV by Gary Bradski and Adrian Kaehler, recommended to me by an advisor/professor, uses IplImage, which differs from the online tutorials OpenCV offers for basic image processing. Online, the tutorial uses Mat as the object and imread to intake the image file while IplImage is singularly used as an object and to take in the image. Even so, it seems that the book chose to use IplImage because the book is based on OpenCV version 2.0. This may be because IplImage is most simple to start out with or it was still a habit of the 1.x versions.

No comments:

Post a Comment