Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between cvMat, Mat and IpImage

Tags:

opencv

I'm trying to discover opencv library at the moment, but it seems a bit messy with the data structures. so there's cv::Mat, cvMat and IpImage, and different examples to each. I understand that there has been a migration for opencv from C to C++, and then major changes done to version 2.4.
So which one of these data structure is recommended, and generally are there any documentation like an opencv programmers guide explaining the recommended data structure and how this code migration happened (I'm not asking about the code api or the tutorials page)

Many thanks

like image 387
Moataz Elmasry Avatar asked Jun 14 '12 16:06

Moataz Elmasry


People also ask

What is cvMat?

cv::Mat is the c++ version of cvMat , they are identical and if you look through the code you will see that the c++ version just goes to the c code. If you use C++ use cv::Mat . C doesn't have namespaces so you have the kludge of putting cv in front of each function name so it doesn't clash with other library.

How do I know what type of CV mat I have?

We can check the Data Type of a cv::Mat using “type()” method. This is a method you can use for checking the type of an cv::Mat.

What is IplImage in OpenCV?

The IplImage is taken from the Intel Image Processing Library, in which the format is native. OpenCV only supports a subset of possible IplImage formats, as outlined in the parameter list above. In addition to the above restrictions, OpenCV handles ROIs differently.

What is use of mat class in OpenCV?

The Mat class of OpenCV library is used to store the values of an image. It represents an n-dimensional array and is used to store image data of grayscale or color images, voxel volumes, vector fields, point clouds, tensors, histograms, etc.


1 Answers

cv::Mat is the c++ version of cvMat, they are identical and if you look through the code you will see that the c++ version just goes to the c code. If you use C++ use cv::Mat.

C doesn't have namespaces so you have the kludge of putting cv in front of each function name so it doesn't clash with other library

IpImage is the old Intel IPP compatible image format. You should never need to use it, but if you are working with some other old library there are function to convert between them.

Start at Welcome to opencv documentation for the new documentation

(OpenCV has been through a few re-orgs and the old websites have all stayed up confusing matters. From now on hopefully everything is under http://opencv.org/)

like image 159
Martin Beckett Avatar answered Oct 12 '22 00:10

Martin Beckett