2

in openCV I regularly use cv::Mat for almost everything. Now, I need to use emgu CV and use the Matrix-object in stat, but some functions are not supported?!... may I use the image-class instead?

When to use image and when to use matrix in emgu CV?

P.S.: Currently I'm looking for a way to define a ROI on a matrix but didn't find a way without copying the data.

Version: Emgu.CV-2.4.2

Kevin Panko
  • 8,356
  • 19
  • 50
  • 61
Thomas
  • 2,345
  • 1
  • 18
  • 17
  • 1
    Instead of setting ROI, use GetSubRect method of Matrix. It will not do any deep copying. This is effectively same thing as setting ROI, though it may not appear to be so initially. – sumeet Sep 26 '13 at 14:07

2 Answers2

3

I know that in the latest version of OpenCV, the Mat object is prefered to iplImage for a lot of reasons.

In EmguCV, things are different. I think that the rule of thumbs is to use Image<> when the data itself is supposed to be an image and Mat<> when you need to work with a matrix. Work with what you need and the emguCV object should have the right contructor/function for your needs.

For the ROI, the comment by sumeet is very good.

Hope it helps!

Community
  • 1
  • 1
Jean-François Côté
  • 4,200
  • 11
  • 52
  • 88
  • As of OpenCV 3.0, `IplImage` is being phased out. EmguCV 3.0 is following along. `Image<,>` is not officially deprecated yet, but beware. – kdbanman Jul 13 '15 at 16:41
3

As of OpenCV 3.0, OpenCV is phasing out IplImage. EmguCV's Image<,> is a wrapper around IplImage, so Image<,> is being phased out of EmguCV.

Use Mat and CvInvoke wherever possible. Avoid Image<,> and its methods.

kdbanman
  • 10,161
  • 10
  • 46
  • 78