Ask Your Question
4

what is the difference of Mat and Iplimage

asked Apr 5 '13

Heshan Sandeepa gravatar image

i am using opencv and c++ for my OCR application. There i am confusing with Mat and Iplimage data structures. i saw following both ways,

  1. IplImage* img = cvLoadImage("C:/MyPic.jpg");
  2. Mat image = imread( argv[1] );

can any one explain what is the c++ code here? Mat or Iplimage?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
13

answered Apr 5 '13

IplImage is the original format for storing image data from the old OpenCV1.x interface which is also called the C - style interface.

Mat is the newer format from the OpenCV2.x versions and on. This is the C++ interface. Largest advantage is that you do not have to take care of pointers anymore. You do not have to deallocate memory, so you do not have to worry that the assigned memory will be locked forever. The garbage collector of the C++ interface will do the work for you :)

I suggest sticking with the newer C++ interface, since it results in much clearer and more understandable code.

Preview: (hide)

Comments

1

hi steven ,thank u very for consideration about my question.

Heshan Sandeepa gravatar imageHeshan Sandeepa (Apr 5 '13)edit

Question Tools

Stats

Asked: Apr 5 '13

Seen: 14,675 times

Last updated: Apr 05 '13